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 a1a5311800..fc95a0db28 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 @@ -1,109 +1,31 @@ { "type": "File", - "start": 0, - "end": 229, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 18, - "column": 10 - } - }, + "start":0,"end":229,"loc":{"start":{"line":1,"column":0},"end":{"line":18,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 229, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 18, - "column": 10 - } - }, + "start":0,"end":229,"loc":{"start":{"line":1,"column":0},"end":{"line":18,"column":10}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":6,"end":76,"loc":{"start":{"line":1,"column":6},"end":{"line":6,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "nonTrailing" - }, + "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17},"identifierName":"nonTrailing"}, "name": "nonTrailing" }, "init": { "type": "ArrayExpression", - "start": 20, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":20,"end":76,"loc":{"start":{"line":1,"column":20},"end":{"line":6,"column":1}}, "elements": [ { "type": "StringLiteral", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":24,"end":29,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7}}, "extra": { "rawValue": "One", "raw": "\"One\"" @@ -112,18 +34,7 @@ }, { "type": "StringLiteral", - "start": 50, - "end": 55, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":50,"end":55,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":7}}, "extra": { "rawValue": "Two", "raw": "\"Two\"" @@ -133,68 +44,24 @@ { "type": "CommentLine", "value": " One", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - } + "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 - } - } + "start":41,"end":47,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":9}} } ], "trailingComments": [ { "type": "CommentLine", "value": " Three", - "start": 56, - "end": 64, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 16 - } - } + "start":56,"end":64,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":16}} }, { "type": "CommentLine", "value": " Four", - "start": 67, - "end": 74, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 9 - } - } + "start":67,"end":74,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":9}} } ] } @@ -206,79 +73,26 @@ }, { "type": "VariableDeclaration", - "start": 78, - "end": 162, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 13, - "column": 1 - } - }, + "start":78,"end":162,"loc":{"start":{"line":8,"column":0},"end":{"line":13,"column":1}}, "declarations": [ { "type": "VariableDeclarator", - "start": 84, - "end": 162, - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 13, - "column": 1 - } - }, + "start":84,"end":162,"loc":{"start":{"line":8,"column":6},"end":{"line":13,"column":1}}, "id": { "type": "Identifier", - "start": 84, - "end": 102, - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 24 - }, - "identifierName": "trailingAfterComma" - }, + "start":84,"end":102,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":24},"identifierName":"trailingAfterComma"}, "name": "trailingAfterComma" }, "init": { "type": "ArrayExpression", - "start": 105, - "end": 162, - "loc": { - "start": { - "line": 8, - "column": 27 - }, - "end": { - "line": 13, - "column": 1 - } + "start":105,"end":162,"loc":{"start":{"line":8,"column":27},"end":{"line":13,"column":1}}, + "extra": { + "trailingComma": 140 }, "elements": [ { "type": "StringLiteral", - "start": 109, - "end": 114, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 7 - } - }, + "start":109,"end":114,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":7}}, "extra": { "rawValue": "One", "raw": "\"One\"" @@ -287,18 +101,7 @@ }, { "type": "StringLiteral", - "start": 135, - "end": 140, - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 11, - "column": 7 - } - }, + "start":135,"end":140,"loc":{"start":{"line":11,"column":2},"end":{"line":11,"column":7}}, "extra": { "rawValue": "Two", "raw": "\"Two\"" @@ -308,75 +111,28 @@ { "type": "CommentLine", "value": " One", - "start": 116, - "end": 122, - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 9, - "column": 15 - } - } + "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 - } - } + "start":126,"end":132,"loc":{"start":{"line":10,"column":3},"end":{"line":10,"column":9}} } ], "trailingComments": [ { "type": "CommentLine", "value": " Three", - "start": 142, - "end": 150, - "loc": { - "start": { - "line": 11, - "column": 9 - }, - "end": { - "line": 11, - "column": 17 - } - } + "start":142,"end":150,"loc":{"start":{"line":11,"column":9},"end":{"line":11,"column":17}} }, { "type": "CommentLine", "value": " Four", - "start": 153, - "end": 160, - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 12, - "column": 9 - } - } + "start":153,"end":160,"loc":{"start":{"line":12,"column":2},"end":{"line":12,"column":9}} } ] } - ], - "extra": { - "trailingComma": 140 - } + ] } } ], @@ -384,79 +140,26 @@ }, { "type": "VariableDeclaration", - "start": 164, - "end": 220, - "loc": { - "start": { - "line": 15, - "column": 0 - }, - "end": { - "line": 18, - "column": 1 - } - }, + "start":164,"end":220,"loc":{"start":{"line":15,"column":0},"end":{"line":18,"column":1}}, "declarations": [ { "type": "VariableDeclarator", - "start": 170, - "end": 220, - "loc": { - "start": { - "line": 15, - "column": 6 - }, - "end": { - "line": 18, - "column": 1 - } - }, + "start":170,"end":220,"loc":{"start":{"line":15,"column":6},"end":{"line":18,"column":1}}, "id": { "type": "Identifier", - "start": 170, - "end": 188, - "loc": { - "start": { - "line": 15, - "column": 6 - }, - "end": { - "line": 15, - "column": 24 - }, - "identifierName": "trailingAfterArray" - }, + "start":170,"end":188,"loc":{"start":{"line":15,"column":6},"end":{"line":15,"column":24},"identifierName":"trailingAfterArray"}, "name": "trailingAfterArray" }, "init": { "type": "ArrayExpression", - "start": 191, - "end": 220, - "loc": { - "start": { - "line": 15, - "column": 27 - }, - "end": { - "line": 18, - "column": 1 - } + "start":191,"end":220,"loc":{"start":{"line":15,"column":27},"end":{"line":18,"column":1}}, + "extra": { + "trailingComma": 200 }, "elements": [ { "type": "StringLiteral", - "start": 195, - "end": 200, - "loc": { - "start": { - "line": 16, - "column": 2 - }, - "end": { - "line": 16, - "column": 7 - } - }, + "start":195,"end":200,"loc":{"start":{"line":16,"column":2},"end":{"line":16,"column":7}}, "extra": { "rawValue": "One", "raw": "\"One\"" @@ -466,41 +169,16 @@ { "type": "CommentLine", "value": " One", - "start": 202, - "end": 208, - "loc": { - "start": { - "line": 16, - "column": 9 - }, - "end": { - "line": 16, - "column": 15 - } - } + "start":202,"end":208,"loc":{"start":{"line":16,"column":9},"end":{"line":16,"column":15}} }, { "type": "CommentLine", "value": " Two", - "start": 212, - "end": 218, - "loc": { - "start": { - "line": 17, - "column": 3 - }, - "end": { - "line": 17, - "column": 9 - } - } + "start":212,"end":218,"loc":{"start":{"line":17,"column":3},"end":{"line":17,"column":9}} } ] } - ], - "extra": { - "trailingComma": 200 - } + ] } } ], @@ -509,18 +187,7 @@ { "type": "CommentLine", "value": " Three", - "start": 221, - "end": 229, - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 10 - } - } + "start":221,"end":229,"loc":{"start":{"line":18,"column":2},"end":{"line":18,"column":10}} } ] } @@ -531,178 +198,57 @@ { "type": "CommentLine", "value": " One", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - } + "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 - } - } + "start":41,"end":47,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":9}} }, { "type": "CommentLine", "value": " Three", - "start": 56, - "end": 64, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 16 - } - } + "start":56,"end":64,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":16}} }, { "type": "CommentLine", "value": " Four", - "start": 67, - "end": 74, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 9 - } - } + "start":67,"end":74,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":9}} }, { "type": "CommentLine", "value": " One", - "start": 116, - "end": 122, - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 9, - "column": 15 - } - } + "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 - } - } + "start":126,"end":132,"loc":{"start":{"line":10,"column":3},"end":{"line":10,"column":9}} }, { "type": "CommentLine", "value": " Three", - "start": 142, - "end": 150, - "loc": { - "start": { - "line": 11, - "column": 9 - }, - "end": { - "line": 11, - "column": 17 - } - } + "start":142,"end":150,"loc":{"start":{"line":11,"column":9},"end":{"line":11,"column":17}} }, { "type": "CommentLine", "value": " Four", - "start": 153, - "end": 160, - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 12, - "column": 9 - } - } + "start":153,"end":160,"loc":{"start":{"line":12,"column":2},"end":{"line":12,"column":9}} }, { "type": "CommentLine", "value": " One", - "start": 202, - "end": 208, - "loc": { - "start": { - "line": 16, - "column": 9 - }, - "end": { - "line": 16, - "column": 15 - } - } + "start":202,"end":208,"loc":{"start":{"line":16,"column":9},"end":{"line":16,"column":15}} }, { "type": "CommentLine", "value": " Two", - "start": 212, - "end": 218, - "loc": { - "start": { - "line": 17, - "column": 3 - }, - "end": { - "line": 17, - "column": 9 - } - } + "start":212,"end":218,"loc":{"start":{"line":17,"column":3},"end":{"line":17,"column":9}} }, { "type": "CommentLine", "value": " Three", - "start": 221, - "end": 229, - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 10 - } - } + "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-pattern-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/basic/array-pattern-trailing-comma/output.json index 124041c4bb..9059e207d2 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 @@ -1,144 +1,44 @@ { "type": "File", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":6,"end":68,"loc":{"start":{"line":1,"column":6},"end":{"line":6,"column":17}}, "id": { "type": "ArrayPattern", - "start": 6, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":6,"end":52,"loc":{"start":{"line":1,"column":6},"end":{"line":6,"column":1}}, "elements": [ { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "x" - }, + "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 - } - } + "start":10,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} } ], "trailingComments": [ { "type": "CommentBlock", "value": " Two ", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 11 - } - } + "start":26,"end":35,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":11}} }, { "type": "CommentBlock", "value": " Three ", - "start": 39, - "end": 50, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 13 - } - } + "start":39,"end":50,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":13}} } ] } @@ -147,35 +47,13 @@ { "type": "CommentBlock", "value": " Four ", - "start": 53, - "end": 63, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 12 - } - } + "start":53,"end":63,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":12}} } ] }, "init": { "type": "ArrayExpression", - "start": 66, - "end": 68, - "loc": { - "start": { - "line": 6, - "column": 15 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":66,"end":68,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":17}}, "elements": [] } } @@ -189,66 +67,22 @@ { "type": "CommentBlock", "value": " One ", - "start": 10, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 11 - } - } + "start":10,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} }, { "type": "CommentBlock", "value": " Two ", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 11 - } - } + "start":26,"end":35,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":11}} }, { "type": "CommentBlock", "value": " Three ", - "start": 39, - "end": 50, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 13 - } - } + "start":39,"end":50,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":13}} }, { "type": "CommentBlock", "value": " Four ", - "start": 53, - "end": 63, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 12 - } - } + "start":53,"end":63,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":12}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/block-trailing-comment/output.json b/packages/babel-parser/test/fixtures/comments/basic/block-trailing-comment/output.json index 552cdc20f2..26b2c0163d 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/block-trailing-comment/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/block-trailing-comment/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":6,"end":10,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":8}}, "expression": { "type": "CallExpression", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":6,"end":9,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}}, "callee": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "a" - }, + "start":6,"end":7,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"}, "name": "a" }, "arguments": [] @@ -95,18 +28,7 @@ { "type": "CommentLine", "value": "comment", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":15,"end":24,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13}} } ] } @@ -120,18 +42,7 @@ { "type": "CommentLine", "value": "comment", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":15,"end":24,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/call-expression-function-argument/output.json b/packages/babel-parser/test/fixtures/comments/basic/call-expression-function-argument/output.json index a04f1d2886..48d502ae19 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/call-expression-function-argument/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/call-expression-function-argument/output.json @@ -1,173 +1,50 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":2}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "callee": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "test" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"test"}, "name": "test" }, "arguments": [ { "type": "FunctionExpression", - "start": 5, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":5,"end":41,"loc":{"start":{"line":1,"column":5},"end":{"line":4,"column":1}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":16,"end":41,"loc":{"start":{"line":1,"column":16},"end":{"line":4,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":20,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":24,"end":29,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "a" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"a"}, "name": "a" }, "init": { "type": "NumericLiteral", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, "extra": { "rawValue": 1, "raw": "1" @@ -181,18 +58,7 @@ { "type": "CommentLine", "value": " one", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - } - } + "start":33,"end":39,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8}} } ] } @@ -203,18 +69,7 @@ { "type": "CommentLine", "value": " two", - "start": 42, - "end": 48, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 6 - } - } + "start":42,"end":48,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":6}} } ] } @@ -228,34 +83,12 @@ { "type": "CommentLine", "value": " one", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - } - } + "start":33,"end":39,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8}} }, { "type": "CommentLine", "value": " two", - "start": 42, - "end": 48, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 6 - } - } + "start":42,"end":48,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":6}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/comment-within-condition/output.json b/packages/babel-parser/test/fixtures/comments/basic/comment-within-condition/output.json index 4c435cd1a5..77c33f844e 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/comment-within-condition/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/comment-within-condition/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 10, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":10,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":20}}, "test": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "a" - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16},"identifierName":"a"}, "name": "a", "leadingComments": [ { "type": "CommentBlock", "value": " bar ", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 13 - } - } + "start":14,"end":23,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":13}} } ] }, "consequent": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":28,"end":30,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}}, "body": [], "directives": [] }, @@ -100,18 +33,7 @@ { "type": "CommentBlock", "value": " foo ", - "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}} } ] } @@ -122,34 +44,12 @@ { "type": "CommentBlock", "value": " foo ", - "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}} }, { "type": "CommentBlock", "value": " bar ", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 13 - } - } + "start":14,"end":23,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":13}} } ] } \ No newline at end of file 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 7614637908..d8c108f4bf 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 @@ -1,76 +1,21 @@ { "type": "File", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 12, - "column": 15 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":12,"column":15}}, "program": { "type": "Program", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 12, - "column": 15 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":12,"column":15}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":7,"end":11,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":4}}, "expression": { "type": "ParenthesizedExpression", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":7,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "expression": { "type": "NumericLiteral", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":8,"end":9,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":2}}, "extra": { "rawValue": 1, "raw": "1" @@ -82,81 +27,26 @@ { "type": "CommentLine", "value": " One", - "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}} } ], "trailingComments": [ { "type": "CommentBlock", "value": " Two ", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 9 - } - } + "start":13,"end":22,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":9}} } ] }, { "type": "ExpressionStatement", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 4 - } - }, + "start":23,"end":27,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":4}}, "expression": { "type": "ParenthesizedExpression", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":23,"end":26,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":3}}, "expression": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 5, - "column": 1 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":24,"end":25,"loc":{"start":{"line":5,"column":1},"end":{"line":5,"column":2}}, "extra": { "rawValue": 2, "raw": "2" @@ -168,63 +58,19 @@ { "type": "CommentBlock", "value": " Two ", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 9 - } - } + "start":13,"end":22,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":9}} } ] }, { "type": "ExpressionStatement", - "start": 29, - "end": 48, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 10, - "column": 2 - } - }, + "start":29,"end":48,"loc":{"start":{"line":7,"column":0},"end":{"line":10,"column":2}}, "expression": { "type": "ParenthesizedExpression", - "start": 29, - "end": 47, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":29,"end":47,"loc":{"start":{"line":7,"column":0},"end":{"line":10,"column":1}}, "expression": { "type": "NumericLiteral", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 3 - } - }, + "start":44,"end":45,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":3}}, "extra": { "rawValue": 3, "raw": "3" @@ -234,18 +80,7 @@ { "type": "CommentLine", "value": " Three", - "start": 33, - "end": 41, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 10 - } - } + "start":33,"end":41,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":10}} } ] } @@ -253,46 +88,13 @@ }, { "type": "ExpressionStatement", - "start": 50, - "end": 65, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 15 - } - }, + "start":50,"end":65,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":15}}, "expression": { "type": "ParenthesizedExpression", - "start": 50, - "end": 64, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 14 - } - }, + "start":50,"end":64,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":14}}, "expression": { "type": "NumericLiteral", - "start": 62, - "end": 63, - "loc": { - "start": { - "line": 12, - "column": 12 - }, - "end": { - "line": 12, - "column": 13 - } - }, + "start":62,"end":63,"loc":{"start":{"line":12,"column":12},"end":{"line":12,"column":13}}, "extra": { "rawValue": 4, "raw": "4" @@ -302,18 +104,7 @@ { "type": "CommentBlock", "value": " Four ", - "start": 51, - "end": 61, - "loc": { - "start": { - "line": 12, - "column": 1 - }, - "end": { - "line": 12, - "column": 11 - } - } + "start":51,"end":61,"loc":{"start":{"line":12,"column":1},"end":{"line":12,"column":11}} } ] } @@ -326,66 +117,22 @@ { "type": "CommentLine", "value": " One", - "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}} }, { "type": "CommentBlock", "value": " Two ", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 9 - } - } + "start":13,"end":22,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":9}} }, { "type": "CommentLine", "value": " Three", - "start": 33, - "end": 41, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 10 - } - } + "start":33,"end":41,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":10}} }, { "type": "CommentBlock", "value": " Four ", - "start": 51, - "end": 61, - "loc": { - "start": { - "line": 12, - "column": 1 - }, - "end": { - "line": 12, - "column": 11 - } - } + "start":51,"end":61,"loc":{"start":{"line":12,"column":1},"end":{"line":12,"column":11}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/export-default-anonymous-class/output.json b/packages/babel-parser/test/fixtures/comments/basic/export-default-anonymous-class/output.json index d70b2aedbf..4c1fc96c2f 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/export-default-anonymous-class/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/export-default-anonymous-class/output.json @@ -1,109 +1,31 @@ { "type": "File", - "start": 0, - "end": 121, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":0,"end":121,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 121, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":0,"end":121,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 36, - "end": 121, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":36,"end":121,"loc":{"start":{"line":4,"column":0},"end":{"line":10,"column":1}}, "declaration": { "type": "ClassDeclaration", - "start": 51, - "end": 121, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":51,"end":121,"loc":{"start":{"line":4,"column":15},"end":{"line":10,"column":1}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "start": 57, - "end": 121, - "loc": { - "start": { - "line": 4, - "column": 21 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":57,"end":121,"loc":{"start":{"line":4,"column":21},"end":{"line":10,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 103, - "end": 119, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 9, - "column": 5 - } - }, + "start":103,"end":119,"loc":{"start":{"line":8,"column":4},"end":{"line":9,"column":5}}, "static": false, "key": { "type": "Identifier", - "start": 103, - "end": 110, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 11 - }, - "identifierName": "method1" - }, + "start":103,"end":110,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":11},"identifierName":"method1"}, "name": "method1" }, "computed": false, @@ -114,18 +36,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 112, - "end": 119, - "loc": { - "start": { - "line": 8, - "column": 13 - }, - "end": { - "line": 9, - "column": 5 - } - }, + "start":112,"end":119,"loc":{"start":{"line":8,"column":13},"end":{"line":9,"column":5}}, "body": [], "directives": [] }, @@ -133,18 +44,7 @@ { "type": "CommentBlock", "value": "*\n * this is method1.\n ", - "start": 63, - "end": 98, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 7, - "column": 7 - } - } + "start":63,"end":98,"loc":{"start":{"line":5,"column":4},"end":{"line":7,"column":7}} } ] } @@ -155,18 +55,7 @@ { "type": "CommentBlock", "value": "*\n * this is anonymous class.\n ", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - } + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":3}} } ] } @@ -177,34 +66,12 @@ { "type": "CommentBlock", "value": "*\n * this is anonymous class.\n ", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - } + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":3}} }, { "type": "CommentBlock", "value": "*\n * this is method1.\n ", - "start": 63, - "end": 98, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 7, - "column": 7 - } - } + "start":63,"end":98,"loc":{"start":{"line":5,"column":4},"end":{"line":7,"column":7}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/output.json b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/output.json index b27cadb955..d26cffc23c 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma-shorthand/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "Identifier", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "fn" - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"fn"}, "name": "fn" }, "extra": { @@ -80,85 +24,27 @@ "arguments": [ { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "a" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, "name": "a" }, { "type": "ObjectExpression", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "b" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "b" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"b"}, "name": "b" }, "extra": { @@ -170,18 +56,7 @@ { "type": "CommentBlock", "value": " comment 1 ", - "start": 13, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":13,"end":28,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":28}} } ] } @@ -190,18 +65,7 @@ { "type": "CommentBlock", "value": " comment 2 ", - "start": 30, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 45 - } - } + "start":30,"end":45,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":45}} } ] } @@ -213,34 +77,12 @@ { "type": "CommentBlock", "value": " comment 1 ", - "start": 13, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":13,"end":28,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":28}} }, { "type": "CommentBlock", "value": " comment 2 ", - "start": 30, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 45 - } - } + "start":30,"end":45,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":45}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/output.json b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/output.json index a224e1810b..cdd785a4ab 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/function-trailing-comma/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "callee": { "type": "Identifier", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "fn" - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"fn"}, "name": "fn" }, "extra": { @@ -80,53 +24,18 @@ "arguments": [ { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "a" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "b" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"b"}, "name": "b", "trailingComments": [ { "type": "CommentBlock", "value": " comment 1 ", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}} } ] } @@ -135,18 +44,7 @@ { "type": "CommentBlock", "value": " comment 2", - "start": 26, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 40 - } - } + "start":26,"end":40,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":40}} } ] } @@ -158,34 +56,12 @@ { "type": "CommentBlock", "value": " comment 1 ", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}} }, { "type": "CommentBlock", "value": " comment 2", - "start": 26, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 40 - } - } + "start":26,"end":40,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":40}} } ] } \ No newline at end of file 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 8cf9693cb6..e016e28ae9 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 @@ -1,179 +1,56 @@ { "type": "File", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":6,"end":68,"loc":{"start":{"line":1,"column":6},"end":{"line":6,"column":17}}, "id": { "type": "ObjectPattern", - "start": 6, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":6,"end":52,"loc":{"start":{"line":1,"column":6},"end":{"line":6,"column":1}}, "properties": [ { "type": "ObjectProperty", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":22,"end":23,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3}}, "method": false, "key": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "x" - }, + "start":22,"end":23,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "x" - }, + "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 - } - } + "start":10,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} } ], "trailingComments": [ { "type": "CommentBlock", "value": " Two ", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 11 - } - } + "start":26,"end":35,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":11}} }, { "type": "CommentBlock", "value": " Three ", - "start": 39, - "end": 50, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 13 - } - } + "start":39,"end":50,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":13}} } ], "extra": { @@ -188,35 +65,13 @@ { "type": "CommentBlock", "value": " Four ", - "start": 53, - "end": 63, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 12 - } - } + "start":53,"end":63,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":12}} } ] }, "init": { "type": "ObjectExpression", - "start": 66, - "end": 68, - "loc": { - "start": { - "line": 6, - "column": 15 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":66,"end":68,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":17}}, "properties": [] } } @@ -230,66 +85,22 @@ { "type": "CommentBlock", "value": " One ", - "start": 10, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 11 - } - } + "start":10,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} }, { "type": "CommentBlock", "value": " Two ", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 11 - } - } + "start":26,"end":35,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":11}} }, { "type": "CommentBlock", "value": " Three ", - "start": 39, - "end": 50, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 13 - } - } + "start":39,"end":50,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":13}} }, { "type": "CommentBlock", "value": " Four ", - "start": 53, - "end": 63, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 12 - } - } + "start":53,"end":63,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":12}} } ] } \ No newline at end of file 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 1ab0eaed8c..2455490bd6 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 @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 96, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":0,"end":96,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":15}}, "program": { "type": "Program", - "start": 0, - "end": 96, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":0,"end":96,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":15}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 82, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":4,"end":82,"loc":{"start":{"line":1,"column":4},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "obj" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"obj"}, "name": "obj" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 82, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":10,"end":82,"loc":{"start":{"line":1,"column":10},"end":{"line":5,"column":1}}, "properties": [ { "type": "ObjectProperty", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":14,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8}}, "method": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "a" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8}}, "extra": { "rawValue": "1", "raw": "'1'" @@ -147,52 +46,18 @@ }, { "type": "ObjectProperty", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":37,"end":43,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8}}, "method": false, "key": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "b" - }, + "start":37,"end":38,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":40,"end":43,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":8}}, "extra": { "rawValue": "2", "raw": "'2'" @@ -203,69 +68,24 @@ { "type": "CommentLine", "value": " comment 1", - "start": 22, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 22 - } - } + "start":22,"end":34,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":22}} } ] }, { "type": "ObjectProperty", - "start": 60, - "end": 66, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 8 - } - }, + "start":60,"end":66,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":8}}, "method": false, "key": { "type": "Identifier", - "start": 60, - "end": 61, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - }, - "identifierName": "c" - }, + "start":60,"end":61,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":3},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 63, - "end": 66, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 8 - } - }, + "start":63,"end":66,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":8}}, "extra": { "rawValue": "3", "raw": "'3'" @@ -276,36 +96,14 @@ { "type": "CommentLine", "value": " comment 2", - "start": 45, - "end": 57, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 22 - } - } + "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 - } - } + "start":68,"end":80,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":22}} } ] } @@ -321,18 +119,7 @@ { "type": "CommentLine", "value": " comment 4", - "start": 84, - "end": 96, - "loc": { - "start": { - "line": 5, - "column": 3 - }, - "end": { - "line": 5, - "column": 15 - } - } + "start":84,"end":96,"loc":{"start":{"line":5,"column":3},"end":{"line":5,"column":15}} } ] } @@ -343,66 +130,22 @@ { "type": "CommentLine", "value": " comment 1", - "start": 22, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 22 - } - } + "start":22,"end":34,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":22}} }, { "type": "CommentLine", "value": " comment 2", - "start": 45, - "end": 57, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 22 - } - } + "start":45,"end":57,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":22}} }, { "type": "CommentLine", "value": " comment 3", - "start": 68, - "end": 80, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 22 - } - } + "start":68,"end":80,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":22}} }, { "type": "CommentLine", "value": " comment 4", - "start": 84, - "end": 96, - "loc": { - "start": { - "line": 5, - "column": 3 - }, - "end": { - "line": 5, - "column": 15 - } - } + "start":84,"end":96,"loc":{"start":{"line":5,"column":3},"end":{"line":5,"column":15}} } ] } \ 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 987906b2ad..ba6cb1038b 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -65,62 +20,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":13,"end":60,"loc":{"start":{"line":1,"column":13},"end":{"line":5,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":36,"end":42,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":10}}, "expression": { "type": "CallExpression", - "start": 36, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":36,"end":41,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":9}}, "callee": { "type": "Identifier", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "foo" - }, + "start":36,"end":39,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -129,36 +39,14 @@ { "type": "CommentBlock", "value": " before ", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 16 - } - } + "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 - } - } + "start":47,"end":58,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}} } ] } @@ -173,34 +61,12 @@ { "type": "CommentBlock", "value": " before ", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 16 - } - } + "start":19,"end":31,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}} }, { "type": "CommentBlock", "value": " after ", - "start": 47, - "end": 58, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 15 - } - } + "start":47,"end":58,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}} } ] } \ No newline at end of file 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 1ef29ee9df..0bb60fc14c 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -65,67 +20,23 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":13,"end":63,"loc":{"start":{"line":1,"column":13},"end":{"line":5,"column":1}}, "body": [ { "type": "DebuggerStatement", - "start": 36, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "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 - } - } + "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 - } - } + "start":50,"end":61,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}} } ] } @@ -140,34 +51,12 @@ { "type": "CommentBlock", "value": " before ", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 16 - } - } + "start":19,"end":31,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}} }, { "type": "CommentBlock", "value": " after ", - "start": 50, - "end": 61, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 15 - } - } + "start":50,"end":61,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}} } ] } \ No newline at end of file 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 cae6a8fb2d..2aabdd7f5b 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -65,68 +20,24 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":13,"end":61,"loc":{"start":{"line":1,"column":13},"end":{"line":5,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 36, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "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 - } - } + "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 - } - } + "start":48,"end":59,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}} } ] } @@ -141,34 +52,12 @@ { "type": "CommentBlock", "value": " before ", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 16 - } - } + "start":19,"end":31,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}} }, { "type": "CommentBlock", "value": " after ", - "start": 48, - "end": 59, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 15 - } - } + "start":48,"end":59,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}} } ] } \ No newline at end of file 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 8be69c3aa8..6a9003378e 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -65,47 +20,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":13,"end":63,"loc":{"start":{"line":1,"column":13},"end":{"line":5,"column":1}}, "body": [ { "type": "ThrowStatement", - "start": 36, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":36,"end":45,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13}}, "argument": { "type": "NumericLiteral", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":42,"end":44,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":12}}, "extra": { "rawValue": 55, "raw": "55" @@ -116,36 +38,14 @@ { "type": "CommentBlock", "value": " before ", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 16 - } - } + "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 - } - } + "start":50,"end":61,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}} } ] } @@ -160,34 +60,12 @@ { "type": "CommentBlock", "value": " before ", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 16 - } - } + "start":19,"end":31,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}} }, { "type": "CommentBlock", "value": " after ", - "start": 50, - "end": 61, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 15 - } - } + "start":50,"end":61,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}} } ] } \ No newline at end of file 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 58347c10e7..d122849e33 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 68 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":68}}, "program": { "type": "Program", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 68 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":68}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 68 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":68}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,63 +20,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 68 - } - }, + "start":13,"end":68,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":68}}, "body": [ { "type": "WhileStatement", - "start": 30, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":30,"end":46,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":46}}, "test": { "type": "BooleanLiteral", - "start": 37, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":37,"end":41,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":41}}, "value": true }, "body": { "type": "BlockStatement", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":43,"end":46,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":46}}, "body": [], "directives": [] }, @@ -129,83 +40,27 @@ { "type": "CommentBlock", "value": " infinite ", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 29 - } - } + "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 - } - } + "start":47,"end":56,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":56}} } ] }, { "type": "VariableDeclaration", - "start": 57, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 66 - } - }, + "start":57,"end":66,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":66}}, "declarations": [ { "type": "VariableDeclarator", - "start": 61, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 61 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":61,"end":65,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":65}}, "id": { "type": "Identifier", - "start": 61, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 61 - }, - "end": { - "line": 1, - "column": 65 - }, - "identifierName": "each" - }, + "start":61,"end":65,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":65},"identifierName":"each"}, "name": "each" }, "init": null @@ -216,18 +71,7 @@ { "type": "CommentBlock", "value": " bar ", - "start": 47, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 56 - } - } + "start":47,"end":56,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":56}} } ] } @@ -242,34 +86,12 @@ { "type": "CommentBlock", "value": " infinite ", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 29 - } - } + "start":15,"end":29,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":29}} }, { "type": "CommentBlock", "value": " bar ", - "start": 47, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 56 - } - } + "start":47,"end":56,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":56}} } ] } \ 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 7d9c9d9b4a..208916dfa2 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 141, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":141,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 141, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":141,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 141, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":141,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "bar" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"bar"}, "name": "bar" }, "generator": false, @@ -65,98 +20,30 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 141, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":18,"end":141,"loc":{"start":{"line":1,"column":18},"end":{"line":9,"column":1}}, "body": [ { "type": "SwitchStatement", - "start": 24, - "end": 139, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 8, - "column": 5 - } - }, + "start":24,"end":139,"loc":{"start":{"line":2,"column":4},"end":{"line":8,"column":5}}, "discriminant": { "type": "Identifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "foo" - }, + "start":31,"end":34,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"foo"}, "name": "foo" }, "cases": [ { "type": "SwitchCase", - "start": 61, - "end": 68, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":61,"end":68,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":15}}, "consequent": [], "test": { "type": "NumericLiteral", - "start": 66, - "end": 67, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":66,"end":67,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":14}}, "extra": { "rawValue": 1, "raw": "1" @@ -167,97 +54,30 @@ { "type": "CommentLine", "value": " foo", - "start": 46, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - } + "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 - } - } + "start":81,"end":97,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":28}} } ] }, { "type": "SwitchCase", - "start": 106, - "end": 133, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 7, - "column": 19 - } - }, + "start":106,"end":133,"loc":{"start":{"line":6,"column":8},"end":{"line":7,"column":19}}, "consequent": [ { "type": "ExpressionStatement", - "start": 126, - "end": 133, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 19 - } - }, + "start":126,"end":133,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":19}}, "expression": { "type": "CallExpression", - "start": 126, - "end": 132, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 18 - } - }, + "start":126,"end":132,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":18}}, "callee": { "type": "Identifier", - "start": 126, - "end": 130, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 16 - }, - "identifierName": "doIt" - }, + "start":126,"end":130,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":16},"identifierName":"doIt"}, "name": "doIt" }, "arguments": [] @@ -266,18 +86,7 @@ ], "test": { "type": "NumericLiteral", - "start": 111, - "end": 112, - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 6, - "column": 14 - } - }, + "start":111,"end":112,"loc":{"start":{"line":6,"column":13},"end":{"line":6,"column":14}}, "extra": { "rawValue": 2, "raw": "2" @@ -288,18 +97,7 @@ { "type": "CommentLine", "value": " falls through", - "start": 81, - "end": 97, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 28 - } - } + "start":81,"end":97,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":28}} } ] } @@ -316,34 +114,12 @@ { "type": "CommentLine", "value": " foo", - "start": 46, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - } + "start":46,"end":52,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":14}} }, { "type": "CommentLine", "value": " falls through", - "start": 81, - "end": 97, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 28 - } - } + "start":81,"end":97,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":28}} } ] } \ No newline at end of file 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 620771ddcd..fb5538434a 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 @@ -1,95 +1,28 @@ { "type": "File", - "start": 0, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":91,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":91,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "start": 0, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":91,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "discriminant": { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "foo" - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"foo"}, "name": "foo" }, "cases": [ { "type": "SwitchCase", - "start": 29, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":29,"end":36,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":11}}, "consequent": [], "test": { "type": "NumericLiteral", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, "extra": { "rawValue": 1, "raw": "1" @@ -100,97 +33,30 @@ { "type": "CommentLine", "value": " foo", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 10 - } - } + "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 - } - } + "start":45,"end":61,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":24}} } ] }, { "type": "SwitchCase", - "start": 66, - "end": 89, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 6, - "column": 15 - } - }, + "start":66,"end":89,"loc":{"start":{"line":5,"column":4},"end":{"line":6,"column":15}}, "consequent": [ { "type": "ExpressionStatement", - "start": 82, - "end": 89, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 6, - "column": 15 - } - }, + "start":82,"end":89,"loc":{"start":{"line":6,"column":8},"end":{"line":6,"column":15}}, "expression": { "type": "CallExpression", - "start": 82, - "end": 88, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 6, - "column": 14 - } - }, + "start":82,"end":88,"loc":{"start":{"line":6,"column":8},"end":{"line":6,"column":14}}, "callee": { "type": "Identifier", - "start": 82, - "end": 86, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 6, - "column": 12 - }, - "identifierName": "doIt" - }, + "start":82,"end":86,"loc":{"start":{"line":6,"column":8},"end":{"line":6,"column":12},"identifierName":"doIt"}, "name": "doIt" }, "arguments": [] @@ -199,18 +65,7 @@ ], "test": { "type": "NumericLiteral", - "start": 71, - "end": 72, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":71,"end":72,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":10}}, "extra": { "rawValue": 2, "raw": "2" @@ -221,18 +76,7 @@ { "type": "CommentLine", "value": " falls through", - "start": 45, - "end": 61, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 24 - } - } + "start":45,"end":61,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":24}} } ] } @@ -245,34 +89,12 @@ { "type": "CommentLine", "value": " foo", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":18,"end":24,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":10}} }, { "type": "CommentLine", "value": " falls through", - "start": 45, - "end": 61, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 24 - } - } + "start":45,"end":61,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":24}} } ] } \ No newline at end of file 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 0bbd83f2fc..9912ec3434 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 @@ -1,155 +1,42 @@ { "type": "File", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "discriminant": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, "cases": [ { "type": "SwitchCase", - "start": 15, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":15,"end":43,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":20}}, "consequent": [ { "type": "ExpressionStatement", - "start": 27, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":27,"end":43,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":20}}, "expression": { "type": "CallExpression", - "start": 27, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":27,"end":43,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":20}}, "callee": { "type": "MemberExpression", - "start": 27, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":27,"end":38,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":15}}, "object": { "type": "Identifier", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "console" - }, + "start":27,"end":34,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":11},"identifierName":"console"}, "name": "console" }, "property": { "type": "Identifier", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "log" - }, + "start":35,"end":38,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":15},"identifierName":"log"}, "name": "log" }, "computed": false @@ -157,18 +44,7 @@ "arguments": [ { "type": "StringLiteral", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":39,"end":42,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":19}}, "extra": { "rawValue": "1", "raw": "'1'" @@ -181,18 +57,7 @@ ], "test": { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "extra": { "rawValue": 1, "raw": "1" @@ -203,18 +68,7 @@ { "type": "CommentLine", "value": " comment", - "start": 48, - "end": 58, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 14 - } - } + "start":48,"end":58,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":14}} } ] } @@ -227,18 +81,7 @@ { "type": "CommentLine", "value": " comment", - "start": 48, - "end": 58, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 14 - } - } + "start":48,"end":58,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":14}} } ] } \ No newline at end of file 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 f732250d6d..5941def92e 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 @@ -1,155 +1,42 @@ { "type": "File", - "start": 0, - "end": 81, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":81,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 81, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":81,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "start": 0, - "end": 81, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":81,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "discriminant": { "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" }, "cases": [ { "type": "SwitchCase", - "start": 14, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":14,"end":42,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":20}}, "consequent": [ { "type": "ExpressionStatement", - "start": 26, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":26,"end":42,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":20}}, "expression": { "type": "CallExpression", - "start": 26, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":26,"end":42,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":20}}, "callee": { "type": "MemberExpression", - "start": 26, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":26,"end":37,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":15}}, "object": { "type": "Identifier", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "console" - }, + "start":26,"end":33,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":11},"identifierName":"console"}, "name": "console" }, "property": { "type": "Identifier", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "log" - }, + "start":34,"end":37,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":15},"identifierName":"log"}, "name": "log" }, "computed": false @@ -157,18 +44,7 @@ "arguments": [ { "type": "StringLiteral", - "start": 38, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":38,"end":41,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":19}}, "extra": { "rawValue": "1", "raw": "'1'" @@ -181,18 +57,7 @@ ], "test": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "extra": { "rawValue": 1, "raw": "1" @@ -203,50 +68,17 @@ { "type": "CommentLine", "value": " comment", - "start": 47, - "end": 57, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 14 - } - } + "start":47,"end":57,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":14}} } ] }, { "type": "SwitchCase", - "start": 60, - "end": 79, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 6, - "column": 10 - } - }, + "start":60,"end":79,"loc":{"start":{"line":5,"column":2},"end":{"line":6,"column":10}}, "consequent": [ { "type": "BreakStatement", - "start": 73, - "end": 79, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 10 - } - }, + "start":73,"end":79,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":10}}, "label": null } ], @@ -255,18 +87,7 @@ { "type": "CommentLine", "value": " comment", - "start": 47, - "end": 57, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 14 - } - } + "start":47,"end":57,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":14}} } ] } @@ -279,18 +100,7 @@ { "type": "CommentLine", "value": " comment", - "start": 47, - "end": 57, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 14 - } - } + "start":47,"end":57,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":14}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/switch-no-default-comment-in-function/output.json b/packages/babel-parser/test/fixtures/comments/basic/switch-no-default-comment-in-function/output.json index dded99c82f..cab3b14128 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/switch-no-default-comment-in-function/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/switch-no-default-comment-in-function/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 133, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":133,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 133, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":133,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 133, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":133,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "bar" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"bar"}, "name": "bar" }, "generator": false, @@ -65,115 +20,36 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a" } ], "body": { "type": "BlockStatement", - "start": 16, - "end": 133, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":16,"end":133,"loc":{"start":{"line":1,"column":16},"end":{"line":9,"column":1}}, "body": [ { "type": "SwitchStatement", - "start": 22, - "end": 131, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 8, - "column": 5 - } - }, + "start":22,"end":131,"loc":{"start":{"line":2,"column":4},"end":{"line":8,"column":5}}, "discriminant": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "a" - }, + "start":30,"end":31,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"a"}, "name": "a" }, "cases": [ { "type": "SwitchCase", - "start": 43, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":43,"end":69,"loc":{"start":{"line":3,"column":8},"end":{"line":4,"column":18}}, "consequent": [ { "type": "BreakStatement", - "start": 63, - "end": 69, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":63,"end":69,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":18}}, "label": null } ], "test": { "type": "NumericLiteral", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":48,"end":49,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":14}}, "extra": { "rawValue": 2, "raw": "2" @@ -183,50 +59,17 @@ }, { "type": "SwitchCase", - "start": 78, - "end": 104, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":78,"end":104,"loc":{"start":{"line":5,"column":8},"end":{"line":6,"column":18}}, "consequent": [ { "type": "BreakStatement", - "start": 98, - "end": 104, - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":98,"end":104,"loc":{"start":{"line":6,"column":12},"end":{"line":6,"column":18}}, "label": null } ], "test": { "type": "NumericLiteral", - "start": 83, - "end": 84, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 14 - } - }, + "start":83,"end":84,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":14}}, "extra": { "rawValue": 1, "raw": "1" @@ -237,18 +80,7 @@ { "type": "CommentLine", "value": "no default", - "start": 113, - "end": 125, - "loc": { - "start": { - "line": 7, - "column": 8 - }, - "end": { - "line": 7, - "column": 20 - } - } + "start":113,"end":125,"loc":{"start":{"line":7,"column":8},"end":{"line":7,"column":20}} } ] } @@ -265,18 +97,7 @@ { "type": "CommentLine", "value": "no default", - "start": 113, - "end": 125, - "loc": { - "start": { - "line": 7, - "column": 8 - }, - "end": { - "line": 7, - "column": 20 - } - } + "start":113,"end":125,"loc":{"start":{"line":7,"column":8},"end":{"line":7,"column":20}} } ] } \ No newline at end of file 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 926146f69d..3255fbd32d 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 @@ -1,193 +1,57 @@ { "type": "File", - "start": 0, - "end": 296, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 13, - "column": 2 - } - }, + "start":0,"end":296,"loc":{"start":{"line":1,"column":0},"end":{"line":13,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 296, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 13, - "column": 2 - } - }, + "start":0,"end":296,"loc":{"start":{"line":1,"column":0},"end":{"line":13,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 296, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 13, - "column": 2 - } - }, + "start":0,"end":296,"loc":{"start":{"line":1,"column":0},"end":{"line":13,"column":2}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 295, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 13, - "column": 1 - } - }, + "start":0,"end":295,"loc":{"start":{"line":1,"column":0},"end":{"line":13,"column":1}}, "operator": "=", "left": { "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": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "module" - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"module"}, "name": "module" }, "property": { "type": "Identifier", - "start": 7, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "exports" - }, + "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14},"identifierName":"exports"}, "name": "exports" }, "computed": false }, "right": { "type": "FunctionExpression", - "start": 17, - "end": 295, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 13, - "column": 1 - } - }, + "start":17,"end":295,"loc":{"start":{"line":1,"column":17},"end":{"line":13,"column":1}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "context" - }, + "start":26,"end":33,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":33},"identifierName":"context"}, "name": "context" } ], "body": { "type": "BlockStatement", - "start": 35, - "end": 295, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 13, - "column": 1 - } - }, + "start":35,"end":295,"loc":{"start":{"line":1,"column":35},"end":{"line":13,"column":1}}, "body": [ { "type": "FunctionDeclaration", - "start": 42, - "end": 292, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 11, - "column": 5 - } - }, + "start":42,"end":292,"loc":{"start":{"line":3,"column":4},"end":{"line":11,"column":5}}, "id": { "type": "Identifier", - "start": 51, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 23 - }, - "identifierName": "isConstant" - }, + "start":51,"end":61,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":23},"identifierName":"isConstant"}, "name": "isConstant" }, "generator": false, @@ -195,97 +59,28 @@ "params": [ { "type": "Identifier", - "start": 62, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 28 - }, - "identifierName": "node" - }, + "start":62,"end":66,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":28},"identifierName":"node"}, "name": "node" } ], "body": { "type": "BlockStatement", - "start": 68, - "end": 292, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 11, - "column": 5 - } - }, + "start":68,"end":292,"loc":{"start":{"line":3,"column":30},"end":{"line":11,"column":5}}, "body": [ { "type": "SwitchStatement", - "start": 78, - "end": 255, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 8, - "column": 9 - } - }, + "start":78,"end":255,"loc":{"start":{"line":4,"column":8},"end":{"line":8,"column":9}}, "discriminant": { "type": "MemberExpression", - "start": 86, - "end": 95, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":86,"end":95,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":25}}, "object": { "type": "Identifier", - "start": 86, - "end": 90, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 20 - }, - "identifierName": "node" - }, + "start":86,"end":90,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":20},"identifierName":"node"}, "name": "node" }, "property": { "type": "Identifier", - "start": 91, - "end": 95, - "loc": { - "start": { - "line": 4, - "column": 21 - }, - "end": { - "line": 4, - "column": 25 - }, - "identifierName": "type" - }, + "start":91,"end":95,"loc":{"start":{"line":4,"column":21},"end":{"line":4,"column":25},"identifierName":"type"}, "name": "type" }, "computed": false @@ -293,222 +88,62 @@ "cases": [ { "type": "SwitchCase", - "start": 111, - "end": 219, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 6, - "column": 81 - } - }, + "start":111,"end":219,"loc":{"start":{"line":5,"column":12},"end":{"line":6,"column":81}}, "consequent": [ { "type": "ReturnStatement", - "start": 154, - "end": 219, - "loc": { - "start": { - "line": 6, - "column": 16 - }, - "end": { - "line": 6, - "column": 81 - } - }, + "start":154,"end":219,"loc":{"start":{"line":6,"column":16},"end":{"line":6,"column":81}}, "argument": { "type": "CallExpression", - "start": 161, - "end": 218, - "loc": { - "start": { - "line": 6, - "column": 23 - }, - "end": { - "line": 6, - "column": 80 - } - }, + "start":161,"end":218,"loc":{"start":{"line":6,"column":23},"end":{"line":6,"column":80}}, "callee": { "type": "Identifier", - "start": 161, - "end": 171, - "loc": { - "start": { - "line": 6, - "column": 23 - }, - "end": { - "line": 6, - "column": 33 - }, - "identifierName": "isConstant" - }, + "start":161,"end":171,"loc":{"start":{"line":6,"column":23},"end":{"line":6,"column":33},"identifierName":"isConstant"}, "name": "isConstant" }, "arguments": [ { "type": "MemberExpression", - "start": 172, - "end": 217, - "loc": { - "start": { - "line": 6, - "column": 34 - }, - "end": { - "line": 6, - "column": 79 - } - }, + "start":172,"end":217,"loc":{"start":{"line":6,"column":34},"end":{"line":6,"column":79}}, "object": { "type": "MemberExpression", - "start": 172, - "end": 188, - "loc": { - "start": { - "line": 6, - "column": 34 - }, - "end": { - "line": 6, - "column": 50 - } - }, + "start":172,"end":188,"loc":{"start":{"line":6,"column":34},"end":{"line":6,"column":50}}, "object": { "type": "Identifier", - "start": 172, - "end": 176, - "loc": { - "start": { - "line": 6, - "column": 34 - }, - "end": { - "line": 6, - "column": 38 - }, - "identifierName": "node" - }, + "start":172,"end":176,"loc":{"start":{"line":6,"column":34},"end":{"line":6,"column":38},"identifierName":"node"}, "name": "node" }, "property": { "type": "Identifier", - "start": 177, - "end": 188, - "loc": { - "start": { - "line": 6, - "column": 39 - }, - "end": { - "line": 6, - "column": 50 - }, - "identifierName": "expressions" - }, + "start":177,"end":188,"loc":{"start":{"line":6,"column":39},"end":{"line":6,"column":50},"identifierName":"expressions"}, "name": "expressions" }, "computed": false }, "property": { "type": "BinaryExpression", - "start": 189, - "end": 216, - "loc": { - "start": { - "line": 6, - "column": 51 - }, - "end": { - "line": 6, - "column": 78 - } - }, + "start":189,"end":216,"loc":{"start":{"line":6,"column":51},"end":{"line":6,"column":78}}, "left": { "type": "MemberExpression", - "start": 189, - "end": 212, - "loc": { - "start": { - "line": 6, - "column": 51 - }, - "end": { - "line": 6, - "column": 74 - } - }, + "start":189,"end":212,"loc":{"start":{"line":6,"column":51},"end":{"line":6,"column":74}}, "object": { "type": "MemberExpression", - "start": 189, - "end": 205, - "loc": { - "start": { - "line": 6, - "column": 51 - }, - "end": { - "line": 6, - "column": 67 - } - }, + "start":189,"end":205,"loc":{"start":{"line":6,"column":51},"end":{"line":6,"column":67}}, "object": { "type": "Identifier", - "start": 189, - "end": 193, - "loc": { - "start": { - "line": 6, - "column": 51 - }, - "end": { - "line": 6, - "column": 55 - }, - "identifierName": "node" - }, + "start":189,"end":193,"loc":{"start":{"line":6,"column":51},"end":{"line":6,"column":55},"identifierName":"node"}, "name": "node" }, "property": { "type": "Identifier", - "start": 194, - "end": 205, - "loc": { - "start": { - "line": 6, - "column": 56 - }, - "end": { - "line": 6, - "column": 67 - }, - "identifierName": "expressions" - }, + "start":194,"end":205,"loc":{"start":{"line":6,"column":56},"end":{"line":6,"column":67},"identifierName":"expressions"}, "name": "expressions" }, "computed": false }, "property": { "type": "Identifier", - "start": 206, - "end": 212, - "loc": { - "start": { - "line": 6, - "column": 68 - }, - "end": { - "line": 6, - "column": 74 - }, - "identifierName": "length" - }, + "start":206,"end":212,"loc":{"start":{"line":6,"column":68},"end":{"line":6,"column":74},"identifierName":"length"}, "name": "length" }, "computed": false @@ -516,18 +151,7 @@ "operator": "-", "right": { "type": "NumericLiteral", - "start": 215, - "end": 216, - "loc": { - "start": { - "line": 6, - "column": 77 - }, - "end": { - "line": 6, - "column": 78 - } - }, + "start":215,"end":216,"loc":{"start":{"line":6,"column":77},"end":{"line":6,"column":78}}, "extra": { "rawValue": 1, "raw": "1" @@ -543,18 +167,7 @@ ], "test": { "type": "StringLiteral", - "start": 116, - "end": 136, - "loc": { - "start": { - "line": 5, - "column": 17 - }, - "end": { - "line": 5, - "column": 37 - } - }, + "start":116,"end":136,"loc":{"start":{"line":5,"column":17},"end":{"line":5,"column":37}}, "extra": { "rawValue": "SequenceExpression", "raw": "\"SequenceExpression\"" @@ -565,18 +178,7 @@ { "type": "CommentLine", "value": " no default", - "start": 232, - "end": 245, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 25 - } - } + "start":232,"end":245,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":25}} } ] } @@ -584,32 +186,10 @@ }, { "type": "ReturnStatement", - "start": 273, - "end": 286, - "loc": { - "start": { - "line": 10, - "column": 8 - }, - "end": { - "line": 10, - "column": 21 - } - }, + "start":273,"end":286,"loc":{"start":{"line":10,"column":8},"end":{"line":10,"column":21}}, "argument": { "type": "BooleanLiteral", - "start": 280, - "end": 285, - "loc": { - "start": { - "line": 10, - "column": 15 - }, - "end": { - "line": 10, - "column": 20 - } - }, + "start":280,"end":285,"loc":{"start":{"line":10,"column":15},"end":{"line":10,"column":20}}, "value": false } } @@ -630,18 +210,7 @@ { "type": "CommentLine", "value": " no default", - "start": 232, - "end": 245, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 25 - } - } + "start":232,"end":245,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":25}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/basic/switch-no-default-comment/output.json b/packages/babel-parser/test/fixtures/comments/basic/switch-no-default-comment/output.json index 5a8fc7b6fa..7e06280b49 100644 --- a/packages/babel-parser/test/fixtures/comments/basic/switch-no-default-comment/output.json +++ b/packages/babel-parser/test/fixtures/comments/basic/switch-no-default-comment/output.json @@ -1,112 +1,34 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "discriminant": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"a"}, "name": "a" }, "cases": [ { "type": "SwitchCase", - "start": 17, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":17,"end":39,"loc":{"start":{"line":2,"column":4},"end":{"line":3,"column":14}}, "consequent": [ { "type": "BreakStatement", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":33,"end":39,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":14}}, "label": null } ], "test": { "type": "NumericLiteral", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "extra": { "rawValue": 1, "raw": "1" @@ -117,18 +39,7 @@ { "type": "CommentLine", "value": "no default", - "start": 44, - "end": 56, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 16 - } - } + "start":44,"end":56,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":16}} } ] } @@ -141,18 +52,7 @@ { "type": "CommentLine", "value": "no default", - "start": 44, - "end": 56, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 16 - } - } + "start":44,"end":56,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":16}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/html/first-line/output.json b/packages/babel-parser/test/fixtures/comments/html/first-line/output.json index d42874927c..521b8cf49c 100644 --- a/packages/babel-parser/test/fixtures/comments/html/first-line/output.json +++ b/packages/babel-parser/test/fixtures/comments/html/first-line/output.json @@ -1,31 +1,9 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], @@ -34,34 +12,12 @@ { "type": "CommentBlock", "value": "", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}} }, { "type": "CommentLine", "value": " comment", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - } + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}} } ] }, @@ -69,34 +25,12 @@ { "type": "CommentBlock", "value": "", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}} }, { "type": "CommentLine", "value": " comment", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - } + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/interpreter-directive/interpreter-directive-import/output.json b/packages/babel-parser/test/fixtures/comments/interpreter-directive/interpreter-directive-import/output.json index 2967587b80..722c14c684 100644 --- a/packages/babel-parser/test/fixtures/comments/interpreter-directive/interpreter-directive-import/output.json +++ b/packages/babel-parser/test/fixtures/comments/interpreter-directive/interpreter-directive-import/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":29}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":29}}, "sourceType": "module", "interpreter": { "type": "InterpreterDirective", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "value": "/usr/bin/env babel-node" }, "body": [ { "type": "ImportDeclaration", - "start": 27, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":27,"end":56,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":29}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 35, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":35,"end":40,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":13}}, "imported": { "type": "Identifier", - "start": 35, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "spawn" - }, + "start":35,"end":40,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":13},"identifierName":"spawn"}, "name": "spawn" }, "local": { "type": "Identifier", - "start": 35, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "spawn" - }, + "start":35,"end":40,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":13},"identifierName":"spawn"}, "name": "spawn" } } ], "source": { "type": "StringLiteral", - "start": 47, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 28 - } - }, + "start":47,"end":55,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":28}}, "extra": { "rawValue": "foobar", "raw": "'foobar'" diff --git a/packages/babel-parser/test/fixtures/comments/interpreter-directive/interpreter-directive-object/output.json b/packages/babel-parser/test/fixtures/comments/interpreter-directive/interpreter-directive-object/output.json index 43dd91cf31..2a5e1faa55 100644 --- a/packages/babel-parser/test/fixtures/comments/interpreter-directive/interpreter-directive-object/output.json +++ b/packages/babel-parser/test/fixtures/comments/interpreter-directive/interpreter-directive-object/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":18}}, "sourceType": "script", "interpreter": { "type": "InterpreterDirective", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "value": "/usr/bin/env babel-node" }, "body": [ { "type": "VariableDeclaration", - "start": 27, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":27,"end":45,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "start": 31, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":31,"end":44,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":17}}, "id": { "type": "ObjectPattern", - "start": 31, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":31,"end":40,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13}}, "properties": [ { "type": "ObjectProperty", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":33,"end":38,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":11}}, "method": false, "key": { "type": "Identifier", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "spawn" - }, + "start":33,"end":38,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":11},"identifierName":"spawn"}, "name": "spawn" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "spawn" - }, + "start":33,"end":38,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":11},"identifierName":"spawn"}, "name": "spawn" }, "extra": { @@ -147,19 +46,7 @@ }, "init": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "x" - }, + "start":43,"end":44,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/comments/regression/10230/output.json b/packages/babel-parser/test/fixtures/comments/regression/10230/output.json index fac57ee102..91107fa6e8 100644 --- a/packages/babel-parser/test/fixtures/comments/regression/10230/output.json +++ b/packages/babel-parser/test/fixtures/comments/regression/10230/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "operator": "=", "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" }, "right": { "type": "ObjectExpression", - "start": 4, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":4,"end":25,"loc":{"start":{"line":1,"column":4},"end":{"line":4,"column":1}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":8,"end":13,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":11,"end":13,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":7}}, "extra": { "rawValue": 42, "raw": "42" @@ -148,18 +47,7 @@ { "type": "CommentLine", "value": " One", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - } - } + "start":17,"end":23,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8}} } ] } @@ -173,68 +61,23 @@ { "type": "CommentLine", "value": " Two", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 6 - } - } + "start":27,"end":33,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":6}} } ] }, { "type": "ExpressionStatement", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":34,"end":35,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":1}}, "expression": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - }, - "identifierName": "B" - }, + "start":34,"end":35,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":1},"identifierName":"B"}, "name": "B" }, "leadingComments": [ { "type": "CommentLine", "value": " Two", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 6 - } - } + "start":27,"end":33,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":6}} } ] } @@ -245,34 +88,12 @@ { "type": "CommentLine", "value": " One", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - } - } + "start":17,"end":23,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8}} }, { "type": "CommentLine", "value": " Two", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 6 - } - } + "start":27,"end":33,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":6}} } ] } \ No newline at end of file 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 075deef7bf..c0e2eb4b67 100644 --- a/packages/babel-parser/test/fixtures/comments/regression/10432/output.json +++ b/packages/babel-parser/test/fixtures/comments/regression/10432/output.json @@ -1,127 +1,36 @@ { "type": "File", - "start": 0, - "end": 136, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":136,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 136, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":136,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":6,"end":36,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "socket" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"socket"}, "name": "socket" }, "init": { "type": "CallExpression", - "start": 15, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":15,"end":36,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":36}}, "callee": { "type": "Identifier", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "socketClient" - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27},"identifierName":"socketClient"}, "name": "socketClient" }, "arguments": [ { "type": "Identifier", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "address" - }, + "start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35},"identifierName":"address"}, "name": "address" } ] @@ -133,95 +42,27 @@ { "type": "CommentBlock", "value": " istanbul ignore next ", - "start": 37, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 26 - } - } + "start":37,"end":63,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":26}} } ] }, { "type": "ExpressionStatement", - "start": 64, - "end": 136, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":64,"end":136,"loc":{"start":{"line":3,"column":0},"end":{"line":5,"column":2}}, "expression": { "type": "CallExpression", - "start": 64, - "end": 136, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":64,"end":136,"loc":{"start":{"line":3,"column":0},"end":{"line":5,"column":2}}, "callee": { "type": "MemberExpression", - "start": 64, - "end": 73, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":64,"end":73,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":9}}, "object": { "type": "Identifier", - "start": 64, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "socket" - }, + "start":64,"end":70,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":6},"identifierName":"socket"}, "name": "socket" }, "property": { "type": "Identifier", - "start": 71, - "end": 73, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "on" - }, + "start":71,"end":73,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":9},"identifierName":"on"}, "name": "on" }, "computed": false @@ -229,18 +70,7 @@ "arguments": [ { "type": "StringLiteral", - "start": 74, - "end": 83, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":74,"end":83,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":19}}, "extra": { "rawValue": "connect", "raw": "'connect'" @@ -249,111 +79,33 @@ }, { "type": "FunctionExpression", - "start": 85, - "end": 135, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":85,"end":135,"loc":{"start":{"line":3,"column":21},"end":{"line":5,"column":1}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 97, - "end": 135, - "loc": { - "start": { - "line": 3, - "column": 33 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":97,"end":135,"loc":{"start":{"line":3,"column":33},"end":{"line":5,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 101, - "end": 133, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 34 - } - }, + "start":101,"end":133,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":34}}, "expression": { "type": "CallExpression", - "start": 101, - "end": 133, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 34 - } - }, + "start":101,"end":133,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":34}}, "callee": { "type": "Identifier", - "start": 101, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "debug" - }, + "start":101,"end":106,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":7},"identifierName":"debug"}, "name": "debug" }, "arguments": [ { "type": "BinaryExpression", - "start": 107, - "end": 132, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 33 - } - }, + "start":107,"end":132,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":33}}, "left": { "type": "StringLiteral", - "start": 107, - "end": 122, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 23 - } - }, + "start":107,"end":122,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":23}}, "extra": { "rawValue": "Connected to ", "raw": "'Connected to '" @@ -363,19 +115,7 @@ "operator": "+", "right": { "type": "Identifier", - "start": 125, - "end": 132, - "loc": { - "start": { - "line": 4, - "column": 26 - }, - "end": { - "line": 4, - "column": 33 - }, - "identifierName": "address" - }, + "start":125,"end":132,"loc":{"start":{"line":4,"column":26},"end":{"line":4,"column":33},"identifierName":"address"}, "name": "address" } } @@ -392,18 +132,7 @@ { "type": "CommentBlock", "value": " istanbul ignore next ", - "start": 37, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 26 - } - } + "start":37,"end":63,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":26}} } ] } @@ -414,18 +143,7 @@ { "type": "CommentBlock", "value": " istanbul ignore next ", - "start": 37, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 26 - } - } + "start":37,"end":63,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":26}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/regression/10448/output.json b/packages/babel-parser/test/fixtures/comments/regression/10448/output.json index ab6d764cc2..69a7bde87a 100644 --- a/packages/babel-parser/test/fixtures/comments/regression/10448/output.json +++ b/packages/babel-parser/test/fixtures/comments/regression/10448/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,67 +20,22 @@ "params": [ { "type": "ArrayPattern", - "start": 13, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":13,"end":50,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":50}}, "elements": [ { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"foo"}, "name": "foo", "trailingComments": [ { "type": "CommentBlock", "value": " not used ", - "start": 19, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 33 - } - } + "start":19,"end":33,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":33}} }, { "type": "CommentBlock", "value": " not used ", - "start": 35, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 49 - } - } + "start":35,"end":49,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":49}} } ] }, @@ -135,18 +45,7 @@ ], "body": { "type": "BlockStatement", - "start": 52, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":52,"end":55,"loc":{"start":{"line":1,"column":52},"end":{"line":2,"column":1}}, "body": [], "directives": [] } @@ -158,34 +57,12 @@ { "type": "CommentBlock", "value": " not used ", - "start": 19, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 33 - } - } + "start":19,"end":33,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":33}} }, { "type": "CommentBlock", "value": " not used ", - "start": 35, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 49 - } - } + "start":35,"end":49,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":49}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/comments/regression/10892/output.json b/packages/babel-parser/test/fixtures/comments/regression/10892/output.json index 1ca2d06ab9..efa9a47df6 100644 --- a/packages/babel-parser/test/fixtures/comments/regression/10892/output.json +++ b/packages/babel-parser/test/fixtures/comments/regression/10892/output.json @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "imported": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "local": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" } } ], "source": { "type": "StringLiteral", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" @@ -118,67 +39,23 @@ { "type": "CommentBlock", "value": "*\n * lost comment\n ", - "start": 27, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - } + "start":27,"end":50,"loc":{"start":{"line":3,"column":0},"end":{"line":5,"column":3}} } ] }, { "type": "ExportDefaultDeclaration", - "start": 51, - "end": 69, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":51,"end":69,"loc":{"start":{"line":6,"column":0},"end":{"line":7,"column":1}}, "declaration": { "type": "ObjectExpression", - "start": 66, - "end": 69, - "loc": { - "start": { - "line": 6, - "column": 15 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":66,"end":69,"loc":{"start":{"line":6,"column":15},"end":{"line":7,"column":1}}, "properties": [] }, "leadingComments": [ { "type": "CommentBlock", "value": "*\n * lost comment\n ", - "start": 27, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - } + "start":27,"end":50,"loc":{"start":{"line":3,"column":0},"end":{"line":5,"column":3}} } ] } @@ -189,18 +66,7 @@ { "type": "CommentBlock", "value": "*\n * lost comment\n ", - "start": 27, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - } - } + "start":27,"end":50,"loc":{"start":{"line":3,"column":0},"end":{"line":5,"column":3}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/01-regex/output.json b/packages/babel-parser/test/fixtures/core/categorized/01-regex/output.json index 7b20bc5bd4..f1ac27f9f2 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/01-regex/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/01-regex/output.json @@ -1,137 +1,36 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":6,"end":33,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "BinaryExpression", - "start": 10, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":10,"end":33,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":33}}, "left": { "type": "BinaryExpression", - "start": 10, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":10,"end":31,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":31}}, "left": { "type": "FunctionExpression", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "foo" - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -139,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [], "directives": [] } @@ -158,18 +46,7 @@ "operator": "/", "right": { "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": 42, "raw": "42" @@ -180,19 +57,7 @@ "operator": "/", "right": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "i" - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"i"}, "name": "i" } } diff --git a/packages/babel-parser/test/fixtures/core/categorized/02-regex/output.json b/packages/babel-parser/test/fixtures/core/categorized/02-regex/output.json index 1a247a9257..08d6fd2f0f 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/02-regex/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/02-regex/output.json @@ -1,105 +1,27 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "BinaryExpression", - "start": 1, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":1,"end":24,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":24}}, "left": { "type": "BinaryExpression", - "start": 1, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":1,"end":22,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":22}}, "left": { "type": "FunctionExpression", - "start": 1, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":1,"end":18,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -107,18 +29,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [], "directives": [] } @@ -126,18 +37,7 @@ "operator": "/", "right": { "type": "NumericLiteral", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "extra": { "rawValue": 42, "raw": "42" @@ -148,19 +48,7 @@ "operator": "/", "right": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "i" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"i"}, "name": "i" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/core/categorized/03-regex/output.json b/packages/babel-parser/test/fixtures/core/categorized/03-regex/output.json index cc036d7a80..a8f8ff1f10 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/03-regex/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/03-regex/output.json @@ -1,152 +1,41 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":1,"end":48,"loc":{"start":{"line":1,"column":1},"end":{"line":3,"column":1}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":13,"end":48,"loc":{"start":{"line":1,"column":13},"end":{"line":3,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 17, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":17,"end":46,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":31}}, "argument": { "type": "BinaryExpression", - "start": 24, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":24,"end":46,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":31}}, "left": { "type": "BinaryExpression", - "start": 24, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":24,"end":44,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":29}}, "left": { "type": "FunctionExpression", - "start": 24, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":24,"end":40,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":25}}, "id": { "type": "Identifier", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "fn" - }, + "start":33,"end":35,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -154,18 +43,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":38,"end":40,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":25}}, "body": [], "directives": [] } @@ -173,18 +51,7 @@ "operator": "/", "right": { "type": "NumericLiteral", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":42,"end":44,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":29}}, "extra": { "rawValue": 42, "raw": "42" @@ -195,19 +62,7 @@ "operator": "/", "right": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 31 - }, - "identifierName": "i" - }, + "start":45,"end":46,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":31},"identifierName":"i"}, "name": "i" } } diff --git a/packages/babel-parser/test/fixtures/core/categorized/04-regex/output.json b/packages/babel-parser/test/fixtures/core/categorized/04-regex/output.json index f8ffa275c8..b45e3336f4 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/04-regex/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/04-regex/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "fn" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -65,64 +20,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":14,"end":54,"loc":{"start":{"line":1,"column":14},"end":{"line":5,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":18,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8}}, "argument": null }, { "type": "FunctionDeclaration", - "start": 27, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":27,"end":44,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":19}}, "id": { "type": "Identifier", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 14 - }, - "identifierName": "foo" - }, + "start":36,"end":39,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":14},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -130,50 +40,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":42,"end":44,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":19}}, "body": [], "directives": [] } }, { "type": "ExpressionStatement", - "start": 47, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":47,"end":52,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":7}}, "expression": { "type": "RegExpLiteral", - "start": 47, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":47,"end":52,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":7}}, "extra": { "raw": "/42/i" }, diff --git a/packages/babel-parser/test/fixtures/core/categorized/05-regex/output.json b/packages/babel-parser/test/fixtures/core/categorized/05-regex/output.json index 7a2e654f28..556ea3afcc 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/05-regex/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/05-regex/output.json @@ -1,77 +1,21 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "test" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"test"}, "name": "test" }, "arguments": [] @@ -79,33 +23,10 @@ }, { "type": "FunctionDeclaration", - "start": 8, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":8,"end":25,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -113,50 +34,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } }, { "type": "ExpressionStatement", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}}, "expression": { "type": "RegExpLiteral", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}}, "extra": { "raw": "/42/i" }, diff --git a/packages/babel-parser/test/fixtures/core/categorized/06-regex/output.json b/packages/babel-parser/test/fixtures/core/categorized/06-regex/output.json index a17df4edc6..16e46725aa 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/06-regex/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/06-regex/output.json @@ -1,121 +1,32 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "left": { "type": "BinaryExpression", - "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}}, "left": { "type": "UnaryExpression", - "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}}, "operator": "!", "prefix": true, "argument": { "type": "FunctionExpression", - "start": 1, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":1,"end":17,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":17}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -123,18 +34,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } @@ -143,18 +43,7 @@ "operator": "/", "right": { "type": "NumericLiteral", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "extra": { "rawValue": 42, "raw": "42" @@ -165,19 +54,7 @@ "operator": "/", "right": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "i" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"i"}, "name": "i" } } diff --git a/packages/babel-parser/test/fixtures/core/categorized/07-regex/output.json b/packages/babel-parser/test/fixtures/core/categorized/07-regex/output.json index 28c34291a9..3494550028 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/07-regex/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/07-regex/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,50 +20,17 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } }, { "type": "ExpressionStatement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "expression": { "type": "RegExpLiteral", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "extra": { "raw": "/42/i" }, diff --git a/packages/babel-parser/test/fixtures/core/categorized/identifier-name-loc/output.json b/packages/babel-parser/test/fixtures/core/categorized/identifier-name-loc/output.json index aea211ae09..6bc1d79698 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/identifier-name-loc/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/identifier-name-loc/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "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" } ] 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 064381b180..64125f64db 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 @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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": "=", "left": { "type": "AssignmentPattern", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, "right": { "type": "Literal", - "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}}, "value": 1, "raw": "1" }, @@ -116,19 +38,7 @@ }, "right": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "t" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"t"}, "name": "t" } } 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 f606fc8063..340a0dcdbc 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 @@ -1,126 +1,37 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "AssignmentPattern", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "left": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "right": { "type": "Literal", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "value": 1, "raw": "1" }, @@ -133,19 +44,7 @@ }, "right": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "t" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"t"}, "name": "t" } } 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 dc0122606f..74aeb35dac 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 @@ -1,190 +1,56 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "ObjectPattern", - "start": 2, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":2,"end":15,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":15}}, "properties": [ { "type": "Property", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "AssignmentPattern", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "left": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "b" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"b"}, "name": "b" }, "right": { "type": "Literal", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "value": 2, "raw": "2" } @@ -203,19 +69,7 @@ }, "right": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "t" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"t"}, "name": "t" } } 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 caf293552b..7b58295352 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 @@ -1,205 +1,60 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:7)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "operator": "=", "left": { "type": "ArrayPattern", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "elements": [ { "type": "ObjectPattern", - "start": 1, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":1,"end":17,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":17}}, "properties": [ { "type": "Property", - "start": 2, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":2,"end":16,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "b" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}}, "elements": [ { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "AssignmentPattern", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "left": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"a"}, "name": "a" }, "right": { "type": "Literal", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "value": 1, "raw": "1" } @@ -220,19 +75,7 @@ }, "right": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "t" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"t"}, "name": "t" } } 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 8eaa162030..22e32af6eb 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 @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "ArrayPattern", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, "elements": [ { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "x" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"x"}, "name": "x" } ], @@ -118,19 +40,7 @@ }, "right": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "t" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"t"}, "name": "t" } } diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json index 7ad34b6ae9..c2f51bff4f 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-inside-loop/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ "SyntaxError: In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "test": { "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": 1, "raw": "1" @@ -68,33 +24,10 @@ }, "body": { "type": "FunctionDeclaration", - "start": 10, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":10,"end":26,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":26}}, "id": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "foo" - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -102,18 +35,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/output.json b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/output.json index 64064c04c2..f39f3fcea7 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/invalid-fn-decl-labeled-inside-loop/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: In non-strict mode code, functions can only be declared at top level, inside a block, or as the body of an if statement (1:20)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "test": { "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": 1, "raw": "1" @@ -68,61 +24,16 @@ }, "body": { "type": "LabeledStatement", - "start": 10, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":10,"end":36,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":36}}, "body": { "type": "LabeledStatement", - "start": 15, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":15,"end":36,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":36}}, "body": { "type": "FunctionDeclaration", - "start": 20, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":20,"end":36,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "foo" - }, + "start":29,"end":32,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":32},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -130,55 +41,20 @@ "params": [], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "body": [], "directives": [] } }, "label": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "bar" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"bar"}, "name": "bar" } }, "label": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" } } diff --git a/packages/babel-parser/test/fixtures/core/categorized/label-kind-switch/output.json b/packages/babel-parser/test/fixtures/core/categorized/label-kind-switch/output.json index 7da9403203..2ac4e66efb 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/label-kind-switch/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/label-kind-switch/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "body": [ { "type": "LabeledStatement", - "start": 4, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":4,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":3}}, "body": { "type": "SwitchStatement", - "start": 7, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":7,"end":23,"loc":{"start":{"line":2,"column":5},"end":{"line":3,"column":3}}, "discriminant": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "i" - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"i"}, "name": "i" }, "cases": [] }, "label": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"a"}, "name": "a" } } 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 2ada86e94d..507489c6bc 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 @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 1129, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 118, - "column": 1 - } - }, + "start":0,"end":1129,"loc":{"start":{"line":1,"column":0},"end":{"line":118,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 1129, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 118, - "column": 1 - } - }, + "start":0,"end":1129,"loc":{"start":{"line":1,"column":0},"end":{"line":118,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "StringLiteral", - "start": 1, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"", @@ -68,46 +24,13 @@ }, { "type": "ExpressionStatement", - "start": 17, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":17,"end":34,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":17}}, "expression": { "type": "MemberExpression", - "start": 17, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":17,"end":33,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":16}}, "object": { "type": "StringLiteral", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":17,"end":29,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -116,19 +39,7 @@ }, "property": { "type": "Identifier", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 16 - }, - "identifierName": "foo" - }, + "start":30,"end":33,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":16},"identifierName":"foo"}, "name": "foo" }, "computed": false @@ -136,46 +47,13 @@ }, { "type": "ExpressionStatement", - "start": 35, - "end": 53, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":35,"end":53,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":18}}, "expression": { "type": "MemberExpression", - "start": 35, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 17 - } - }, + "start":35,"end":52,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":17}}, "object": { "type": "StringLiteral", - "start": 35, - "end": 47, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 12 - } - }, + "start":35,"end":47,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":12}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -184,19 +62,7 @@ }, "property": { "type": "Identifier", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 16 - }, - "identifierName": "foo" - }, + "start":48,"end":51,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":16},"identifierName":"foo"}, "name": "foo" }, "computed": true @@ -204,46 +70,13 @@ }, { "type": "ExpressionStatement", - "start": 54, - "end": 72, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 18 - } - }, + "start":54,"end":72,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":18}}, "expression": { "type": "TaggedTemplateExpression", - "start": 54, - "end": 71, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 17 - } - }, + "start":54,"end":71,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":17}}, "tag": { "type": "StringLiteral", - "start": 54, - "end": 66, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 12 - } - }, + "start":54,"end":66,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":12}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -252,34 +85,12 @@ }, "quasi": { "type": "TemplateLiteral", - "start": 66, - "end": 71, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 17 - } - }, + "start":66,"end":71,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":17}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 67, - "end": 70, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 16 - } - }, + "start":67,"end":70,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":16}}, "value": { "raw": "foo", "cooked": "foo" @@ -292,46 +103,13 @@ }, { "type": "ExpressionStatement", - "start": 73, - "end": 91, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":73,"end":91,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":18}}, "expression": { "type": "CallExpression", - "start": 73, - "end": 90, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":73,"end":90,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":17}}, "callee": { "type": "StringLiteral", - "start": 73, - "end": 85, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 12 - } - }, + "start":73,"end":85,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":12}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -341,19 +119,7 @@ "arguments": [ { "type": "Identifier", - "start": 86, - "end": 89, - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 6, - "column": 16 - }, - "identifierName": "foo" - }, + "start":86,"end":89,"loc":{"start":{"line":6,"column":13},"end":{"line":6,"column":16},"identifierName":"foo"}, "name": "foo" } ] @@ -361,46 +127,13 @@ }, { "type": "ExpressionStatement", - "start": 92, - "end": 112, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 8, - "column": 7 - } - }, + "start":92,"end":112,"loc":{"start":{"line":7,"column":0},"end":{"line":8,"column":7}}, "expression": { "type": "MemberExpression", - "start": 92, - "end": 111, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 8, - "column": 6 - } - }, + "start":92,"end":111,"loc":{"start":{"line":7,"column":0},"end":{"line":8,"column":6}}, "object": { "type": "StringLiteral", - "start": 92, - "end": 104, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":92,"end":104,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":12}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -409,19 +142,7 @@ }, "property": { "type": "Identifier", - "start": 108, - "end": 111, - "loc": { - "start": { - "line": 8, - "column": 3 - }, - "end": { - "line": 8, - "column": 6 - }, - "identifierName": "foo" - }, + "start":108,"end":111,"loc":{"start":{"line":8,"column":3},"end":{"line":8,"column":6},"identifierName":"foo"}, "name": "foo" }, "computed": false @@ -429,46 +150,13 @@ }, { "type": "ExpressionStatement", - "start": 113, - "end": 134, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 10, - "column": 8 - } - }, + "start":113,"end":134,"loc":{"start":{"line":9,"column":0},"end":{"line":10,"column":8}}, "expression": { "type": "MemberExpression", - "start": 113, - "end": 133, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 10, - "column": 7 - } - }, + "start":113,"end":133,"loc":{"start":{"line":9,"column":0},"end":{"line":10,"column":7}}, "object": { "type": "StringLiteral", - "start": 113, - "end": 125, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 12 - } - }, + "start":113,"end":125,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":12}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -477,19 +165,7 @@ }, "property": { "type": "Identifier", - "start": 129, - "end": 132, - "loc": { - "start": { - "line": 10, - "column": 3 - }, - "end": { - "line": 10, - "column": 6 - }, - "identifierName": "foo" - }, + "start":129,"end":132,"loc":{"start":{"line":10,"column":3},"end":{"line":10,"column":6},"identifierName":"foo"}, "name": "foo" }, "computed": true @@ -497,46 +173,13 @@ }, { "type": "ExpressionStatement", - "start": 135, - "end": 156, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 12, - "column": 8 - } - }, + "start":135,"end":156,"loc":{"start":{"line":11,"column":0},"end":{"line":12,"column":8}}, "expression": { "type": "TaggedTemplateExpression", - "start": 135, - "end": 155, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 12, - "column": 7 - } - }, + "start":135,"end":155,"loc":{"start":{"line":11,"column":0},"end":{"line":12,"column":7}}, "tag": { "type": "StringLiteral", - "start": 135, - "end": 147, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 12 - } - }, + "start":135,"end":147,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":12}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -545,34 +188,12 @@ }, "quasi": { "type": "TemplateLiteral", - "start": 150, - "end": 155, - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 12, - "column": 7 - } - }, + "start":150,"end":155,"loc":{"start":{"line":12,"column":2},"end":{"line":12,"column":7}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 151, - "end": 154, - "loc": { - "start": { - "line": 12, - "column": 3 - }, - "end": { - "line": 12, - "column": 6 - } - }, + "start":151,"end":154,"loc":{"start":{"line":12,"column":3},"end":{"line":12,"column":6}}, "value": { "raw": "foo", "cooked": "foo" @@ -585,46 +206,13 @@ }, { "type": "ExpressionStatement", - "start": 157, - "end": 178, - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 14, - "column": 8 - } - }, + "start":157,"end":178,"loc":{"start":{"line":13,"column":0},"end":{"line":14,"column":8}}, "expression": { "type": "CallExpression", - "start": 157, - "end": 177, - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 14, - "column": 7 - } - }, + "start":157,"end":177,"loc":{"start":{"line":13,"column":0},"end":{"line":14,"column":7}}, "callee": { "type": "StringLiteral", - "start": 157, - "end": 169, - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 13, - "column": 12 - } - }, + "start":157,"end":169,"loc":{"start":{"line":13,"column":0},"end":{"line":13,"column":12}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -634,19 +222,7 @@ "arguments": [ { "type": "Identifier", - "start": 173, - "end": 176, - "loc": { - "start": { - "line": 14, - "column": 3 - }, - "end": { - "line": 14, - "column": 6 - }, - "identifierName": "foo" - }, + "start":173,"end":176,"loc":{"start":{"line":14,"column":3},"end":{"line":14,"column":6},"identifierName":"foo"}, "name": "foo" } ] @@ -655,49 +231,16 @@ { "type": "CommentLine", "value": " Should not be a syntax error because should not be parsed in strict mode.", - "start": 180, - "end": 256, - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 16, - "column": 76 - } - } + "start":180,"end":256,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":76}} } ] }, { "type": "ExpressionStatement", - "start": 257, - "end": 262, - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 17, - "column": 5 - } - }, + "start":257,"end":262,"loc":{"start":{"line":17,"column":0},"end":{"line":17,"column":5}}, "expression": { "type": "StringLiteral", - "start": 257, - "end": 261, - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 17, - "column": 4 - } - }, + "start":257,"end":261,"loc":{"start":{"line":17,"column":0},"end":{"line":17,"column":4}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -708,50 +251,16 @@ { "type": "CommentLine", "value": " Should not be a syntax error because should not be parsed in strict mode.", - "start": 180, - "end": 256, - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 16, - "column": 76 - } - } + "start":180,"end":256,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":76}} } ] }, { "type": "FunctionDeclaration", - "start": 264, - "end": 307, - "loc": { - "start": { - "line": 19, - "column": 0 - }, - "end": { - "line": 22, - "column": 1 - } - }, + "start":264,"end":307,"loc":{"start":{"line":19,"column":0},"end":{"line":22,"column":1}}, "id": { "type": "Identifier", - "start": 273, - "end": 274, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 10 - }, - "identifierName": "f" - }, + "start":273,"end":274,"loc":{"start":{"line":19,"column":9},"end":{"line":19,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -759,61 +268,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 276, - "end": 307, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 22, - "column": 1 - } - }, + "start":276,"end":307,"loc":{"start":{"line":19,"column":12},"end":{"line":22,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 280, - "end": 297, - "loc": { - "start": { - "line": 20, - "column": 2 - }, - "end": { - "line": 20, - "column": 19 - } - }, + "start":280,"end":297,"loc":{"start":{"line":20,"column":2},"end":{"line":20,"column":19}}, "expression": { "type": "MemberExpression", - "start": 280, - "end": 296, - "loc": { - "start": { - "line": 20, - "column": 2 - }, - "end": { - "line": 20, - "column": 18 - } - }, + "start":280,"end":296,"loc":{"start":{"line":20,"column":2},"end":{"line":20,"column":18}}, "object": { "type": "StringLiteral", - "start": 280, - "end": 292, - "loc": { - "start": { - "line": 20, - "column": 2 - }, - "end": { - "line": 20, - "column": 14 - } - }, + "start":280,"end":292,"loc":{"start":{"line":20,"column":2},"end":{"line":20,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -822,19 +287,7 @@ }, "property": { "type": "Identifier", - "start": 293, - "end": 296, - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 18 - }, - "identifierName": "foo" - }, + "start":293,"end":296,"loc":{"start":{"line":20,"column":15},"end":{"line":20,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false @@ -842,32 +295,10 @@ }, { "type": "ExpressionStatement", - "start": 300, - "end": 305, - "loc": { - "start": { - "line": 21, - "column": 2 - }, - "end": { - "line": 21, - "column": 7 - } - }, + "start":300,"end":305,"loc":{"start":{"line":21,"column":2},"end":{"line":21,"column":7}}, "expression": { "type": "StringLiteral", - "start": 300, - "end": 304, - "loc": { - "start": { - "line": 21, - "column": 2 - }, - "end": { - "line": 21, - "column": 6 - } - }, + "start":300,"end":304,"loc":{"start":{"line":21,"column":2},"end":{"line":21,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -881,33 +312,10 @@ }, { "type": "FunctionDeclaration", - "start": 309, - "end": 353, - "loc": { - "start": { - "line": 24, - "column": 0 - }, - "end": { - "line": 27, - "column": 1 - } - }, + "start":309,"end":353,"loc":{"start":{"line":24,"column":0},"end":{"line":27,"column":1}}, "id": { "type": "Identifier", - "start": 318, - "end": 319, - "loc": { - "start": { - "line": 24, - "column": 9 - }, - "end": { - "line": 24, - "column": 10 - }, - "identifierName": "f" - }, + "start":318,"end":319,"loc":{"start":{"line":24,"column":9},"end":{"line":24,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -915,61 +323,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 321, - "end": 353, - "loc": { - "start": { - "line": 24, - "column": 12 - }, - "end": { - "line": 27, - "column": 1 - } - }, + "start":321,"end":353,"loc":{"start":{"line":24,"column":12},"end":{"line":27,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 325, - "end": 343, - "loc": { - "start": { - "line": 25, - "column": 2 - }, - "end": { - "line": 25, - "column": 20 - } - }, + "start":325,"end":343,"loc":{"start":{"line":25,"column":2},"end":{"line":25,"column":20}}, "expression": { "type": "MemberExpression", - "start": 325, - "end": 342, - "loc": { - "start": { - "line": 25, - "column": 2 - }, - "end": { - "line": 25, - "column": 19 - } - }, + "start":325,"end":342,"loc":{"start":{"line":25,"column":2},"end":{"line":25,"column":19}}, "object": { "type": "StringLiteral", - "start": 325, - "end": 337, - "loc": { - "start": { - "line": 25, - "column": 2 - }, - "end": { - "line": 25, - "column": 14 - } - }, + "start":325,"end":337,"loc":{"start":{"line":25,"column":2},"end":{"line":25,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -978,19 +342,7 @@ }, "property": { "type": "Identifier", - "start": 338, - "end": 341, - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 25, - "column": 18 - }, - "identifierName": "foo" - }, + "start":338,"end":341,"loc":{"start":{"line":25,"column":15},"end":{"line":25,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": true @@ -998,32 +350,10 @@ }, { "type": "ExpressionStatement", - "start": 346, - "end": 351, - "loc": { - "start": { - "line": 26, - "column": 2 - }, - "end": { - "line": 26, - "column": 7 - } - }, + "start":346,"end":351,"loc":{"start":{"line":26,"column":2},"end":{"line":26,"column":7}}, "expression": { "type": "StringLiteral", - "start": 346, - "end": 350, - "loc": { - "start": { - "line": 26, - "column": 2 - }, - "end": { - "line": 26, - "column": 6 - } - }, + "start":346,"end":350,"loc":{"start":{"line":26,"column":2},"end":{"line":26,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -1037,33 +367,10 @@ }, { "type": "FunctionDeclaration", - "start": 355, - "end": 399, - "loc": { - "start": { - "line": 29, - "column": 0 - }, - "end": { - "line": 32, - "column": 1 - } - }, + "start":355,"end":399,"loc":{"start":{"line":29,"column":0},"end":{"line":32,"column":1}}, "id": { "type": "Identifier", - "start": 364, - "end": 365, - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 29, - "column": 10 - }, - "identifierName": "f" - }, + "start":364,"end":365,"loc":{"start":{"line":29,"column":9},"end":{"line":29,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -1071,61 +378,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 367, - "end": 399, - "loc": { - "start": { - "line": 29, - "column": 12 - }, - "end": { - "line": 32, - "column": 1 - } - }, + "start":367,"end":399,"loc":{"start":{"line":29,"column":12},"end":{"line":32,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 371, - "end": 389, - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 30, - "column": 20 - } - }, + "start":371,"end":389,"loc":{"start":{"line":30,"column":2},"end":{"line":30,"column":20}}, "expression": { "type": "TaggedTemplateExpression", - "start": 371, - "end": 388, - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 30, - "column": 19 - } - }, + "start":371,"end":388,"loc":{"start":{"line":30,"column":2},"end":{"line":30,"column":19}}, "tag": { "type": "StringLiteral", - "start": 371, - "end": 383, - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 30, - "column": 14 - } - }, + "start":371,"end":383,"loc":{"start":{"line":30,"column":2},"end":{"line":30,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -1134,34 +397,12 @@ }, "quasi": { "type": "TemplateLiteral", - "start": 383, - "end": 388, - "loc": { - "start": { - "line": 30, - "column": 14 - }, - "end": { - "line": 30, - "column": 19 - } - }, + "start":383,"end":388,"loc":{"start":{"line":30,"column":14},"end":{"line":30,"column":19}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 384, - "end": 387, - "loc": { - "start": { - "line": 30, - "column": 15 - }, - "end": { - "line": 30, - "column": 18 - } - }, + "start":384,"end":387,"loc":{"start":{"line":30,"column":15},"end":{"line":30,"column":18}}, "value": { "raw": "foo", "cooked": "foo" @@ -1174,32 +415,10 @@ }, { "type": "ExpressionStatement", - "start": 392, - "end": 397, - "loc": { - "start": { - "line": 31, - "column": 2 - }, - "end": { - "line": 31, - "column": 7 - } - }, + "start":392,"end":397,"loc":{"start":{"line":31,"column":2},"end":{"line":31,"column":7}}, "expression": { "type": "StringLiteral", - "start": 392, - "end": 396, - "loc": { - "start": { - "line": 31, - "column": 2 - }, - "end": { - "line": 31, - "column": 6 - } - }, + "start":392,"end":396,"loc":{"start":{"line":31,"column":2},"end":{"line":31,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -1213,33 +432,10 @@ }, { "type": "FunctionDeclaration", - "start": 401, - "end": 445, - "loc": { - "start": { - "line": 34, - "column": 0 - }, - "end": { - "line": 37, - "column": 1 - } - }, + "start":401,"end":445,"loc":{"start":{"line":34,"column":0},"end":{"line":37,"column":1}}, "id": { "type": "Identifier", - "start": 410, - "end": 411, - "loc": { - "start": { - "line": 34, - "column": 9 - }, - "end": { - "line": 34, - "column": 10 - }, - "identifierName": "f" - }, + "start":410,"end":411,"loc":{"start":{"line":34,"column":9},"end":{"line":34,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -1247,61 +443,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 413, - "end": 445, - "loc": { - "start": { - "line": 34, - "column": 12 - }, - "end": { - "line": 37, - "column": 1 - } - }, + "start":413,"end":445,"loc":{"start":{"line":34,"column":12},"end":{"line":37,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 417, - "end": 435, - "loc": { - "start": { - "line": 35, - "column": 2 - }, - "end": { - "line": 35, - "column": 20 - } - }, + "start":417,"end":435,"loc":{"start":{"line":35,"column":2},"end":{"line":35,"column":20}}, "expression": { "type": "CallExpression", - "start": 417, - "end": 434, - "loc": { - "start": { - "line": 35, - "column": 2 - }, - "end": { - "line": 35, - "column": 19 - } - }, + "start":417,"end":434,"loc":{"start":{"line":35,"column":2},"end":{"line":35,"column":19}}, "callee": { "type": "StringLiteral", - "start": 417, - "end": 429, - "loc": { - "start": { - "line": 35, - "column": 2 - }, - "end": { - "line": 35, - "column": 14 - } - }, + "start":417,"end":429,"loc":{"start":{"line":35,"column":2},"end":{"line":35,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -1311,19 +463,7 @@ "arguments": [ { "type": "Identifier", - "start": 430, - "end": 433, - "loc": { - "start": { - "line": 35, - "column": 15 - }, - "end": { - "line": 35, - "column": 18 - }, - "identifierName": "foo" - }, + "start":430,"end":433,"loc":{"start":{"line":35,"column":15},"end":{"line":35,"column":18},"identifierName":"foo"}, "name": "foo" } ] @@ -1331,32 +471,10 @@ }, { "type": "ExpressionStatement", - "start": 438, - "end": 443, - "loc": { - "start": { - "line": 36, - "column": 2 - }, - "end": { - "line": 36, - "column": 7 - } - }, + "start":438,"end":443,"loc":{"start":{"line":36,"column":2},"end":{"line":36,"column":7}}, "expression": { "type": "StringLiteral", - "start": 438, - "end": 442, - "loc": { - "start": { - "line": 36, - "column": 2 - }, - "end": { - "line": 36, - "column": 6 - } - }, + "start":438,"end":442,"loc":{"start":{"line":36,"column":2},"end":{"line":36,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -1370,33 +488,10 @@ }, { "type": "FunctionDeclaration", - "start": 447, - "end": 493, - "loc": { - "start": { - "line": 39, - "column": 0 - }, - "end": { - "line": 43, - "column": 1 - } - }, + "start":447,"end":493,"loc":{"start":{"line":39,"column":0},"end":{"line":43,"column":1}}, "id": { "type": "Identifier", - "start": 456, - "end": 457, - "loc": { - "start": { - "line": 39, - "column": 9 - }, - "end": { - "line": 39, - "column": 10 - }, - "identifierName": "f" - }, + "start":456,"end":457,"loc":{"start":{"line":39,"column":9},"end":{"line":39,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -1404,61 +499,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 459, - "end": 493, - "loc": { - "start": { - "line": 39, - "column": 12 - }, - "end": { - "line": 43, - "column": 1 - } - }, + "start":459,"end":493,"loc":{"start":{"line":39,"column":12},"end":{"line":43,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 463, - "end": 483, - "loc": { - "start": { - "line": 40, - "column": 2 - }, - "end": { - "line": 41, - "column": 7 - } - }, + "start":463,"end":483,"loc":{"start":{"line":40,"column":2},"end":{"line":41,"column":7}}, "expression": { "type": "MemberExpression", - "start": 463, - "end": 482, - "loc": { - "start": { - "line": 40, - "column": 2 - }, - "end": { - "line": 41, - "column": 6 - } - }, + "start":463,"end":482,"loc":{"start":{"line":40,"column":2},"end":{"line":41,"column":6}}, "object": { "type": "StringLiteral", - "start": 463, - "end": 475, - "loc": { - "start": { - "line": 40, - "column": 2 - }, - "end": { - "line": 40, - "column": 14 - } - }, + "start":463,"end":475,"loc":{"start":{"line":40,"column":2},"end":{"line":40,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -1467,19 +518,7 @@ }, "property": { "type": "Identifier", - "start": 479, - "end": 482, - "loc": { - "start": { - "line": 41, - "column": 3 - }, - "end": { - "line": 41, - "column": 6 - }, - "identifierName": "foo" - }, + "start":479,"end":482,"loc":{"start":{"line":41,"column":3},"end":{"line":41,"column":6},"identifierName":"foo"}, "name": "foo" }, "computed": false @@ -1487,32 +526,10 @@ }, { "type": "ExpressionStatement", - "start": 486, - "end": 491, - "loc": { - "start": { - "line": 42, - "column": 2 - }, - "end": { - "line": 42, - "column": 7 - } - }, + "start":486,"end":491,"loc":{"start":{"line":42,"column":2},"end":{"line":42,"column":7}}, "expression": { "type": "StringLiteral", - "start": 486, - "end": 490, - "loc": { - "start": { - "line": 42, - "column": 2 - }, - "end": { - "line": 42, - "column": 6 - } - }, + "start":486,"end":490,"loc":{"start":{"line":42,"column":2},"end":{"line":42,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -1526,33 +543,10 @@ }, { "type": "FunctionDeclaration", - "start": 495, - "end": 542, - "loc": { - "start": { - "line": 45, - "column": 0 - }, - "end": { - "line": 49, - "column": 1 - } - }, + "start":495,"end":542,"loc":{"start":{"line":45,"column":0},"end":{"line":49,"column":1}}, "id": { "type": "Identifier", - "start": 504, - "end": 505, - "loc": { - "start": { - "line": 45, - "column": 9 - }, - "end": { - "line": 45, - "column": 10 - }, - "identifierName": "f" - }, + "start":504,"end":505,"loc":{"start":{"line":45,"column":9},"end":{"line":45,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -1560,61 +554,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 507, - "end": 542, - "loc": { - "start": { - "line": 45, - "column": 12 - }, - "end": { - "line": 49, - "column": 1 - } - }, + "start":507,"end":542,"loc":{"start":{"line":45,"column":12},"end":{"line":49,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 511, - "end": 532, - "loc": { - "start": { - "line": 46, - "column": 2 - }, - "end": { - "line": 47, - "column": 8 - } - }, + "start":511,"end":532,"loc":{"start":{"line":46,"column":2},"end":{"line":47,"column":8}}, "expression": { "type": "MemberExpression", - "start": 511, - "end": 531, - "loc": { - "start": { - "line": 46, - "column": 2 - }, - "end": { - "line": 47, - "column": 7 - } - }, + "start":511,"end":531,"loc":{"start":{"line":46,"column":2},"end":{"line":47,"column":7}}, "object": { "type": "StringLiteral", - "start": 511, - "end": 523, - "loc": { - "start": { - "line": 46, - "column": 2 - }, - "end": { - "line": 46, - "column": 14 - } - }, + "start":511,"end":523,"loc":{"start":{"line":46,"column":2},"end":{"line":46,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -1623,19 +573,7 @@ }, "property": { "type": "Identifier", - "start": 527, - "end": 530, - "loc": { - "start": { - "line": 47, - "column": 3 - }, - "end": { - "line": 47, - "column": 6 - }, - "identifierName": "foo" - }, + "start":527,"end":530,"loc":{"start":{"line":47,"column":3},"end":{"line":47,"column":6},"identifierName":"foo"}, "name": "foo" }, "computed": true @@ -1643,32 +581,10 @@ }, { "type": "ExpressionStatement", - "start": 535, - "end": 540, - "loc": { - "start": { - "line": 48, - "column": 2 - }, - "end": { - "line": 48, - "column": 7 - } - }, + "start":535,"end":540,"loc":{"start":{"line":48,"column":2},"end":{"line":48,"column":7}}, "expression": { "type": "StringLiteral", - "start": 535, - "end": 539, - "loc": { - "start": { - "line": 48, - "column": 2 - }, - "end": { - "line": 48, - "column": 6 - } - }, + "start":535,"end":539,"loc":{"start":{"line":48,"column":2},"end":{"line":48,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -1682,33 +598,10 @@ }, { "type": "FunctionDeclaration", - "start": 544, - "end": 591, - "loc": { - "start": { - "line": 51, - "column": 0 - }, - "end": { - "line": 55, - "column": 1 - } - }, + "start":544,"end":591,"loc":{"start":{"line":51,"column":0},"end":{"line":55,"column":1}}, "id": { "type": "Identifier", - "start": 553, - "end": 554, - "loc": { - "start": { - "line": 51, - "column": 9 - }, - "end": { - "line": 51, - "column": 10 - }, - "identifierName": "f" - }, + "start":553,"end":554,"loc":{"start":{"line":51,"column":9},"end":{"line":51,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -1716,61 +609,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 556, - "end": 591, - "loc": { - "start": { - "line": 51, - "column": 12 - }, - "end": { - "line": 55, - "column": 1 - } - }, + "start":556,"end":591,"loc":{"start":{"line":51,"column":12},"end":{"line":55,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 560, - "end": 581, - "loc": { - "start": { - "line": 52, - "column": 2 - }, - "end": { - "line": 53, - "column": 8 - } - }, + "start":560,"end":581,"loc":{"start":{"line":52,"column":2},"end":{"line":53,"column":8}}, "expression": { "type": "TaggedTemplateExpression", - "start": 560, - "end": 580, - "loc": { - "start": { - "line": 52, - "column": 2 - }, - "end": { - "line": 53, - "column": 7 - } - }, + "start":560,"end":580,"loc":{"start":{"line":52,"column":2},"end":{"line":53,"column":7}}, "tag": { "type": "StringLiteral", - "start": 560, - "end": 572, - "loc": { - "start": { - "line": 52, - "column": 2 - }, - "end": { - "line": 52, - "column": 14 - } - }, + "start":560,"end":572,"loc":{"start":{"line":52,"column":2},"end":{"line":52,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -1779,34 +628,12 @@ }, "quasi": { "type": "TemplateLiteral", - "start": 575, - "end": 580, - "loc": { - "start": { - "line": 53, - "column": 2 - }, - "end": { - "line": 53, - "column": 7 - } - }, + "start":575,"end":580,"loc":{"start":{"line":53,"column":2},"end":{"line":53,"column":7}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 576, - "end": 579, - "loc": { - "start": { - "line": 53, - "column": 3 - }, - "end": { - "line": 53, - "column": 6 - } - }, + "start":576,"end":579,"loc":{"start":{"line":53,"column":3},"end":{"line":53,"column":6}}, "value": { "raw": "foo", "cooked": "foo" @@ -1819,32 +646,10 @@ }, { "type": "ExpressionStatement", - "start": 584, - "end": 589, - "loc": { - "start": { - "line": 54, - "column": 2 - }, - "end": { - "line": 54, - "column": 7 - } - }, + "start":584,"end":589,"loc":{"start":{"line":54,"column":2},"end":{"line":54,"column":7}}, "expression": { "type": "StringLiteral", - "start": 584, - "end": 588, - "loc": { - "start": { - "line": 54, - "column": 2 - }, - "end": { - "line": 54, - "column": 6 - } - }, + "start":584,"end":588,"loc":{"start":{"line":54,"column":2},"end":{"line":54,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -1858,33 +663,10 @@ }, { "type": "FunctionDeclaration", - "start": 593, - "end": 640, - "loc": { - "start": { - "line": 57, - "column": 0 - }, - "end": { - "line": 61, - "column": 1 - } - }, + "start":593,"end":640,"loc":{"start":{"line":57,"column":0},"end":{"line":61,"column":1}}, "id": { "type": "Identifier", - "start": 602, - "end": 603, - "loc": { - "start": { - "line": 57, - "column": 9 - }, - "end": { - "line": 57, - "column": 10 - }, - "identifierName": "f" - }, + "start":602,"end":603,"loc":{"start":{"line":57,"column":9},"end":{"line":57,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -1892,61 +674,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 605, - "end": 640, - "loc": { - "start": { - "line": 57, - "column": 12 - }, - "end": { - "line": 61, - "column": 1 - } - }, + "start":605,"end":640,"loc":{"start":{"line":57,"column":12},"end":{"line":61,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 609, - "end": 630, - "loc": { - "start": { - "line": 58, - "column": 2 - }, - "end": { - "line": 59, - "column": 8 - } - }, + "start":609,"end":630,"loc":{"start":{"line":58,"column":2},"end":{"line":59,"column":8}}, "expression": { "type": "CallExpression", - "start": 609, - "end": 629, - "loc": { - "start": { - "line": 58, - "column": 2 - }, - "end": { - "line": 59, - "column": 7 - } - }, + "start":609,"end":629,"loc":{"start":{"line":58,"column":2},"end":{"line":59,"column":7}}, "callee": { "type": "StringLiteral", - "start": 609, - "end": 621, - "loc": { - "start": { - "line": 58, - "column": 2 - }, - "end": { - "line": 58, - "column": 14 - } - }, + "start":609,"end":621,"loc":{"start":{"line":58,"column":2},"end":{"line":58,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -1956,19 +694,7 @@ "arguments": [ { "type": "Identifier", - "start": 625, - "end": 628, - "loc": { - "start": { - "line": 59, - "column": 3 - }, - "end": { - "line": 59, - "column": 6 - }, - "identifierName": "foo" - }, + "start":625,"end":628,"loc":{"start":{"line":59,"column":3},"end":{"line":59,"column":6},"identifierName":"foo"}, "name": "foo" } ] @@ -1976,32 +702,10 @@ }, { "type": "ExpressionStatement", - "start": 633, - "end": 638, - "loc": { - "start": { - "line": 60, - "column": 2 - }, - "end": { - "line": 60, - "column": 7 - } - }, + "start":633,"end":638,"loc":{"start":{"line":60,"column":2},"end":{"line":60,"column":7}}, "expression": { "type": "StringLiteral", - "start": 633, - "end": 637, - "loc": { - "start": { - "line": 60, - "column": 2 - }, - "end": { - "line": 60, - "column": 6 - } - }, + "start":633,"end":637,"loc":{"start":{"line":60,"column":2},"end":{"line":60,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -2015,33 +719,10 @@ }, { "type": "FunctionDeclaration", - "start": 642, - "end": 694, - "loc": { - "start": { - "line": 63, - "column": 0 - }, - "end": { - "line": 67, - "column": 1 - } - }, + "start":642,"end":694,"loc":{"start":{"line":63,"column":0},"end":{"line":67,"column":1}}, "id": { "type": "Identifier", - "start": 651, - "end": 652, - "loc": { - "start": { - "line": 63, - "column": 9 - }, - "end": { - "line": 63, - "column": 10 - }, - "identifierName": "f" - }, + "start":651,"end":652,"loc":{"start":{"line":63,"column":9},"end":{"line":63,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -2049,62 +730,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 654, - "end": 694, - "loc": { - "start": { - "line": 63, - "column": 12 - }, - "end": { - "line": 67, - "column": 1 - } - }, + "start":654,"end":694,"loc":{"start":{"line":63,"column":12},"end":{"line":67,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 658, - "end": 664, - "loc": { - "start": { - "line": 64, - "column": 2 - }, - "end": { - "line": 64, - "column": 8 - } - }, + "start":658,"end":664,"loc":{"start":{"line":64,"column":2},"end":{"line":64,"column":8}}, "expression": { "type": "CallExpression", - "start": 658, - "end": 663, - "loc": { - "start": { - "line": 64, - "column": 2 - }, - "end": { - "line": 64, - "column": 7 - } - }, + "start":658,"end":663,"loc":{"start":{"line":64,"column":2},"end":{"line":64,"column":7}}, "callee": { "type": "Identifier", - "start": 658, - "end": 661, - "loc": { - "start": { - "line": 64, - "column": 2 - }, - "end": { - "line": 64, - "column": 5 - }, - "identifierName": "foo" - }, + "start":658,"end":661,"loc":{"start":{"line":64,"column":2},"end":{"line":64,"column":5},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -2112,46 +748,13 @@ }, { "type": "ExpressionStatement", - "start": 667, - "end": 684, - "loc": { - "start": { - "line": 65, - "column": 2 - }, - "end": { - "line": 65, - "column": 19 - } - }, + "start":667,"end":684,"loc":{"start":{"line":65,"column":2},"end":{"line":65,"column":19}}, "expression": { "type": "MemberExpression", - "start": 667, - "end": 683, - "loc": { - "start": { - "line": 65, - "column": 2 - }, - "end": { - "line": 65, - "column": 18 - } - }, + "start":667,"end":683,"loc":{"start":{"line":65,"column":2},"end":{"line":65,"column":18}}, "object": { "type": "StringLiteral", - "start": 667, - "end": 679, - "loc": { - "start": { - "line": 65, - "column": 2 - }, - "end": { - "line": 65, - "column": 14 - } - }, + "start":667,"end":679,"loc":{"start":{"line":65,"column":2},"end":{"line":65,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -2160,19 +763,7 @@ }, "property": { "type": "Identifier", - "start": 680, - "end": 683, - "loc": { - "start": { - "line": 65, - "column": 15 - }, - "end": { - "line": 65, - "column": 18 - }, - "identifierName": "bar" - }, + "start":680,"end":683,"loc":{"start":{"line":65,"column":15},"end":{"line":65,"column":18},"identifierName":"bar"}, "name": "bar" }, "computed": false @@ -2180,32 +771,10 @@ }, { "type": "ExpressionStatement", - "start": 687, - "end": 692, - "loc": { - "start": { - "line": 66, - "column": 2 - }, - "end": { - "line": 66, - "column": 7 - } - }, + "start":687,"end":692,"loc":{"start":{"line":66,"column":2},"end":{"line":66,"column":7}}, "expression": { "type": "StringLiteral", - "start": 687, - "end": 691, - "loc": { - "start": { - "line": 66, - "column": 2 - }, - "end": { - "line": 66, - "column": 6 - } - }, + "start":687,"end":691,"loc":{"start":{"line":66,"column":2},"end":{"line":66,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -2219,33 +788,10 @@ }, { "type": "FunctionDeclaration", - "start": 696, - "end": 749, - "loc": { - "start": { - "line": 69, - "column": 0 - }, - "end": { - "line": 73, - "column": 1 - } - }, + "start":696,"end":749,"loc":{"start":{"line":69,"column":0},"end":{"line":73,"column":1}}, "id": { "type": "Identifier", - "start": 705, - "end": 706, - "loc": { - "start": { - "line": 69, - "column": 9 - }, - "end": { - "line": 69, - "column": 10 - }, - "identifierName": "f" - }, + "start":705,"end":706,"loc":{"start":{"line":69,"column":9},"end":{"line":69,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -2253,62 +799,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 708, - "end": 749, - "loc": { - "start": { - "line": 69, - "column": 12 - }, - "end": { - "line": 73, - "column": 1 - } - }, + "start":708,"end":749,"loc":{"start":{"line":69,"column":12},"end":{"line":73,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 712, - "end": 718, - "loc": { - "start": { - "line": 70, - "column": 2 - }, - "end": { - "line": 70, - "column": 8 - } - }, + "start":712,"end":718,"loc":{"start":{"line":70,"column":2},"end":{"line":70,"column":8}}, "expression": { "type": "CallExpression", - "start": 712, - "end": 717, - "loc": { - "start": { - "line": 70, - "column": 2 - }, - "end": { - "line": 70, - "column": 7 - } - }, + "start":712,"end":717,"loc":{"start":{"line":70,"column":2},"end":{"line":70,"column":7}}, "callee": { "type": "Identifier", - "start": 712, - "end": 715, - "loc": { - "start": { - "line": 70, - "column": 2 - }, - "end": { - "line": 70, - "column": 5 - }, - "identifierName": "foo" - }, + "start":712,"end":715,"loc":{"start":{"line":70,"column":2},"end":{"line":70,"column":5},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -2316,46 +817,13 @@ }, { "type": "ExpressionStatement", - "start": 721, - "end": 739, - "loc": { - "start": { - "line": 71, - "column": 2 - }, - "end": { - "line": 71, - "column": 20 - } - }, + "start":721,"end":739,"loc":{"start":{"line":71,"column":2},"end":{"line":71,"column":20}}, "expression": { "type": "MemberExpression", - "start": 721, - "end": 738, - "loc": { - "start": { - "line": 71, - "column": 2 - }, - "end": { - "line": 71, - "column": 19 - } - }, + "start":721,"end":738,"loc":{"start":{"line":71,"column":2},"end":{"line":71,"column":19}}, "object": { "type": "StringLiteral", - "start": 721, - "end": 733, - "loc": { - "start": { - "line": 71, - "column": 2 - }, - "end": { - "line": 71, - "column": 14 - } - }, + "start":721,"end":733,"loc":{"start":{"line":71,"column":2},"end":{"line":71,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -2364,19 +832,7 @@ }, "property": { "type": "Identifier", - "start": 734, - "end": 737, - "loc": { - "start": { - "line": 71, - "column": 15 - }, - "end": { - "line": 71, - "column": 18 - }, - "identifierName": "bar" - }, + "start":734,"end":737,"loc":{"start":{"line":71,"column":15},"end":{"line":71,"column":18},"identifierName":"bar"}, "name": "bar" }, "computed": true @@ -2384,32 +840,10 @@ }, { "type": "ExpressionStatement", - "start": 742, - "end": 747, - "loc": { - "start": { - "line": 72, - "column": 2 - }, - "end": { - "line": 72, - "column": 7 - } - }, + "start":742,"end":747,"loc":{"start":{"line":72,"column":2},"end":{"line":72,"column":7}}, "expression": { "type": "StringLiteral", - "start": 742, - "end": 746, - "loc": { - "start": { - "line": 72, - "column": 2 - }, - "end": { - "line": 72, - "column": 6 - } - }, + "start":742,"end":746,"loc":{"start":{"line":72,"column":2},"end":{"line":72,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -2423,33 +857,10 @@ }, { "type": "FunctionDeclaration", - "start": 751, - "end": 804, - "loc": { - "start": { - "line": 75, - "column": 0 - }, - "end": { - "line": 79, - "column": 1 - } - }, + "start":751,"end":804,"loc":{"start":{"line":75,"column":0},"end":{"line":79,"column":1}}, "id": { "type": "Identifier", - "start": 760, - "end": 761, - "loc": { - "start": { - "line": 75, - "column": 9 - }, - "end": { - "line": 75, - "column": 10 - }, - "identifierName": "f" - }, + "start":760,"end":761,"loc":{"start":{"line":75,"column":9},"end":{"line":75,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -2457,62 +868,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 763, - "end": 804, - "loc": { - "start": { - "line": 75, - "column": 12 - }, - "end": { - "line": 79, - "column": 1 - } - }, + "start":763,"end":804,"loc":{"start":{"line":75,"column":12},"end":{"line":79,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 767, - "end": 773, - "loc": { - "start": { - "line": 76, - "column": 2 - }, - "end": { - "line": 76, - "column": 8 - } - }, + "start":767,"end":773,"loc":{"start":{"line":76,"column":2},"end":{"line":76,"column":8}}, "expression": { "type": "CallExpression", - "start": 767, - "end": 772, - "loc": { - "start": { - "line": 76, - "column": 2 - }, - "end": { - "line": 76, - "column": 7 - } - }, + "start":767,"end":772,"loc":{"start":{"line":76,"column":2},"end":{"line":76,"column":7}}, "callee": { "type": "Identifier", - "start": 767, - "end": 770, - "loc": { - "start": { - "line": 76, - "column": 2 - }, - "end": { - "line": 76, - "column": 5 - }, - "identifierName": "foo" - }, + "start":767,"end":770,"loc":{"start":{"line":76,"column":2},"end":{"line":76,"column":5},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -2520,46 +886,13 @@ }, { "type": "ExpressionStatement", - "start": 776, - "end": 794, - "loc": { - "start": { - "line": 77, - "column": 2 - }, - "end": { - "line": 77, - "column": 20 - } - }, + "start":776,"end":794,"loc":{"start":{"line":77,"column":2},"end":{"line":77,"column":20}}, "expression": { "type": "TaggedTemplateExpression", - "start": 776, - "end": 793, - "loc": { - "start": { - "line": 77, - "column": 2 - }, - "end": { - "line": 77, - "column": 19 - } - }, + "start":776,"end":793,"loc":{"start":{"line":77,"column":2},"end":{"line":77,"column":19}}, "tag": { "type": "StringLiteral", - "start": 776, - "end": 788, - "loc": { - "start": { - "line": 77, - "column": 2 - }, - "end": { - "line": 77, - "column": 14 - } - }, + "start":776,"end":788,"loc":{"start":{"line":77,"column":2},"end":{"line":77,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -2568,34 +901,12 @@ }, "quasi": { "type": "TemplateLiteral", - "start": 788, - "end": 793, - "loc": { - "start": { - "line": 77, - "column": 14 - }, - "end": { - "line": 77, - "column": 19 - } - }, + "start":788,"end":793,"loc":{"start":{"line":77,"column":14},"end":{"line":77,"column":19}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 789, - "end": 792, - "loc": { - "start": { - "line": 77, - "column": 15 - }, - "end": { - "line": 77, - "column": 18 - } - }, + "start":789,"end":792,"loc":{"start":{"line":77,"column":15},"end":{"line":77,"column":18}}, "value": { "raw": "bar", "cooked": "bar" @@ -2608,32 +919,10 @@ }, { "type": "ExpressionStatement", - "start": 797, - "end": 802, - "loc": { - "start": { - "line": 78, - "column": 2 - }, - "end": { - "line": 78, - "column": 7 - } - }, + "start":797,"end":802,"loc":{"start":{"line":78,"column":2},"end":{"line":78,"column":7}}, "expression": { "type": "StringLiteral", - "start": 797, - "end": 801, - "loc": { - "start": { - "line": 78, - "column": 2 - }, - "end": { - "line": 78, - "column": 6 - } - }, + "start":797,"end":801,"loc":{"start":{"line":78,"column":2},"end":{"line":78,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -2647,33 +936,10 @@ }, { "type": "FunctionDeclaration", - "start": 806, - "end": 859, - "loc": { - "start": { - "line": 81, - "column": 0 - }, - "end": { - "line": 85, - "column": 1 - } - }, + "start":806,"end":859,"loc":{"start":{"line":81,"column":0},"end":{"line":85,"column":1}}, "id": { "type": "Identifier", - "start": 815, - "end": 816, - "loc": { - "start": { - "line": 81, - "column": 9 - }, - "end": { - "line": 81, - "column": 10 - }, - "identifierName": "f" - }, + "start":815,"end":816,"loc":{"start":{"line":81,"column":9},"end":{"line":81,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -2681,62 +947,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 818, - "end": 859, - "loc": { - "start": { - "line": 81, - "column": 12 - }, - "end": { - "line": 85, - "column": 1 - } - }, + "start":818,"end":859,"loc":{"start":{"line":81,"column":12},"end":{"line":85,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 822, - "end": 828, - "loc": { - "start": { - "line": 82, - "column": 2 - }, - "end": { - "line": 82, - "column": 8 - } - }, + "start":822,"end":828,"loc":{"start":{"line":82,"column":2},"end":{"line":82,"column":8}}, "expression": { "type": "CallExpression", - "start": 822, - "end": 827, - "loc": { - "start": { - "line": 82, - "column": 2 - }, - "end": { - "line": 82, - "column": 7 - } - }, + "start":822,"end":827,"loc":{"start":{"line":82,"column":2},"end":{"line":82,"column":7}}, "callee": { "type": "Identifier", - "start": 822, - "end": 825, - "loc": { - "start": { - "line": 82, - "column": 2 - }, - "end": { - "line": 82, - "column": 5 - }, - "identifierName": "foo" - }, + "start":822,"end":825,"loc":{"start":{"line":82,"column":2},"end":{"line":82,"column":5},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -2744,46 +965,13 @@ }, { "type": "ExpressionStatement", - "start": 831, - "end": 849, - "loc": { - "start": { - "line": 83, - "column": 2 - }, - "end": { - "line": 83, - "column": 20 - } - }, + "start":831,"end":849,"loc":{"start":{"line":83,"column":2},"end":{"line":83,"column":20}}, "expression": { "type": "CallExpression", - "start": 831, - "end": 848, - "loc": { - "start": { - "line": 83, - "column": 2 - }, - "end": { - "line": 83, - "column": 19 - } - }, + "start":831,"end":848,"loc":{"start":{"line":83,"column":2},"end":{"line":83,"column":19}}, "callee": { "type": "StringLiteral", - "start": 831, - "end": 843, - "loc": { - "start": { - "line": 83, - "column": 2 - }, - "end": { - "line": 83, - "column": 14 - } - }, + "start":831,"end":843,"loc":{"start":{"line":83,"column":2},"end":{"line":83,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -2793,19 +981,7 @@ "arguments": [ { "type": "Identifier", - "start": 844, - "end": 847, - "loc": { - "start": { - "line": 83, - "column": 15 - }, - "end": { - "line": 83, - "column": 18 - }, - "identifierName": "bar" - }, + "start":844,"end":847,"loc":{"start":{"line":83,"column":15},"end":{"line":83,"column":18},"identifierName":"bar"}, "name": "bar" } ] @@ -2813,32 +989,10 @@ }, { "type": "ExpressionStatement", - "start": 852, - "end": 857, - "loc": { - "start": { - "line": 84, - "column": 2 - }, - "end": { - "line": 84, - "column": 7 - } - }, + "start":852,"end":857,"loc":{"start":{"line":84,"column":2},"end":{"line":84,"column":7}}, "expression": { "type": "StringLiteral", - "start": 852, - "end": 856, - "loc": { - "start": { - "line": 84, - "column": 2 - }, - "end": { - "line": 84, - "column": 6 - } - }, + "start":852,"end":856,"loc":{"start":{"line":84,"column":2},"end":{"line":84,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -2852,33 +1006,10 @@ }, { "type": "FunctionDeclaration", - "start": 861, - "end": 916, - "loc": { - "start": { - "line": 87, - "column": 0 - }, - "end": { - "line": 92, - "column": 1 - } - }, + "start":861,"end":916,"loc":{"start":{"line":87,"column":0},"end":{"line":92,"column":1}}, "id": { "type": "Identifier", - "start": 870, - "end": 871, - "loc": { - "start": { - "line": 87, - "column": 9 - }, - "end": { - "line": 87, - "column": 10 - }, - "identifierName": "f" - }, + "start":870,"end":871,"loc":{"start":{"line":87,"column":9},"end":{"line":87,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -2886,62 +1017,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 873, - "end": 916, - "loc": { - "start": { - "line": 87, - "column": 12 - }, - "end": { - "line": 92, - "column": 1 - } - }, + "start":873,"end":916,"loc":{"start":{"line":87,"column":12},"end":{"line":92,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 877, - "end": 883, - "loc": { - "start": { - "line": 88, - "column": 2 - }, - "end": { - "line": 88, - "column": 8 - } - }, + "start":877,"end":883,"loc":{"start":{"line":88,"column":2},"end":{"line":88,"column":8}}, "expression": { "type": "CallExpression", - "start": 877, - "end": 882, - "loc": { - "start": { - "line": 88, - "column": 2 - }, - "end": { - "line": 88, - "column": 7 - } - }, + "start":877,"end":882,"loc":{"start":{"line":88,"column":2},"end":{"line":88,"column":7}}, "callee": { "type": "Identifier", - "start": 877, - "end": 880, - "loc": { - "start": { - "line": 88, - "column": 2 - }, - "end": { - "line": 88, - "column": 5 - }, - "identifierName": "foo" - }, + "start":877,"end":880,"loc":{"start":{"line":88,"column":2},"end":{"line":88,"column":5},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -2949,46 +1035,13 @@ }, { "type": "ExpressionStatement", - "start": 886, - "end": 906, - "loc": { - "start": { - "line": 89, - "column": 2 - }, - "end": { - "line": 90, - "column": 7 - } - }, + "start":886,"end":906,"loc":{"start":{"line":89,"column":2},"end":{"line":90,"column":7}}, "expression": { "type": "MemberExpression", - "start": 886, - "end": 905, - "loc": { - "start": { - "line": 89, - "column": 2 - }, - "end": { - "line": 90, - "column": 6 - } - }, + "start":886,"end":905,"loc":{"start":{"line":89,"column":2},"end":{"line":90,"column":6}}, "object": { "type": "StringLiteral", - "start": 886, - "end": 898, - "loc": { - "start": { - "line": 89, - "column": 2 - }, - "end": { - "line": 89, - "column": 14 - } - }, + "start":886,"end":898,"loc":{"start":{"line":89,"column":2},"end":{"line":89,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -2997,19 +1050,7 @@ }, "property": { "type": "Identifier", - "start": 902, - "end": 905, - "loc": { - "start": { - "line": 90, - "column": 3 - }, - "end": { - "line": 90, - "column": 6 - }, - "identifierName": "bar" - }, + "start":902,"end":905,"loc":{"start":{"line":90,"column":3},"end":{"line":90,"column":6},"identifierName":"bar"}, "name": "bar" }, "computed": false @@ -3017,32 +1058,10 @@ }, { "type": "ExpressionStatement", - "start": 909, - "end": 914, - "loc": { - "start": { - "line": 91, - "column": 2 - }, - "end": { - "line": 91, - "column": 7 - } - }, + "start":909,"end":914,"loc":{"start":{"line":91,"column":2},"end":{"line":91,"column":7}}, "expression": { "type": "StringLiteral", - "start": 909, - "end": 913, - "loc": { - "start": { - "line": 91, - "column": 2 - }, - "end": { - "line": 91, - "column": 6 - } - }, + "start":909,"end":913,"loc":{"start":{"line":91,"column":2},"end":{"line":91,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -3056,33 +1075,10 @@ }, { "type": "FunctionDeclaration", - "start": 918, - "end": 974, - "loc": { - "start": { - "line": 94, - "column": 0 - }, - "end": { - "line": 99, - "column": 1 - } - }, + "start":918,"end":974,"loc":{"start":{"line":94,"column":0},"end":{"line":99,"column":1}}, "id": { "type": "Identifier", - "start": 927, - "end": 928, - "loc": { - "start": { - "line": 94, - "column": 9 - }, - "end": { - "line": 94, - "column": 10 - }, - "identifierName": "f" - }, + "start":927,"end":928,"loc":{"start":{"line":94,"column":9},"end":{"line":94,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -3090,62 +1086,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 930, - "end": 974, - "loc": { - "start": { - "line": 94, - "column": 12 - }, - "end": { - "line": 99, - "column": 1 - } - }, + "start":930,"end":974,"loc":{"start":{"line":94,"column":12},"end":{"line":99,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 934, - "end": 940, - "loc": { - "start": { - "line": 95, - "column": 2 - }, - "end": { - "line": 95, - "column": 8 - } - }, + "start":934,"end":940,"loc":{"start":{"line":95,"column":2},"end":{"line":95,"column":8}}, "expression": { "type": "CallExpression", - "start": 934, - "end": 939, - "loc": { - "start": { - "line": 95, - "column": 2 - }, - "end": { - "line": 95, - "column": 7 - } - }, + "start":934,"end":939,"loc":{"start":{"line":95,"column":2},"end":{"line":95,"column":7}}, "callee": { "type": "Identifier", - "start": 934, - "end": 937, - "loc": { - "start": { - "line": 95, - "column": 2 - }, - "end": { - "line": 95, - "column": 5 - }, - "identifierName": "foo" - }, + "start":934,"end":937,"loc":{"start":{"line":95,"column":2},"end":{"line":95,"column":5},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -3153,46 +1104,13 @@ }, { "type": "ExpressionStatement", - "start": 943, - "end": 964, - "loc": { - "start": { - "line": 96, - "column": 2 - }, - "end": { - "line": 97, - "column": 8 - } - }, + "start":943,"end":964,"loc":{"start":{"line":96,"column":2},"end":{"line":97,"column":8}}, "expression": { "type": "MemberExpression", - "start": 943, - "end": 963, - "loc": { - "start": { - "line": 96, - "column": 2 - }, - "end": { - "line": 97, - "column": 7 - } - }, + "start":943,"end":963,"loc":{"start":{"line":96,"column":2},"end":{"line":97,"column":7}}, "object": { "type": "StringLiteral", - "start": 943, - "end": 955, - "loc": { - "start": { - "line": 96, - "column": 2 - }, - "end": { - "line": 96, - "column": 14 - } - }, + "start":943,"end":955,"loc":{"start":{"line":96,"column":2},"end":{"line":96,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -3201,19 +1119,7 @@ }, "property": { "type": "Identifier", - "start": 959, - "end": 962, - "loc": { - "start": { - "line": 97, - "column": 3 - }, - "end": { - "line": 97, - "column": 6 - }, - "identifierName": "bar" - }, + "start":959,"end":962,"loc":{"start":{"line":97,"column":3},"end":{"line":97,"column":6},"identifierName":"bar"}, "name": "bar" }, "computed": true @@ -3221,32 +1127,10 @@ }, { "type": "ExpressionStatement", - "start": 967, - "end": 972, - "loc": { - "start": { - "line": 98, - "column": 2 - }, - "end": { - "line": 98, - "column": 7 - } - }, + "start":967,"end":972,"loc":{"start":{"line":98,"column":2},"end":{"line":98,"column":7}}, "expression": { "type": "StringLiteral", - "start": 967, - "end": 971, - "loc": { - "start": { - "line": 98, - "column": 2 - }, - "end": { - "line": 98, - "column": 6 - } - }, + "start":967,"end":971,"loc":{"start":{"line":98,"column":2},"end":{"line":98,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -3260,33 +1144,10 @@ }, { "type": "FunctionDeclaration", - "start": 976, - "end": 1032, - "loc": { - "start": { - "line": 101, - "column": 0 - }, - "end": { - "line": 106, - "column": 1 - } - }, + "start":976,"end":1032,"loc":{"start":{"line":101,"column":0},"end":{"line":106,"column":1}}, "id": { "type": "Identifier", - "start": 985, - "end": 986, - "loc": { - "start": { - "line": 101, - "column": 9 - }, - "end": { - "line": 101, - "column": 10 - }, - "identifierName": "f" - }, + "start":985,"end":986,"loc":{"start":{"line":101,"column":9},"end":{"line":101,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -3294,62 +1155,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 988, - "end": 1032, - "loc": { - "start": { - "line": 101, - "column": 12 - }, - "end": { - "line": 106, - "column": 1 - } - }, + "start":988,"end":1032,"loc":{"start":{"line":101,"column":12},"end":{"line":106,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 992, - "end": 998, - "loc": { - "start": { - "line": 102, - "column": 2 - }, - "end": { - "line": 102, - "column": 8 - } - }, + "start":992,"end":998,"loc":{"start":{"line":102,"column":2},"end":{"line":102,"column":8}}, "expression": { "type": "CallExpression", - "start": 992, - "end": 997, - "loc": { - "start": { - "line": 102, - "column": 2 - }, - "end": { - "line": 102, - "column": 7 - } - }, + "start":992,"end":997,"loc":{"start":{"line":102,"column":2},"end":{"line":102,"column":7}}, "callee": { "type": "Identifier", - "start": 992, - "end": 995, - "loc": { - "start": { - "line": 102, - "column": 2 - }, - "end": { - "line": 102, - "column": 5 - }, - "identifierName": "foo" - }, + "start":992,"end":995,"loc":{"start":{"line":102,"column":2},"end":{"line":102,"column":5},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -3357,46 +1173,13 @@ }, { "type": "ExpressionStatement", - "start": 1001, - "end": 1022, - "loc": { - "start": { - "line": 103, - "column": 2 - }, - "end": { - "line": 104, - "column": 8 - } - }, + "start":1001,"end":1022,"loc":{"start":{"line":103,"column":2},"end":{"line":104,"column":8}}, "expression": { "type": "TaggedTemplateExpression", - "start": 1001, - "end": 1021, - "loc": { - "start": { - "line": 103, - "column": 2 - }, - "end": { - "line": 104, - "column": 7 - } - }, + "start":1001,"end":1021,"loc":{"start":{"line":103,"column":2},"end":{"line":104,"column":7}}, "tag": { "type": "StringLiteral", - "start": 1001, - "end": 1013, - "loc": { - "start": { - "line": 103, - "column": 2 - }, - "end": { - "line": 103, - "column": 14 - } - }, + "start":1001,"end":1013,"loc":{"start":{"line":103,"column":2},"end":{"line":103,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -3405,34 +1188,12 @@ }, "quasi": { "type": "TemplateLiteral", - "start": 1016, - "end": 1021, - "loc": { - "start": { - "line": 104, - "column": 2 - }, - "end": { - "line": 104, - "column": 7 - } - }, + "start":1016,"end":1021,"loc":{"start":{"line":104,"column":2},"end":{"line":104,"column":7}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1017, - "end": 1020, - "loc": { - "start": { - "line": 104, - "column": 3 - }, - "end": { - "line": 104, - "column": 6 - } - }, + "start":1017,"end":1020,"loc":{"start":{"line":104,"column":3},"end":{"line":104,"column":6}}, "value": { "raw": "bar", "cooked": "bar" @@ -3445,32 +1206,10 @@ }, { "type": "ExpressionStatement", - "start": 1025, - "end": 1030, - "loc": { - "start": { - "line": 105, - "column": 2 - }, - "end": { - "line": 105, - "column": 7 - } - }, + "start":1025,"end":1030,"loc":{"start":{"line":105,"column":2},"end":{"line":105,"column":7}}, "expression": { "type": "StringLiteral", - "start": 1025, - "end": 1029, - "loc": { - "start": { - "line": 105, - "column": 2 - }, - "end": { - "line": 105, - "column": 6 - } - }, + "start":1025,"end":1029,"loc":{"start":{"line":105,"column":2},"end":{"line":105,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -3484,33 +1223,10 @@ }, { "type": "FunctionDeclaration", - "start": 1034, - "end": 1090, - "loc": { - "start": { - "line": 108, - "column": 0 - }, - "end": { - "line": 113, - "column": 1 - } - }, + "start":1034,"end":1090,"loc":{"start":{"line":108,"column":0},"end":{"line":113,"column":1}}, "id": { "type": "Identifier", - "start": 1043, - "end": 1044, - "loc": { - "start": { - "line": 108, - "column": 9 - }, - "end": { - "line": 108, - "column": 10 - }, - "identifierName": "f" - }, + "start":1043,"end":1044,"loc":{"start":{"line":108,"column":9},"end":{"line":108,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -3518,62 +1234,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 1046, - "end": 1090, - "loc": { - "start": { - "line": 108, - "column": 12 - }, - "end": { - "line": 113, - "column": 1 - } - }, + "start":1046,"end":1090,"loc":{"start":{"line":108,"column":12},"end":{"line":113,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 1050, - "end": 1056, - "loc": { - "start": { - "line": 109, - "column": 2 - }, - "end": { - "line": 109, - "column": 8 - } - }, + "start":1050,"end":1056,"loc":{"start":{"line":109,"column":2},"end":{"line":109,"column":8}}, "expression": { "type": "CallExpression", - "start": 1050, - "end": 1055, - "loc": { - "start": { - "line": 109, - "column": 2 - }, - "end": { - "line": 109, - "column": 7 - } - }, + "start":1050,"end":1055,"loc":{"start":{"line":109,"column":2},"end":{"line":109,"column":7}}, "callee": { "type": "Identifier", - "start": 1050, - "end": 1053, - "loc": { - "start": { - "line": 109, - "column": 2 - }, - "end": { - "line": 109, - "column": 5 - }, - "identifierName": "foo" - }, + "start":1050,"end":1053,"loc":{"start":{"line":109,"column":2},"end":{"line":109,"column":5},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -3581,46 +1252,13 @@ }, { "type": "ExpressionStatement", - "start": 1059, - "end": 1080, - "loc": { - "start": { - "line": 110, - "column": 2 - }, - "end": { - "line": 111, - "column": 8 - } - }, + "start":1059,"end":1080,"loc":{"start":{"line":110,"column":2},"end":{"line":111,"column":8}}, "expression": { "type": "CallExpression", - "start": 1059, - "end": 1079, - "loc": { - "start": { - "line": 110, - "column": 2 - }, - "end": { - "line": 111, - "column": 7 - } - }, + "start":1059,"end":1079,"loc":{"start":{"line":110,"column":2},"end":{"line":111,"column":7}}, "callee": { "type": "StringLiteral", - "start": 1059, - "end": 1071, - "loc": { - "start": { - "line": 110, - "column": 2 - }, - "end": { - "line": 110, - "column": 14 - } - }, + "start":1059,"end":1071,"loc":{"start":{"line":110,"column":2},"end":{"line":110,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -3630,19 +1268,7 @@ "arguments": [ { "type": "Identifier", - "start": 1075, - "end": 1078, - "loc": { - "start": { - "line": 111, - "column": 3 - }, - "end": { - "line": 111, - "column": 6 - }, - "identifierName": "bar" - }, + "start":1075,"end":1078,"loc":{"start":{"line":111,"column":3},"end":{"line":111,"column":6},"identifierName":"bar"}, "name": "bar" } ] @@ -3650,32 +1276,10 @@ }, { "type": "ExpressionStatement", - "start": 1083, - "end": 1088, - "loc": { - "start": { - "line": 112, - "column": 2 - }, - "end": { - "line": 112, - "column": 7 - } - }, + "start":1083,"end":1088,"loc":{"start":{"line":112,"column":2},"end":{"line":112,"column":7}}, "expression": { "type": "StringLiteral", - "start": 1083, - "end": 1087, - "loc": { - "start": { - "line": 112, - "column": 2 - }, - "end": { - "line": 112, - "column": 6 - } - }, + "start":1083,"end":1087,"loc":{"start":{"line":112,"column":2},"end":{"line":112,"column":6}}, "extra": { "rawValue": "\u0005", "raw": "\"\\5\"" @@ -3689,33 +1293,10 @@ }, { "type": "FunctionDeclaration", - "start": 1092, - "end": 1129, - "loc": { - "start": { - "line": 115, - "column": 0 - }, - "end": { - "line": 118, - "column": 1 - } - }, + "start":1092,"end":1129,"loc":{"start":{"line":115,"column":0},"end":{"line":118,"column":1}}, "id": { "type": "Identifier", - "start": 1101, - "end": 1102, - "loc": { - "start": { - "line": 115, - "column": 9 - }, - "end": { - "line": 115, - "column": 10 - }, - "identifierName": "f" - }, + "start":1101,"end":1102,"loc":{"start":{"line":115,"column":9},"end":{"line":115,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -3723,47 +1304,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 1104, - "end": 1129, - "loc": { - "start": { - "line": 115, - "column": 12 - }, - "end": { - "line": 118, - "column": 1 - } - }, + "start":1104,"end":1129,"loc":{"start":{"line":115,"column":12},"end":{"line":118,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 1108, - "end": 1111, - "loc": { - "start": { - "line": 116, - "column": 2 - }, - "end": { - "line": 116, - "column": 5 - } - }, + "start":1108,"end":1111,"loc":{"start":{"line":116,"column":2},"end":{"line":116,"column":5}}, "expression": { "type": "NumericLiteral", - "start": 1108, - "end": 1110, - "loc": { - "start": { - "line": 116, - "column": 2 - }, - "end": { - "line": 116, - "column": 4 - } - }, + "start":1108,"end":1110,"loc":{"start":{"line":116,"column":2},"end":{"line":116,"column":4}}, "extra": { "rawValue": 5, "raw": "05" @@ -3773,32 +1321,10 @@ }, { "type": "ExpressionStatement", - "start": 1114, - "end": 1127, - "loc": { - "start": { - "line": 117, - "column": 2 - }, - "end": { - "line": 117, - "column": 15 - } - }, + "start":1114,"end":1127,"loc":{"start":{"line":117,"column":2},"end":{"line":117,"column":15}}, "expression": { "type": "StringLiteral", - "start": 1114, - "end": 1126, - "loc": { - "start": { - "line": 117, - "column": 2 - }, - "end": { - "line": 117, - "column": 14 - } - }, + "start":1114,"end":1126,"loc":{"start":{"line":117,"column":2},"end":{"line":117,"column":14}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -3817,18 +1343,7 @@ { "type": "CommentLine", "value": " Should not be a syntax error because should not be parsed in strict mode.", - "start": 180, - "end": 256, - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 16, - "column": 76 - } - } + "start":180,"end":256,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":76}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/categorized/regex-after-block/output.json b/packages/babel-parser/test/fixtures/core/categorized/regex-after-block/output.json index 23d47e802b..e1770c6a4c 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/regex-after-block/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/regex-after-block/output.json @@ -1,78 +1,23 @@ { "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "test": { "type": "BooleanLiteral", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "value": true }, "consequent": { "type": "BlockStatement", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":2,"column":1}}, "body": [], "directives": [] }, @@ -80,32 +25,10 @@ }, { "type": "ExpressionStatement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":15,"end":20,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":5}}, "expression": { "type": "RegExpLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":15,"end":20,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":5}}, "extra": { "raw": "/foo/" }, diff --git a/packages/babel-parser/test/fixtures/core/categorized/startline-specified/output.json b/packages/babel-parser/test/fixtures/core/categorized/startline-specified/output.json index 586292ca24..891dfcf410 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/startline-specified/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/startline-specified/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":0,"end":16,"loc":{"start":{"line":3,"column":0},"end":{"line":4,"column":7}}, "program": { "type": "Program", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":0,"end":16,"loc":{"start":{"line":3,"column":0},"end":{"line":4,"column":7}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":0,"end":8,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":8}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":0,"end":7,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":7}}, "callee": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "call" - }, + "start":0,"end":4,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":4},"identifierName":"call"}, "name": "call" }, "arguments": [ { "type": "NumericLiteral", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":5,"end":6,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":6}}, "extra": { "rawValue": 1, "raw": "1" @@ -100,64 +33,19 @@ }, { "type": "ExpressionStatement", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":9,"end":16,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":7}}, "expression": { "type": "CallExpression", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 6 - } - }, + "start":9,"end":15,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":6}}, "callee": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - }, - "identifierName": "run" - }, + "start":9,"end":12,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":3},"identifierName":"run"}, "name": "run" }, "arguments": [ { "type": "NumericLiteral", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":13,"end":14,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":5}}, "extra": { "rawValue": 2, "raw": "2" 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 d0db9dd2f9..1285d54959 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 @@ -1,124 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "MemberExpression", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, "object": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -131,19 +41,7 @@ }, "right": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "t" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"t"}, "name": "t" } } diff --git a/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-2/output.json b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-2/output.json index 96d91c3d80..f4b1a1782c 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-2/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-2/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrayPattern", - "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}}, "elements": [ { "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", "extra": { "parenthesized": true, @@ -98,19 +31,7 @@ }, "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "t" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"t"}, "name": "t" } } diff --git a/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-3/output.json b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-3/output.json index ec252128aa..36a3fb0ada 100644 --- a/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-3/output.json +++ b/packages/babel-parser/test/fixtures/core/categorized/valid-assignment-pattern-3/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x", "extra": { "parenthesized": true, @@ -98,19 +31,7 @@ }, "right": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "t" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"t"}, "name": "t" } } diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-2/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-2/output.json index f30a6c123c..a71d68fda7 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-2/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-2/output.json @@ -1,219 +1,63 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:6)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "operator": "=", "left": { "type": "ArrayPattern", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "elements": [ { "type": "ObjectPattern", - "start": 1, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":1,"end":17,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":17}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":2,"end":16,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "b" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}}, "elements": [ { "type": "ParenthesizedExpression", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "expression": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "AssignmentPattern", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "left": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"a"}, "name": "a" }, "right": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 1, "raw": "1" @@ -233,19 +77,7 @@ }, "right": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "t" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"t"}, "name": "t" } } diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-3/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-3/output.json index 6cd38c81ed..27220d222a 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-3/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-3/output.json @@ -1,204 +1,59 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "ParenthesizedExpression", - "start": 1, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":1,"end":16,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":16}}, "expression": { "type": "ObjectPattern", - "start": 2, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":2,"end":15,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":15}}, "properties": [ { "type": "ObjectProperty", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "AssignmentPattern", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "left": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "b" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"b"}, "name": "b" }, "right": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 2, "raw": "2" @@ -216,19 +71,7 @@ }, "right": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "t" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"t"}, "name": "t" } } diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-4/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-4/output.json index 52e0079979..7f0500a929 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-4/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-4/output.json @@ -1,140 +1,40 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "ParenthesizedExpression", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "expression": { "type": "AssignmentPattern", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "left": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "right": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -147,19 +47,7 @@ }, "right": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "t" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"t"}, "name": "t" } } diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-5/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-5/output.json index 2a57774bc9..bec89d0678 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-5/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-5/output.json @@ -1,125 +1,36 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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": "=", "left": { "type": "ParenthesizedExpression", - "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}}, "expression": { "type": "AssignmentPattern", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, "right": { "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": 1, "raw": "1" @@ -130,19 +41,7 @@ }, "right": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "t" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"t"}, "name": "t" } } diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-6/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-6/output.json index c59930c19e..49fc67ea3f 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-6/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-assignment-pattern-6/output.json @@ -1,110 +1,32 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "ParenthesizedExpression", - "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}}, "expression": { "type": "ArrayPattern", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "elements": [ { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" } ] @@ -112,18 +34,7 @@ }, "right": { "type": "ArrayExpression", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "elements": [] } } 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 fe203d04bc..3d1d927441 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 @@ -1,144 +1,43 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ParenthesizedExpression", - "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}}, "expression": { "type": "ObjectPattern", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "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" }, "extra": { @@ -150,67 +49,22 @@ }, "right": { "type": "ObjectExpression", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}}, "properties": [ { "type": "ObjectProperty", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "method": false, "key": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-left-hand-side/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-left-hand-side/output.json index a6fd50b790..342a51f0b1 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-left-hand-side/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/invalid-parenthesized-left-hand-side/output.json @@ -1,129 +1,40 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in parenthesized expression (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ParenthesizedExpression", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "UnaryExpression", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"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": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" } } }, "right": { "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": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-1/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-1/output.json index 2e4db8c547..c11287a7b2 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-1/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-1/output.json @@ -1,135 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "ParenthesizedExpression", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "expression": { "type": "ParenthesizedExpression", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "expression": { "type": "ParenthesizedExpression", - "start": 3, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":3,"end":6,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":6}}, "expression": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" } } @@ -139,19 +39,7 @@ }, "right": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "t" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"t"}, "name": "t" } } diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-2/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-2/output.json index 19de7b0386..53782f982c 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-2/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-2/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrayPattern", - "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}}, "elements": [ { "type": "ParenthesizedExpression", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "expression": { "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" } } @@ -109,19 +31,7 @@ }, "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "t" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"t"}, "name": "t" } } diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-3/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-3/output.json index a3ddc206db..a655ee4c1f 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-3/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-assignment-array-pattern-3/output.json @@ -1,125 +1,36 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "ParenthesizedExpression", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "expression": { "type": "ArrayPattern", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, "elements": [ { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "x" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"x"}, "name": "x" } ] @@ -129,19 +40,7 @@ }, "right": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "t" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"t"}, "name": "t" } } 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 689a18f803..1318e397e3 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 @@ -1,138 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "ParenthesizedExpression", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "expression": { "type": "MemberExpression", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, "object": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "computed": false @@ -142,19 +41,7 @@ }, "right": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "t" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"t"}, "name": "t" } } diff --git a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-expression/output.json b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-expression/output.json index b1f49f00e9..c765cfd25e 100644 --- a/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-expression/output.json +++ b/packages/babel-parser/test/fixtures/core/create-parenthesized-expressions/valid-parenthesized-expression/output.json @@ -1,76 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ParenthesizedExpression", - "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}}, "expression": { "type": "StringLiteral", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "extra": { "rawValue": "hello", "raw": "\"hello\"" diff --git a/packages/babel-parser/test/fixtures/core/escape-keyword/async/output.json b/packages/babel-parser/test/fixtures/core/escape-keyword/async/output.json index e220d3207f..fb945ca37c 100644 --- a/packages/babel-parser/test/fixtures/core/escape-keyword/async/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-keyword/async/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":1,"end":14,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":14}}, "callee": { "type": "Identifier", - "start": 1, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "async" - }, + "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11},"identifierName":"async"}, "name": "async" }, "arguments": [], 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 742ca4b457..20ba00fd6d 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 @@ -1,147 +1,45 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ "SyntaxError: Unexpected keyword 'break' (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": { "type": "ObjectExpression", - "start": 8, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":24,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "properties": [ { "type": "ObjectProperty", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "break" - }, + "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12},"identifierName":"break"}, "name": "break" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "break" - }, + "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12},"identifierName":"break"}, "name": "break" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/core/escape-keyword/used-as-property/output.json b/packages/babel-parser/test/fixtures/core/escape-keyword/used-as-property/output.json index 894aebee85..945e5d3ad1 100644 --- a/packages/babel-parser/test/fixtures/core/escape-keyword/used-as-property/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-keyword/used-as-property/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": { "type": "ObjectExpression", - "start": 8, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":27,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "properties": [ { "type": "ObjectProperty", - "start": 12, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":12,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "method": false, "key": { "type": "Identifier", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "break" - }, + "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12},"identifierName":"break"}, "name": "break" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/output.json b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/output.json index 20b84ecf03..97c5ce5eb3 100644 --- a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-eight/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "value": { "raw": "\\8", "cooked": null diff --git a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/output.json b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/output.json index 9e0985f69a..98905e40ab 100644 --- a/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/output.json +++ b/packages/babel-parser/test/fixtures/core/escape-template/non-octal-nine/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "value": { "raw": "\\9", "cooked": null 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 6f4e90ee1d..a3fd8b4143 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 @@ -1,157 +1,45 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":1,"end":25,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":25}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 1, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":1,"end":20,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":2,"end":8,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":8}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 2, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":2,"end":8,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":8}}, "left": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "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" @@ -165,84 +53,26 @@ }, { "type": "ObjectProperty", - "start": 10, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "b" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "MemberExpression", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}}, "object": { "type": "Identifier", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "test" - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17},"identifierName":"test"}, "name": "test" }, "property": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "d" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"d"}, "name": "d" }, "computed": false @@ -252,18 +82,7 @@ }, "right": { "type": "ObjectExpression", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "properties": [] }, "extra": { 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 9da6d1356b..11c1977bfa 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 @@ -1,157 +1,45 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":1,"end":23,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":23}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 1, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":1,"end":18,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":18}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":2,"end":8,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":8}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 2, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":2,"end":8,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":8}}, "left": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "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" @@ -165,83 +53,26 @@ }, { "type": "ObjectProperty", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "b" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "MemberExpression", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17}}, "object": { "type": "ObjectExpression", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "properties": [] }, "property": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "d" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"d"}, "name": "d" }, "computed": false @@ -251,18 +82,7 @@ }, "right": { "type": "ObjectExpression", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "properties": [] }, "extra": { diff --git a/packages/babel-parser/test/fixtures/core/object/valid-property-initializer/output.json b/packages/babel-parser/test/fixtures/core/object/valid-property-initializer/output.json index 7b1a47d91e..00cb9573c0 100644 --- a/packages/babel-parser/test/fixtures/core/object/valid-property-initializer/output.json +++ b/packages/babel-parser/test/fixtures/core/object/valid-property-initializer/output.json @@ -1,189 +1,54 @@ { "type": "File", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 4, - "column": 24 - } - }, + "start":6,"end":67,"loc":{"start":{"line":1,"column":6},"end":{"line":4,"column":24}}, "id": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "obj" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"obj"}, "name": "obj" }, "init": { "type": "AssignmentExpression", - "start": 12, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 4, - "column": 24 - } - }, + "start":12,"end":67,"loc":{"start":{"line":1,"column":12},"end":{"line":4,"column":24}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 12, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":12,"end":44,"loc":{"start":{"line":1,"column":12},"end":{"line":4,"column":1}}, "properties": [ { "type": "ObjectProperty", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":16,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}}, "method": false, "key": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "foo" - }, + "start":16,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":16,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}}, "left": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "foo" - }, + "start":16,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "NumericLiteral", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11}}, "extra": { "rawValue": 123, "raw": "123" @@ -197,83 +62,26 @@ }, { "type": "ObjectProperty", - "start": 29, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":29,"end":41,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "bar" - }, + "start":29,"end":32,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5},"identifierName":"bar"}, "name": "bar" }, "computed": false, "shorthand": false, "value": { "type": "AssignmentPattern", - "start": 34, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":34,"end":41,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":14}}, "left": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 38, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":38,"end":41,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":14}}, "extra": { "rawValue": 123, "raw": "123" @@ -289,67 +97,22 @@ }, "right": { "type": "ObjectExpression", - "start": 47, - "end": 67, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 24 - } - }, + "start":47,"end":67,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":24}}, "properties": [ { "type": "ObjectProperty", - "start": 49, - "end": 56, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":49,"end":56,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":13}}, "method": false, "key": { "type": "Identifier", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 9 - }, - "identifierName": "foo" - }, + "start":49,"end":52,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":9},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 54, - "end": 56, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":54,"end":56,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":13}}, "extra": { "rawValue": 24, "raw": "24" @@ -359,52 +122,18 @@ }, { "type": "ObjectProperty", - "start": 58, - "end": 65, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 22 - } - }, + "start":58,"end":65,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":22}}, "method": false, "key": { "type": "Identifier", - "start": 58, - "end": 61, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 18 - }, - "identifierName": "bar" - }, + "start":58,"end":61,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":18},"identifierName":"bar"}, "name": "bar" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 63, - "end": 65, - "loc": { - "start": { - "line": 4, - "column": 20 - }, - "end": { - "line": 4, - "column": 22 - } - }, + "start":63,"end":65,"loc":{"start":{"line":4,"column":20},"end":{"line":4,"column":22}}, "extra": { "rawValue": 45, "raw": "45" diff --git a/packages/babel-parser/test/fixtures/core/opts/allowAwaitOutsideFunction-true/output.json b/packages/babel-parser/test/fixtures/core/opts/allowAwaitOutsideFunction-true/output.json index 259b3ffcf4..b127e47016 100644 --- a/packages/babel-parser/test/fixtures/core/opts/allowAwaitOutsideFunction-true/output.json +++ b/packages/babel-parser/test/fixtures/core/opts/allowAwaitOutsideFunction-true/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "await": true, "left": { "type": "VariableDeclaration", - "start": 11, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "i" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"i"}, "name": "i" }, "init": null @@ -97,35 +30,12 @@ }, "right": { "type": "Identifier", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "imports" - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"imports"}, "name": "imports" }, "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/opts/allowUndeclaredExports/output.json b/packages/babel-parser/test/fixtures/core/opts/allowUndeclaredExports/output.json index a454ef5bbd..6cafe7e41c 100644 --- a/packages/babel-parser/test/fixtures/core/opts/allowUndeclaredExports/output.json +++ b/packages/babel-parser/test/fixtures/core/opts/allowUndeclaredExports/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "local": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "exported": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" } } diff --git a/packages/babel-parser/test/fixtures/core/opts/ranges-false/output.json b/packages/babel-parser/test/fixtures/core/opts/ranges-false/output.json index 74684515dd..eb51e1bb04 100644 --- a/packages/babel-parser/test/fixtures/core/opts/ranges-false/output.json +++ b/packages/babel-parser/test/fixtures/core/opts/ranges-false/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":14}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": { "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": 1, "raw": "1" @@ -101,96 +34,28 @@ }, { "type": "VariableDeclaration", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":12,"end":26,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":16,"end":25,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13}}, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "b" - }, + "start":16,"end":17,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"b"}, "name": "b" }, "init": { "type": "BinaryExpression", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":20,"end":25,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":13}}, "left": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "a" - }, + "start":20,"end":21,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9},"identifierName":"a"}, "name": "a" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":24,"end":25,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/opts/ranges-true/output.json b/packages/babel-parser/test/fixtures/core/opts/ranges-true/output.json index 3983b0f199..9442328131 100644 --- a/packages/babel-parser/test/fixtures/core/opts/ranges-true/output.json +++ b/packages/babel-parser/test/fixtures/core/opts/ranges-true/output.json @@ -1,35 +1,13 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":14}}, "range": [ 0, 26 ], "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":14}}, "range": [ 0, 26 @@ -39,18 +17,7 @@ "body": [ { "type": "VariableDeclaration", - "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}}, "range": [ 0, 10 @@ -58,37 +25,14 @@ "declarations": [ { "type": "VariableDeclarator", - "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}}, "range": [ 4, 9 ], "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "range": [ 4, 5 @@ -97,18 +41,7 @@ }, "init": { "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}}, "range": [ 8, 9 @@ -125,18 +58,7 @@ }, { "type": "VariableDeclaration", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":12,"end":26,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":14}}, "range": [ 12, 26 @@ -144,37 +66,14 @@ "declarations": [ { "type": "VariableDeclarator", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":16,"end":25,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13}}, "range": [ 16, 25 ], "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "b" - }, + "start":16,"end":17,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"b"}, "range": [ 16, 17 @@ -183,37 +82,14 @@ }, "init": { "type": "BinaryExpression", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":20,"end":25,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":13}}, "range": [ 20, 25 ], "left": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "a" - }, + "start":20,"end":21,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9},"identifierName":"a"}, "range": [ 20, 21 @@ -223,18 +99,7 @@ "operator": "+", "right": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":24,"end":25,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}}, "range": [ 24, 25 diff --git a/packages/babel-parser/test/fixtures/core/opts/tokens-false/output.json b/packages/babel-parser/test/fixtures/core/opts/tokens-false/output.json index 74684515dd..eb51e1bb04 100644 --- a/packages/babel-parser/test/fixtures/core/opts/tokens-false/output.json +++ b/packages/babel-parser/test/fixtures/core/opts/tokens-false/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":14}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": { "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": 1, "raw": "1" @@ -101,96 +34,28 @@ }, { "type": "VariableDeclaration", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":12,"end":26,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":16,"end":25,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13}}, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "b" - }, + "start":16,"end":17,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"b"}, "name": "b" }, "init": { "type": "BinaryExpression", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":20,"end":25,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":13}}, "left": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "a" - }, + "start":20,"end":21,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9},"identifierName":"a"}, "name": "a" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":24,"end":25,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/opts/tokens-true/output.json b/packages/babel-parser/test/fixtures/core/opts/tokens-true/output.json index 47117344de..5c0640afff 100644 --- a/packages/babel-parser/test/fixtures/core/opts/tokens-true/output.json +++ b/packages/babel-parser/test/fixtures/core/opts/tokens-true/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":14}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": { "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": 1, "raw": "1" @@ -101,96 +34,28 @@ }, { "type": "VariableDeclaration", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":12,"end":26,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":16,"end":25,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13}}, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "b" - }, + "start":16,"end":17,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"b"}, "name": "b" }, "init": { "type": "BinaryExpression", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":20,"end":25,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":13}}, "left": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "a" - }, + "start":20,"end":21,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9},"identifierName":"a"}, "name": "a" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":24,"end":25,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}}, "extra": { "rawValue": 1, "raw": "1" @@ -221,18 +86,7 @@ "updateContext": null }, "value": "var", - "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}} }, { "type": { @@ -247,18 +101,7 @@ "binop": null }, "value": "a", - "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}} }, { "type": { @@ -274,18 +117,7 @@ "updateContext": null }, "value": "=", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} }, { "type": { @@ -301,18 +133,7 @@ "updateContext": null }, "value": 1, - "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}} }, { "type": { @@ -327,18 +148,7 @@ "binop": null, "updateContext": null }, - "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}} }, { "type": { @@ -355,18 +165,7 @@ "updateContext": null }, "value": "var", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - } + "start":12,"end":15,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3}} }, { "type": { @@ -381,18 +180,7 @@ "binop": null }, "value": "b", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - } - } + "start":16,"end":17,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5}} }, { "type": { @@ -408,18 +196,7 @@ "updateContext": null }, "value": "=", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - } - } + "start":18,"end":19,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7}} }, { "type": { @@ -434,18 +211,7 @@ "binop": null }, "value": "a", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - } - } + "start":20,"end":21,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9}} }, { "type": { @@ -461,18 +227,7 @@ "updateContext": null }, "value": "+", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - } - } + "start":22,"end":23,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11}} }, { "type": { @@ -488,18 +243,7 @@ "updateContext": null }, "value": 1, - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":24,"end":25,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}} }, { "type": { @@ -514,18 +258,7 @@ "binop": null, "updateContext": null }, - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 14 - } - } + "start":25,"end":26,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":14}} }, { "type": { @@ -540,18 +273,7 @@ "binop": null, "updateContext": null }, - "start": 26, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 14 - } - } + "start":26,"end":26,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":14}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/regression/2591/output.json b/packages/babel-parser/test/fixtures/core/regression/2591/output.json index 2f34027dcd..270017fdd9 100644 --- a/packages/babel-parser/test/fixtures/core/regression/2591/output.json +++ b/packages/babel-parser/test/fixtures/core/regression/2591/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -65,63 +20,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":13,"end":33,"loc":{"start":{"line":1,"column":13},"end":{"line":4,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":17,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7}}, "declarations": [ { "type": "VariableDeclarator", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"x"}, "name": "x" }, "init": null @@ -131,32 +41,10 @@ }, { "type": "ExpressionStatement", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":25,"end":31,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8}}, "expression": { "type": "RegExpLiteral", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":25,"end":30,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":7}}, "extra": { "raw": "/wow/" }, diff --git a/packages/babel-parser/test/fixtures/core/regression/9374/output.json b/packages/babel-parser/test/fixtures/core/regression/9374/output.json index c32f37d64b..75e686beb7 100644 --- a/packages/babel-parser/test/fixtures/core/regression/9374/output.json +++ b/packages/babel-parser/test/fixtures/core/regression/9374/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "test" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"test"}, "name": "test" }, "generator": true, @@ -65,77 +20,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":17,"end":39,"loc":{"start":{"line":1,"column":17},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 21, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":21,"end":37,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, "expression": { "type": "YieldExpression", - "start": 21, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":21,"end":36,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}}, "delegate": false, "argument": { "type": "NewExpression", - "start": 27, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":27,"end":36,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":17}}, "callee": { "type": "Identifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "Foo" - }, + "start":31,"end":34,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15},"identifierName":"Foo"}, "name": "Foo" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive-function/output.json b/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive-function/output.json index 2aa1a971de..2eeced4be9 100644 --- a/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive-function/output.json +++ b/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive-function/output.json @@ -1,17 +1,6 @@ { "type": "File", - "start": 0, - "end": 268, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 32, - "column": 1 - } - }, + "start":0,"end":268,"loc":{"start":{"line":1,"column":0},"end":{"line":32,"column":1}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (2:4)", "SyntaxError: Legacy octal literals are not allowed in strict mode (7:4)", @@ -25,50 +14,16 @@ ], "program": { "type": "Program", - "start": 0, - "end": 268, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 32, - "column": 1 - } - }, + "start":0,"end":268,"loc":{"start":{"line":1,"column":0},"end":{"line":32,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -76,48 +31,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":13,"end":40,"loc":{"start":{"line":1,"column":13},"end":{"line":4,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":17,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7}}, "value": { "type": "DirectiveLiteral", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":17,"end":21,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "value": "\\5", "extra": { "raw": "\"\\5\"", @@ -127,32 +49,10 @@ }, { "type": "Directive", - "start": 25, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":25,"end":38,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":25,"end":37,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "value": "use strict", "extra": { "raw": "\"use strict\"", @@ -165,33 +65,10 @@ }, { "type": "FunctionDeclaration", - "start": 42, - "end": 90, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":42,"end":90,"loc":{"start":{"line":6,"column":0},"end":{"line":10,"column":1}}, "id": { "type": "Identifier", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 10 - }, - "identifierName": "b" - }, + "start":51,"end":52,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":10},"identifierName":"b"}, "name": "b" }, "generator": false, @@ -199,48 +76,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 55, - "end": 90, - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":55,"end":90,"loc":{"start":{"line":6,"column":13},"end":{"line":10,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 59, - "end": 64, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 7 - } - }, + "start":59,"end":64,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":7}}, "value": { "type": "DirectiveLiteral", - "start": 59, - "end": 63, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 6 - } - }, + "start":59,"end":63,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":6}}, "value": "\\4", "extra": { "raw": "\"\\4\"", @@ -250,32 +94,10 @@ }, { "type": "Directive", - "start": 67, - "end": 72, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 7 - } - }, + "start":67,"end":72,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":7}}, "value": { "type": "DirectiveLiteral", - "start": 67, - "end": 71, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 6 - } - }, + "start":67,"end":71,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":6}}, "value": "\\5", "extra": { "raw": "\"\\5\"", @@ -285,32 +107,10 @@ }, { "type": "Directive", - "start": 75, - "end": 88, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 15 - } - }, + "start":75,"end":88,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 75, - "end": 87, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 14 - } - }, + "start":75,"end":87,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":14}}, "value": "use strict", "extra": { "raw": "\"use strict\"", @@ -323,33 +123,10 @@ }, { "type": "FunctionDeclaration", - "start": 92, - "end": 132, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 15, - "column": 1 - } - }, + "start":92,"end":132,"loc":{"start":{"line":12,"column":0},"end":{"line":15,"column":1}}, "id": { "type": "Identifier", - "start": 101, - "end": 102, - "loc": { - "start": { - "line": 12, - "column": 9 - }, - "end": { - "line": 12, - "column": 10 - }, - "identifierName": "c" - }, + "start":101,"end":102,"loc":{"start":{"line":12,"column":9},"end":{"line":12,"column":10},"identifierName":"c"}, "name": "c" }, "generator": false, @@ -357,48 +134,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 105, - "end": 132, - "loc": { - "start": { - "line": 12, - "column": 13 - }, - "end": { - "line": 15, - "column": 1 - } - }, + "start":105,"end":132,"loc":{"start":{"line":12,"column":13},"end":{"line":15,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 109, - "end": 122, - "loc": { - "start": { - "line": 13, - "column": 2 - }, - "end": { - "line": 13, - "column": 15 - } - }, + "start":109,"end":122,"loc":{"start":{"line":13,"column":2},"end":{"line":13,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 109, - "end": 121, - "loc": { - "start": { - "line": 13, - "column": 2 - }, - "end": { - "line": 13, - "column": 14 - } - }, + "start":109,"end":121,"loc":{"start":{"line":13,"column":2},"end":{"line":13,"column":14}}, "value": "use strict", "extra": { "raw": "\"use strict\"", @@ -408,32 +152,10 @@ }, { "type": "Directive", - "start": 125, - "end": 130, - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 7 - } - }, + "start":125,"end":130,"loc":{"start":{"line":14,"column":2},"end":{"line":14,"column":7}}, "value": { "type": "DirectiveLiteral", - "start": 125, - "end": 129, - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 6 - } - }, + "start":125,"end":129,"loc":{"start":{"line":14,"column":2},"end":{"line":14,"column":6}}, "value": "\\5", "extra": { "raw": "\"\\5\"", @@ -446,33 +168,10 @@ }, { "type": "FunctionDeclaration", - "start": 134, - "end": 182, - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 21, - "column": 1 - } - }, + "start":134,"end":182,"loc":{"start":{"line":17,"column":0},"end":{"line":21,"column":1}}, "id": { "type": "Identifier", - "start": 143, - "end": 144, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 10 - }, - "identifierName": "d" - }, + "start":143,"end":144,"loc":{"start":{"line":17,"column":9},"end":{"line":17,"column":10},"identifierName":"d"}, "name": "d" }, "generator": false, @@ -480,48 +179,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 147, - "end": 182, - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 21, - "column": 1 - } - }, + "start":147,"end":182,"loc":{"start":{"line":17,"column":13},"end":{"line":21,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 151, - "end": 164, - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 15 - } - }, + "start":151,"end":164,"loc":{"start":{"line":18,"column":2},"end":{"line":18,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 151, - "end": 163, - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 14 - } - }, + "start":151,"end":163,"loc":{"start":{"line":18,"column":2},"end":{"line":18,"column":14}}, "value": "use strict", "extra": { "raw": "\"use strict\"", @@ -531,32 +197,10 @@ }, { "type": "Directive", - "start": 167, - "end": 172, - "loc": { - "start": { - "line": 19, - "column": 2 - }, - "end": { - "line": 19, - "column": 7 - } - }, + "start":167,"end":172,"loc":{"start":{"line":19,"column":2},"end":{"line":19,"column":7}}, "value": { "type": "DirectiveLiteral", - "start": 167, - "end": 171, - "loc": { - "start": { - "line": 19, - "column": 2 - }, - "end": { - "line": 19, - "column": 6 - } - }, + "start":167,"end":171,"loc":{"start":{"line":19,"column":2},"end":{"line":19,"column":6}}, "value": "\\4", "extra": { "raw": "\"\\4\"", @@ -566,32 +210,10 @@ }, { "type": "Directive", - "start": 175, - "end": 180, - "loc": { - "start": { - "line": 20, - "column": 2 - }, - "end": { - "line": 20, - "column": 7 - } - }, + "start":175,"end":180,"loc":{"start":{"line":20,"column":2},"end":{"line":20,"column":7}}, "value": { "type": "DirectiveLiteral", - "start": 175, - "end": 179, - "loc": { - "start": { - "line": 20, - "column": 2 - }, - "end": { - "line": 20, - "column": 6 - } - }, + "start":175,"end":179,"loc":{"start":{"line":20,"column":2},"end":{"line":20,"column":6}}, "value": "\\5", "extra": { "raw": "\"\\5\"", @@ -604,33 +226,10 @@ }, { "type": "FunctionDeclaration", - "start": 184, - "end": 222, - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 26, - "column": 1 - } - }, + "start":184,"end":222,"loc":{"start":{"line":23,"column":0},"end":{"line":26,"column":1}}, "id": { "type": "Identifier", - "start": 193, - "end": 194, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 10 - }, - "identifierName": "c" - }, + "start":193,"end":194,"loc":{"start":{"line":23,"column":9},"end":{"line":23,"column":10},"identifierName":"c"}, "name": "c" }, "generator": false, @@ -638,47 +237,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 197, - "end": 222, - "loc": { - "start": { - "line": 23, - "column": 13 - }, - "end": { - "line": 26, - "column": 1 - } - }, + "start":197,"end":222,"loc":{"start":{"line":23,"column":13},"end":{"line":26,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 217, - "end": 220, - "loc": { - "start": { - "line": 25, - "column": 2 - }, - "end": { - "line": 25, - "column": 5 - } - }, + "start":217,"end":220,"loc":{"start":{"line":25,"column":2},"end":{"line":25,"column":5}}, "expression": { "type": "NumericLiteral", - "start": 217, - "end": 219, - "loc": { - "start": { - "line": 25, - "column": 2 - }, - "end": { - "line": 25, - "column": 4 - } - }, + "start":217,"end":219,"loc":{"start":{"line":25,"column":2},"end":{"line":25,"column":4}}, "extra": { "rawValue": 5, "raw": "05" @@ -690,32 +256,10 @@ "directives": [ { "type": "Directive", - "start": 201, - "end": 214, - "loc": { - "start": { - "line": 24, - "column": 2 - }, - "end": { - "line": 24, - "column": 15 - } - }, + "start":201,"end":214,"loc":{"start":{"line":24,"column":2},"end":{"line":24,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 201, - "end": 213, - "loc": { - "start": { - "line": 24, - "column": 2 - }, - "end": { - "line": 24, - "column": 14 - } - }, + "start":201,"end":213,"loc":{"start":{"line":24,"column":2},"end":{"line":24,"column":14}}, "value": "use strict", "extra": { "raw": "\"use strict\"", @@ -728,33 +272,10 @@ }, { "type": "FunctionDeclaration", - "start": 224, - "end": 268, - "loc": { - "start": { - "line": 28, - "column": 0 - }, - "end": { - "line": 32, - "column": 1 - } - }, + "start":224,"end":268,"loc":{"start":{"line":28,"column":0},"end":{"line":32,"column":1}}, "id": { "type": "Identifier", - "start": 233, - "end": 234, - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 10 - }, - "identifierName": "d" - }, + "start":233,"end":234,"loc":{"start":{"line":28,"column":9},"end":{"line":28,"column":10},"identifierName":"d"}, "name": "d" }, "generator": false, @@ -762,47 +283,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 237, - "end": 268, - "loc": { - "start": { - "line": 28, - "column": 13 - }, - "end": { - "line": 32, - "column": 1 - } - }, + "start":237,"end":268,"loc":{"start":{"line":28,"column":13},"end":{"line":32,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 257, - "end": 260, - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 30, - "column": 5 - } - }, + "start":257,"end":260,"loc":{"start":{"line":30,"column":2},"end":{"line":30,"column":5}}, "expression": { "type": "NumericLiteral", - "start": 257, - "end": 259, - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 30, - "column": 4 - } - }, + "start":257,"end":259,"loc":{"start":{"line":30,"column":2},"end":{"line":30,"column":4}}, "extra": { "rawValue": 4, "raw": "04" @@ -812,32 +300,10 @@ }, { "type": "ExpressionStatement", - "start": 263, - "end": 266, - "loc": { - "start": { - "line": 31, - "column": 2 - }, - "end": { - "line": 31, - "column": 5 - } - }, + "start":263,"end":266,"loc":{"start":{"line":31,"column":2},"end":{"line":31,"column":5}}, "expression": { "type": "NumericLiteral", - "start": 263, - "end": 265, - "loc": { - "start": { - "line": 31, - "column": 2 - }, - "end": { - "line": 31, - "column": 4 - } - }, + "start":263,"end":265,"loc":{"start":{"line":31,"column":2},"end":{"line":31,"column":4}}, "extra": { "rawValue": 5, "raw": "05" @@ -849,32 +315,10 @@ "directives": [ { "type": "Directive", - "start": 241, - "end": 254, - "loc": { - "start": { - "line": 29, - "column": 2 - }, - "end": { - "line": 29, - "column": 15 - } - }, + "start":241,"end":254,"loc":{"start":{"line":29,"column":2},"end":{"line":29,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 241, - "end": 253, - "loc": { - "start": { - "line": 29, - "column": 2 - }, - "end": { - "line": 29, - "column": 14 - } - }, + "start":241,"end":253,"loc":{"start":{"line":29,"column":2},"end":{"line":29,"column":14}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive/output.json b/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive/output.json index 136553fe54..f4d5ed2941 100644 --- a/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive/output.json +++ b/packages/babel-parser/test/fixtures/core/regression/invalid-octal-strict-directive/output.json @@ -1,17 +1,6 @@ { "type": "File", - "start": 0, - "end": 96, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 14, - "column": 22 - } - }, + "start":0,"end":96,"loc":{"start":{"line":1,"column":0},"end":{"line":14,"column":22}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (8:2)", "SyntaxError: Legacy octal literals are not allowed in strict mode (9:2)", @@ -28,49 +17,16 @@ ], "program": { "type": "Program", - "start": 0, - "end": 96, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 14, - "column": 22 - } - }, + "start":0,"end":96,"loc":{"start":{"line":1,"column":0},"end":{"line":14,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 65, - "end": 68, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 3 - } - }, + "start":65,"end":68,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":3}}, "expression": { "type": "NumericLiteral", - "start": 65, - "end": 67, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 2 - } - }, + "start":65,"end":67,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":2}}, "extra": { "rawValue": 4, "raw": "04" @@ -80,32 +36,10 @@ }, { "type": "ExpressionStatement", - "start": 69, - "end": 72, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 3 - } - }, + "start":69,"end":72,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":3}}, "expression": { "type": "NumericLiteral", - "start": 69, - "end": 71, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 2 - } - }, + "start":69,"end":71,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":2}}, "extra": { "rawValue": 5, "raw": "05" @@ -115,32 +49,10 @@ }, { "type": "ExpressionStatement", - "start": 74, - "end": 96, - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 22 - } - }, + "start":74,"end":96,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":22}}, "expression": { "type": "StringLiteral", - "start": 74, - "end": 95, - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 21 - } - }, + "start":74,"end":95,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":21}}, "extra": { "rawValue": "\u0004 foo \u0005 bar \u0006", "raw": "\"\\04 foo \\05 bar \\06\"" @@ -152,32 +64,10 @@ "directives": [ { "type": "Directive", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\01 foo \\02 bar \\03", "extra": { "raw": "\"\\01 foo \\02 bar \\03\"", @@ -187,32 +77,10 @@ }, { "type": "Directive", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":24,"end":29,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":5}}, "value": { "type": "DirectiveLiteral", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":24,"end":28,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":4}}, "value": "\\4", "extra": { "raw": "\"\\4\"", @@ -222,32 +90,10 @@ }, { "type": "Directive", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":30,"end":35,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":5}}, "value": { "type": "DirectiveLiteral", - "start": 30, - "end": 34, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 4 - } - }, + "start":30,"end":34,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":4}}, "value": "\\5", "extra": { "raw": "\"\\5\"", @@ -257,32 +103,10 @@ }, { "type": "Directive", - "start": 37, - "end": 50, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 13 - } - }, + "start":37,"end":50,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":13}}, "value": { "type": "DirectiveLiteral", - "start": 37, - "end": 49, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 12 - } - }, + "start":37,"end":49,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":12}}, "value": "use strict", "extra": { "raw": "\"use strict\"", @@ -292,32 +116,10 @@ }, { "type": "Directive", - "start": 52, - "end": 57, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 5 - } - }, + "start":52,"end":57,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":5}}, "value": { "type": "DirectiveLiteral", - "start": 52, - "end": 56, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 4 - } - }, + "start":52,"end":56,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":4}}, "value": "\\4", "extra": { "raw": "\"\\4\"", @@ -327,32 +129,10 @@ }, { "type": "Directive", - "start": 58, - "end": 63, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 5 - } - }, + "start":58,"end":63,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":5}}, "value": { "type": "DirectiveLiteral", - "start": 58, - "end": 62, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 4 - } - }, + "start":58,"end":62,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":4}}, "value": "\\5", "extra": { "raw": "\"\\5\"", diff --git a/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/output.json b/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/output.json index 99253558c8..7cc466fa1d 100644 --- a/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/output.json +++ b/packages/babel-parser/test/fixtures/core/regression/non-octal-float-strict-mode/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 9.5, "raw": "09.5" diff --git a/packages/babel-parser/test/fixtures/core/regression/non-octal-float/output.json b/packages/babel-parser/test/fixtures/core/regression/non-octal-float/output.json index f48f7a7867..922adbe946 100644 --- a/packages/babel-parser/test/fixtures/core/regression/non-octal-float/output.json +++ b/packages/babel-parser/test/fixtures/core/regression/non-octal-float/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 9.5, "raw": "09.5" diff --git a/packages/babel-parser/test/fixtures/core/regression/use-strict-with-pre-semi/output.json b/packages/babel-parser/test/fixtures/core/regression/use-strict-with-pre-semi/output.json index 694c18f640..3b6ea25634 100644 --- a/packages/babel-parser/test/fixtures/core/regression/use-strict-with-pre-semi/output.json +++ b/packages/babel-parser/test/fixtures/core/regression/use-strict-with-pre-semi/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -65,128 +20,39 @@ "params": [ { "type": "AssignmentPattern", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "left": { "type": "ArrayPattern", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15}}, "elements": [ { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a" } ] }, "right": { "type": "ArrayExpression", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "elements": [] } } ], "body": { "type": "BlockStatement", - "start": 22, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":22,"end":55,"loc":{"start":{"line":1,"column":22},"end":{"line":3,"column":1}}, "body": [ { "type": "EmptyStatement", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 2 - } - } + "start":25,"end":26,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":2}} }, { "type": "ExpressionStatement", - "start": 27, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":27,"end":40,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":16}}, "expression": { "type": "StringLiteral", - "start": 27, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":27,"end":39,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":15}}, "extra": { "rawValue": "use strict", "raw": "'use strict'" @@ -196,48 +62,15 @@ }, { "type": "WithStatement", - "start": 41, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":41,"end":53,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":29}}, "object": { "type": "ObjectExpression", - "start": 47, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":47,"end":49,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":25}}, "properties": [] }, "body": { "type": "BlockStatement", - "start": 51, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":51,"end":53,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/output.json index f017f0fa5f..bf01e24b49 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex-nested/output.json @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (4:6)" ], "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 4, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":4,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":8,"end":11,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "bar" - }, + "start":8,"end":11,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"bar"}, "name": "bar" }, "init": null @@ -100,64 +33,19 @@ }, { "type": "VariableDeclaration", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":15,"end":27,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":19,"end":26,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":13}}, "id": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "foo" - }, + "start":19,"end":22,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":25,"end":26,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}}, "extra": { "rawValue": 1, "raw": "1" @@ -170,64 +58,19 @@ }, { "type": "VariableDeclaration", - "start": 30, - "end": 42, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":30,"end":42,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 34, - "end": 41, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":34,"end":41,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":13}}, "id": { "type": "Identifier", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 9 - }, - "identifierName": "foo" - }, + "start":34,"end":37,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":9},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":40,"end":41,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":13}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/output.json index 758528386e..dd515037db 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-lex/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":12}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (3:4)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "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" }, "init": null @@ -85,64 +29,19 @@ }, { "type": "VariableDeclaration", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":9,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":13,"end":20,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, "extra": { "rawValue": 1, "raw": "1" @@ -155,64 +54,19 @@ }, { "type": "VariableDeclaration", - "start": 22, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":22,"end":34,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":26,"end":33,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "foo" - }, + "start":26,"end":29,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":32,"end":33,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/output.json index 0444f665d3..26e7aee9b7 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var-nested/output.json @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (4:6)" ], "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 4, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":4,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":8,"end":11,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "bar" - }, + "start":8,"end":11,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"bar"}, "name": "bar" }, "init": null @@ -100,64 +33,19 @@ }, { "type": "VariableDeclaration", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":15,"end":27,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":19,"end":26,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":13}}, "id": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "foo" - }, + "start":19,"end":22,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":25,"end":26,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}}, "extra": { "rawValue": 1, "raw": "1" @@ -170,64 +58,19 @@ }, { "type": "VariableDeclaration", - "start": 30, - "end": 42, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":30,"end":42,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 34, - "end": 41, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":34,"end":41,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":13}}, "id": { "type": "Identifier", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 9 - }, - "identifierName": "foo" - }, + "start":34,"end":37,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":9},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":40,"end":41,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":13}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/output.json index 76f48823dd..9d5f366077 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-2nd-lvl-var/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":12}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (3:4)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "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" }, "init": null @@ -85,64 +29,19 @@ }, { "type": "VariableDeclaration", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":9,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":13,"end":20,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, "extra": { "rawValue": 1, "raw": "1" @@ -155,64 +54,19 @@ }, { "type": "VariableDeclaration", - "start": 22, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":22,"end":34,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":26,"end":33,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "foo" - }, + "start":26,"end":29,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":32,"end":33,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/output.json index 8994126455..294f5fbc9c 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-arr-destr/output.json @@ -1,147 +1,46 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:15)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":2,"column":1}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":1}}, "param": { "type": "ArrayPattern", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":15,"end":25,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":19}}, "elements": [ { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "foo" - }, + "start":16,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13},"identifierName":"foo"}, "name": "foo" }, { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "foo" - }, + "start":21,"end":24,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" } ] }, "body": { "type": "BlockStatement", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":27,"end":30,"loc":{"start":{"line":2,"column":21},"end":{"line":3,"column":1}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/output.json index cddf0493cb..532647600b 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-dbl-let/output.json @@ -1,81 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (1:35)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "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" }, "init": null @@ -85,80 +29,24 @@ }, { "type": "TryStatement", - "start": 9, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":9,"end":30,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":30}}, "block": { "type": "BlockStatement", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 16, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":16,"end":30,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":30}}, "param": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "foo" - }, + "start":23,"end":26,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":26},"identifierName":"foo"}, "name": "foo" }, "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "body": [], "directives": [] } @@ -167,48 +55,14 @@ }, { "type": "VariableDeclaration", - "start": 31, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":31,"end":39,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":39}}, "declarations": [ { "type": "VariableDeclarator", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":35,"end":38,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":38}}, "id": { "type": "Identifier", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "foo" - }, + "start":35,"end":38,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":38},"identifierName":"foo"}, "name": "foo" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/output.json index ab1db27cf0..680f522586 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-func/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (3:11)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":2,"column":1}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":43,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":1}}, "param": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"foo"}, "name": "foo" }, "body": { "type": "BlockStatement", - "start": 20, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":20,"end":43,"loc":{"start":{"line":2,"column":14},"end":{"line":4,"column":1}}, "body": [ { "type": "FunctionDeclaration", - "start": 24, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":24,"end":41,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":19}}, "id": { "type": "Identifier", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 14 - }, - "identifierName": "foo" - }, + "start":33,"end":36,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":14},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -145,18 +44,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":39,"end":41,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-hang-func/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-hang-func/output.json index a465e0c09f..814efb6b13 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-hang-func/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-hang-func/output.json @@ -1,139 +1,39 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":2,"column":1}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":50,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":1}}, "param": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"foo"}, "name": "foo" }, "body": { "type": "BlockStatement", - "start": 20, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":20,"end":50,"loc":{"start":{"line":2,"column":14},"end":{"line":4,"column":1}}, "body": [ { "type": "IfStatement", - "start": 24, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 26 - } - }, + "start":24,"end":48,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":26}}, "test": { "type": "NumericLiteral", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":28,"end":29,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -142,33 +42,10 @@ }, "consequent": { "type": "FunctionDeclaration", - "start": 31, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 26 - } - }, + "start":31,"end":48,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":26}}, "id": { "type": "Identifier", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 21 - }, - "identifierName": "foo" - }, + "start":40,"end":43,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":21},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -176,18 +53,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 46, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 26 - } - }, + "start":46,"end":48,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":26}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let-outside/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let-outside/output.json index 8c0ce7e4c0..65c88c1b7f 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let-outside/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let-outside/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":8}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":2,"column":1}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":1}}, "param": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"foo"}, "name": "foo" }, "body": { "type": "BlockStatement", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":3,"column":1}}, "body": [], "directives": [] } @@ -113,48 +35,14 @@ }, { "type": "VariableDeclaration", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 8 - } - }, + "start":24,"end":32,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":8}}, "declarations": [ { "type": "VariableDeclarator", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":28,"end":31,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":7}}, "id": { "type": "Identifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "foo" - }, + "start":28,"end":31,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":7},"identifierName":"foo"}, "name": "foo" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/output.json index e759f28d04..b1c8e29872 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-let/output.json @@ -1,158 +1,46 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":2,"column":1}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":34,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":1}}, "param": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"foo"}, "name": "foo" }, "body": { "type": "BlockStatement", - "start": 20, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":20,"end":34,"loc":{"start":{"line":2,"column":14},"end":{"line":4,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":24,"end":32,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":28,"end":31,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9}}, "id": { "type": "Identifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "foo" - }, + "start":28,"end":31,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9},"identifierName":"foo"}, "name": "foo" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/output.json index 5a4c9d365d..01f965585c 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-obj-destr/output.json @@ -1,262 +1,81 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:28)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":2,"column":1}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":47,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":1}}, "param": { "type": "ObjectPattern", - "start": 15, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":15,"end":42,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":36}}, "properties": [ { "type": "ObjectProperty", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":17,"end":23,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":17}}, "method": false, "key": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "a" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17},"identifierName":"foo"}, "name": "foo" } }, { "type": "ObjectProperty", - "start": 25, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":25,"end":40,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":34}}, "method": false, "key": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "b" - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 28, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":28,"end":40,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":34}}, "properties": [ { "type": "ObjectProperty", - "start": 30, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":30,"end":38,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":32}}, "method": false, "key": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "c" - }, + "start":30,"end":31,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":25},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":33,"end":38,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":32}}, "elements": [ { "type": "Identifier", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 31 - }, - "identifierName": "foo" - }, + "start":34,"end":37,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":31},"identifierName":"foo"}, "name": "foo" } ] @@ -269,18 +88,7 @@ }, "body": { "type": "BlockStatement", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":44,"end":47,"loc":{"start":{"line":2,"column":38},"end":{"line":3,"column":1}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/output.json index 40bb3df749..8f5d300470 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-arr-destr/output.json @@ -1,175 +1,52 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":2,"column":1}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":36,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":1}}, "param": { "type": "ArrayPattern", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":15,"end":20,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":14}}, "elements": [ { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "foo" - }, + "start":16,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13},"identifierName":"foo"}, "name": "foo" } ] }, "body": { "type": "BlockStatement", - "start": 22, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":22,"end":36,"loc":{"start":{"line":2,"column":16},"end":{"line":4,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 26, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":26,"end":34,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":30,"end":33,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9}}, "id": { "type": "Identifier", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "foo" - }, + "start":30,"end":33,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9},"identifierName":"foo"}, "name": "foo" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-nested/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-nested/output.json index 1baae9250d..e69000f54d 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-nested/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-nested/output.json @@ -1,232 +1,64 @@ { "type": "File", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":2,"column":1}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":8,"end":64,"loc":{"start":{"line":2,"column":2},"end":{"line":7,"column":1}}, "param": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"foo"}, "name": "foo" }, "body": { "type": "BlockStatement", - "start": 20, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":20,"end":64,"loc":{"start":{"line":2,"column":14},"end":{"line":7,"column":1}}, "body": [ { "type": "TryStatement", - "start": 24, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":24,"end":62,"loc":{"start":{"line":3,"column":2},"end":{"line":6,"column":3}}, "block": { "type": "BlockStatement", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":28,"end":33,"loc":{"start":{"line":3,"column":6},"end":{"line":4,"column":3}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 34, - "end": 62, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":34,"end":62,"loc":{"start":{"line":4,"column":4},"end":{"line":6,"column":3}}, "param": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 12 - }, - "identifierName": "_" - }, + "start":41,"end":42,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":12},"identifierName":"_"}, "name": "_" }, "body": { "type": "BlockStatement", - "start": 44, - "end": 62, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":44,"end":62,"loc":{"start":{"line":4,"column":14},"end":{"line":6,"column":3}}, "body": [ { "type": "VariableDeclaration", - "start": 50, - "end": 58, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 12 - } - }, + "start":50,"end":58,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 54, - "end": 57, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":54,"end":57,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":11}}, "id": { "type": "Identifier", - "start": 54, - "end": 57, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 11 - }, - "identifierName": "foo" - }, + "start":54,"end":57,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":11},"identifierName":"foo"}, "name": "foo" }, "init": null 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 5cd4c6abd1..df5372c2f5 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 @@ -1,146 +1,45 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":2,"column":1}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":1}}, "param": { "type": "ObjectPattern", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":15,"end":22,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":16}}, "properties": [ { "type": "ObjectProperty", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"foo"}, "name": "foo" }, "extra": { @@ -151,63 +50,18 @@ }, "body": { "type": "BlockStatement", - "start": 24, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":24,"end":38,"loc":{"start":{"line":2,"column":18},"end":{"line":4,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 28, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":28,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":32,"end":35,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9}}, "id": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "foo" - }, + "start":32,"end":35,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9},"identifierName":"foo"}, "name": "foo" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-outside/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-outside/output.json index f9626718bb..80f8d1c3c5 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-outside/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var-outside/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":8}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":2,"column":1}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":1}}, "param": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"foo"}, "name": "foo" }, "body": { "type": "BlockStatement", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":3,"column":1}}, "body": [], "directives": [] } @@ -113,48 +35,14 @@ }, { "type": "VariableDeclaration", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 8 - } - }, + "start":24,"end":32,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":8}}, "declarations": [ { "type": "VariableDeclarator", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":28,"end":31,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":7}}, "id": { "type": "Identifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "foo" - }, + "start":28,"end":31,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":7},"identifierName":"foo"}, "name": "foo" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var/output.json index 54bc80b806..26b9977bfc 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-catch-var/output.json @@ -1,155 +1,43 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":2,"column":1}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":34,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":1}}, "param": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"foo"}, "name": "foo" }, "body": { "type": "BlockStatement", - "start": 20, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":20,"end":34,"loc":{"start":{"line":2,"column":14},"end":{"line":4,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":24,"end":32,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":28,"end":31,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9}}, "id": { "type": "Identifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "foo" - }, + "start":28,"end":31,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9},"identifierName":"foo"}, "name": "foo" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json index 6d2e82b586..9668ddd49b 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-class/output.json @@ -1,164 +1,52 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "body": [] } }, { "type": "EmptyStatement", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}} }, { "type": "ClassDeclaration", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":14,"end":26,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "id": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"foo"}, "name": "foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":12}}, "body": [] } }, { "type": "EmptyStatement", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - } - } + "start":26,"end":27,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/output.json index a23d95cfc2..fcb6f91989 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-const/output.json @@ -1,161 +1,49 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "body": [] } }, { "type": "EmptyStatement", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}} }, { "type": "VariableDeclaration", - "start": 14, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":14,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":20,"end":27,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":13}}, "id": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/output.json index a6bf56aa76..251519a88b 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-func/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:9)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "body": [] } }, { "type": "EmptyStatement", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}} }, { "type": "FunctionDeclaration", - "start": 14, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":14,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "foo" - }, + "start":23,"end":26,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -132,36 +42,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":30,"end":32,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "body": [], "directives": [] } }, { "type": "EmptyStatement", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - } - } + "start":32,"end":33,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/output.json index 49daeec3ae..40ac7749d8 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-let/output.json @@ -1,161 +1,49 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:4)" ], "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "body": [] } }, { "type": "EmptyStatement", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}} }, { "type": "VariableDeclaration", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":14,"end":26,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 18, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":18,"end":25,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "foo" - }, + "start":18,"end":21,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/output.json index 205470069b..7e9448c87d 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-class-var/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:4)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "body": [] } }, { "type": "EmptyStatement", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}} }, { "type": "VariableDeclaration", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":14,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}}, "declarations": [ { "type": "VariableDeclarator", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":18,"end":21,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}}, "id": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "foo" - }, + "start":18,"end":21,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"foo"}, "name": "foo" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/output.json index b6f764fce7..c35c68c759 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-const-const/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (1:13)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "id": { "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" }, "init": { "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" @@ -101,49 +34,15 @@ }, { "type": "VariableDeclarator", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/output.json index ebd20401ed..ae3ed9341b 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-gen/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Identifier 'f' has already been declared (1:28)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "body": [ { "type": "FunctionDeclaration", - "start": 2, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":2,"end":17,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":17}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "f" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -83,51 +27,17 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } }, { "type": "FunctionDeclaration", - "start": 18, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":18,"end":34,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "f" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"f"}, "name": "f" }, "generator": true, @@ -135,18 +45,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/output.json index c1b2c1a85a..71081aa316 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module-sloppy/output.json @@ -1,81 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (1:29)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "FunctionDeclaration", - "start": 2, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":2,"end":19,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -83,51 +27,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } }, { "type": "FunctionDeclaration", - "start": 20, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":20,"end":37,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "foo" - }, + "start":29,"end":32,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":32},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -135,18 +45,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":35,"end":37,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":37}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/output.json index eadbdeeb68..f4d8dbbf89 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-module/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:9)" ], "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -68,51 +23,17 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } }, { "type": "FunctionDeclaration", - "start": 18, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":18,"end":35,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "id": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "foo" - }, + "start":27,"end":30,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -120,18 +41,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":33,"end":35,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":17}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-script-sloppy/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-script-sloppy/output.json index 94ae24d249..1da2a0b755 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-script-sloppy/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-script-sloppy/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "FunctionDeclaration", - "start": 2, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":2,"end":19,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -80,51 +24,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } }, { "type": "FunctionDeclaration", - "start": 20, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":20,"end":37,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "foo" - }, + "start":29,"end":32,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":32},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -132,18 +42,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":35,"end":37,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":37}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-script/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-script/output.json index af377ce804..b5bdce171b 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-script/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-script/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,51 +20,17 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } }, { "type": "FunctionDeclaration", - "start": 18, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":18,"end":35,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "id": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "foo" - }, + "start":27,"end":30,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -117,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":33,"end":35,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":17}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/output.json index 454a440c34..7840aedc90 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var-sloppy/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "body": [ { "type": "FunctionDeclaration", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":4,"end":21,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -83,82 +27,26 @@ "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":19}}, "body": [], "directives": [] } }, { "type": "VariableDeclaration", - "start": 24, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":24,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":28,"end":35,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":13}}, "id": { "type": "Identifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "foo" - }, + "start":28,"end":31,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var/output.json index d2a2c6f998..81976e9bfc 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-func-var/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,82 +20,26 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } }, { "type": "VariableDeclaration", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":18,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":22,"end":29,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/output.json index fdad445b5d..209a1e02c0 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-func/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Identifier 'f' has already been declared (1:28)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "body": [ { "type": "FunctionDeclaration", - "start": 2, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":2,"end":18,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "f" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"f"}, "name": "f" }, "generator": true, @@ -83,51 +27,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [], "directives": [] } }, { "type": "FunctionDeclaration", - "start": 19, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":19,"end":34,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "f" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -135,18 +45,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-gen-script/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-gen-script/output.json index e5bce9fb21..5b9ae21d2b 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-gen-script/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-gen-gen-script/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,66 +20,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [], "directives": [] } }, { "type": "EmptyStatement", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}} }, { "type": "FunctionDeclaration", - "start": 20, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":20,"end":38,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "foo" - }, + "start":30,"end":33,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -132,36 +42,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":36,"end":38,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "body": [], "directives": [] } }, { "type": "EmptyStatement", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - } - } + "start":38,"end":39,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/output.json index e28bf9f399..942dccb6e6 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-let-let/output.json @@ -1,114 +1,35 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "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" }, "init": null }, { "type": "VariableDeclarator", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/output.json index f925321aef..047bfbf77f 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-let-var/output.json @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Identifier 'a' has already been declared (3:8)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":4,"end":10,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":8,"end":9,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "id": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"a"}, "name": "a" }, "init": null @@ -100,63 +33,18 @@ }, { "type": "BlockStatement", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":13,"end":23,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":12}}, "body": [ { "type": "VariableDeclaration", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":15,"end":21,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":19,"end":20,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "a" - }, + "start":19,"end":20,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9},"identifierName":"a"}, "name": "a" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-var-let/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-var-let/output.json index 239db26973..07b40a61bf 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-var-let/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-nested-var-let/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":4,"end":10,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":8,"end":9,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "id": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"a"}, "name": "a" }, "init": null @@ -97,63 +30,18 @@ }, { "type": "BlockStatement", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":13,"end":23,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":12}}, "body": [ { "type": "VariableDeclaration", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":15,"end":21,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":19,"end":20,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "a" - }, + "start":19,"end":20,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9},"identifierName":"a"}, "name": "a" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-var-var/output.json b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-var-var/output.json index 0be8a0eea2..3a0cc9ec48 100644 --- a/packages/babel-parser/test/fixtures/core/scope/dupl-bind-var-var/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/dupl-bind-var-var/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "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" }, "init": null }, { "type": "VariableDeclarator", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/scope/for-let/output.json b/packages/babel-parser/test/fixtures/core/scope/for-let/output.json index 8af98b16aa..152ece9b2f 100644 --- a/packages/babel-parser/test/fixtures/core/scope/for-let/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/for-let/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "init": { "type": "VariableDeclaration", - "start": 5, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":5,"end":14,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "i" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"i"}, "name": "i" }, "init": { "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": 0, "raw": "0" @@ -117,63 +39,18 @@ "update": null, "body": { "type": "BlockStatement", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":3,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":24,"end":30,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "i" - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"i"}, "name": "i" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/scope/for-var/output.json b/packages/babel-parser/test/fixtures/core/scope/for-var/output.json index bfd483ec7f..eb373fff29 100644 --- a/packages/babel-parser/test/fixtures/core/scope/for-var/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/for-var/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Identifier 'i' has already been declared (2:8)" ], "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "init": { "type": "VariableDeclaration", - "start": 5, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":5,"end":14,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "i" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"i"}, "name": "i" }, "init": { "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": 0, "raw": "0" @@ -120,63 +42,18 @@ "update": null, "body": { "type": "BlockStatement", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":3,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":24,"end":30,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "i" - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"i"}, "name": "i" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/scope/let-assign/output.json b/packages/babel-parser/test/fixtures/core/scope/let-assign/output.json index 508af9fc85..dfec132052 100644 --- a/packages/babel-parser/test/fixtures/core/scope/let-assign/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/let-assign/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "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": 1, "raw": "1" @@ -101,64 +34,19 @@ }, { "type": "ExpressionStatement", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "expression": { "type": "AssignmentExpression", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "operator": "=", "left": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/output.json index 996bc32d81..40f3335e7e 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as-default/output.json @@ -1,98 +1,30 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ "SyntaxError: Export 'encrypt' is not defined (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":9,"end":27,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":27}}, "local": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"encrypt"}, "name": "encrypt" }, "exported": { "type": "Identifier", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "default" - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27},"identifierName":"default"}, "name": "default" } } diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/output.json index 11a778f348..120ad6bc70 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-as/output.json @@ -1,98 +1,30 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "errors": [ "SyntaxError: Export 'encrypt' is not defined (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":9,"end":27,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":27}}, "local": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"encrypt"}, "name": "encrypt" }, "exported": { "type": "Identifier", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "decrypt" - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27},"identifierName":"decrypt"}, "name": "decrypt" } } @@ -102,33 +34,10 @@ }, { "type": "FunctionDeclaration", - "start": 31, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":31,"end":52,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":21}}, "id": { "type": "Identifier", - "start": 40, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "decrypt" - }, + "start":40,"end":47,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":16},"identifierName":"decrypt"}, "name": "decrypt" }, "generator": false, @@ -136,18 +45,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 50, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":50,"end":52,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/output.json index a660653865..cedcbba92a 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-block/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":18}}, "errors": [ "SyntaxError: Export 'encrypt' is not defined (4:9)" ], "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "body": [ { "type": "FunctionDeclaration", - "start": 4, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":4,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":23}}, "id": { "type": "Identifier", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "encrypt" - }, + "start":13,"end":20,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":18},"identifierName":"encrypt"}, "name": "encrypt" }, "generator": false, @@ -83,18 +27,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":23}}, "body": [], "directives": [] } @@ -104,65 +37,19 @@ }, { "type": "ExportNamedDeclaration", - "start": 28, - "end": 46, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":28,"end":46,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":18}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 16 - } - }, + "start":37,"end":44,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":16}}, "local": { "type": "Identifier", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":37,"end":44,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":16},"identifierName":"encrypt"}, "name": "encrypt" }, "exported": { "type": "Identifier", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":37,"end":44,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":16},"identifierName":"encrypt"}, "name": "encrypt" } } diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/output.json index ce100047f2..a40f509053 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin-as/output.json @@ -1,98 +1,30 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ "SyntaxError: Export 'Object' is not defined (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "local": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "Object" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"Object"}, "name": "Object" }, "exported": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "Obj" - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"Obj"}, "name": "Obj" } } diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/output.json index 22aa25d45d..faad719a5d 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-builtin/output.json @@ -1,98 +1,30 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Export 'Object' is not defined (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "local": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "Object" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"Object"}, "name": "Object" }, "exported": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "Object" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"Object"}, "name": "Object" } } diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-function-loose-mode-1/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-function-loose-mode-1/output.json index e59b53b2e0..f4e80f2ef2 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-function-loose-mode-1/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-function-loose-mode-1/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":13}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -65,83 +20,26 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "body": [], "directives": [] } }, { "type": "ExportNamedDeclaration", - "start": 17, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":17,"end":30,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":13}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":26,"end":27,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, "local": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "a" - }, + "start":26,"end":27,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"a"}, "name": "a" }, "exported": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "a" - }, + "start":26,"end":27,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"a"}, "name": "a" } } diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-function-loose-mode-2/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-function-loose-mode-2/output.json index 16b50c7b38..bd90c16b5d 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-function-loose-mode-2/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-function-loose-mode-2/output.json @@ -1,95 +1,27 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "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}}, "local": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "exported": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" } } @@ -99,33 +31,10 @@ }, { "type": "FunctionDeclaration", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":14,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "a" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -133,18 +42,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":27,"end":29,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/output.json index dbff016172..783a60a237 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-if/output.json @@ -1,99 +1,31 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":31}}, "errors": [ "SyntaxError: In strict mode code, functions can only be declared at top level or inside a block (2:10)", "SyntaxError: Export 'encrypt' is not defined (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, "local": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"encrypt"}, "name": "encrypt" }, "exported": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"encrypt"}, "name": "encrypt" } } @@ -103,63 +35,18 @@ }, { "type": "IfStatement", - "start": 20, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":20,"end":51,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}}, "test": { "type": "BooleanLiteral", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":24,"end":28,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":8}}, "value": true }, "consequent": { "type": "FunctionDeclaration", - "start": 30, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":30,"end":51,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":31}}, "id": { "type": "Identifier", - "start": 39, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 26 - }, - "identifierName": "encrypt" - }, + "start":39,"end":46,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":26},"identifierName":"encrypt"}, "name": "encrypt" }, "generator": false, @@ -167,18 +54,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 49, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":49,"end":51,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":31}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export-var/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export-var/output.json index 91e34252db..95c7c7580f 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export-var/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export-var/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 4, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":4,"end":15,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":8,"end":15,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":13}}, "id": { "type": "Identifier", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "encrypt" - }, + "start":8,"end":15,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":13},"identifierName":"encrypt"}, "name": "encrypt" }, "init": null @@ -100,65 +33,19 @@ }, { "type": "ExportNamedDeclaration", - "start": 18, - "end": 36, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":18,"end":36,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":18}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 16 - } - }, + "start":27,"end":34,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":16}}, "local": { "type": "Identifier", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":27,"end":34,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":16},"identifierName":"encrypt"}, "name": "encrypt" }, "exported": { "type": "Identifier", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":27,"end":34,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":16},"identifierName":"encrypt"}, "name": "encrypt" } } diff --git a/packages/babel-parser/test/fixtures/core/scope/undecl-export/output.json b/packages/babel-parser/test/fixtures/core/scope/undecl-export/output.json index 6293e83f54..d83b949cce 100644 --- a/packages/babel-parser/test/fixtures/core/scope/undecl-export/output.json +++ b/packages/babel-parser/test/fixtures/core/scope/undecl-export/output.json @@ -1,98 +1,30 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Export 'encrypt' is not defined (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, "local": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"encrypt"}, "name": "encrypt" }, "exported": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"encrypt"}, "name": "encrypt" } } diff --git a/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/commonjs/output.json b/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/commonjs/output.json index 1fb0ddca32..91a67c0b14 100644 --- a/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/commonjs/output.json +++ b/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/commonjs/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24}}, "id": { "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" }, "init": { "type": "CallExpression", - "start": 10, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":10,"end":24,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":24}}, "callee": { "type": "Identifier", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "require" - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17},"identifierName":"require"}, "name": "require" }, "arguments": [ { "type": "StringLiteral", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/flow/output.json b/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/flow/output.json index 970a82515b..69c62635c8 100644 --- a/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/flow/output.json +++ b/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/flow/output.json @@ -1,96 +1,28 @@ { "type": "File", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "imported": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "Foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"Foo"}, "name": "Foo" }, "importKind": null, "local": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "Foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"Foo"}, "name": "Foo" } } @@ -98,18 +30,7 @@ "importKind": "type", "source": { "type": "StringLiteral", - "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}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" @@ -119,65 +40,19 @@ }, { "type": "ExportNamedDeclaration", - "start": 32, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":32,"end":52,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":20}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":46,"end":49,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17}}, "local": { "type": "Identifier", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "Foo" - }, + "start":46,"end":49,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17},"identifierName":"Foo"}, "name": "Foo" }, "exported": { "type": "Identifier", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "Foo" - }, + "start":46,"end":49,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17},"identifierName":"Foo"}, "name": "Foo" } } @@ -188,33 +63,11 @@ }, { "type": "ExportAllDeclaration", - "start": 53, - "end": 78, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":53,"end":78,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":25}}, "exportKind": "type", "source": { "type": "StringLiteral", - "start": 72, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":72,"end":77,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":24}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" 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 bec71854b0..6b9a913d2d 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 @@ -1,108 +1,29 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "callee": { "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": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "console" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"console"}, "name": "console" }, "property": { "type": "Identifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "log" - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"log"}, "name": "log" }, "computed": false @@ -110,50 +31,15 @@ "arguments": [ { "type": "MetaProperty", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":12,"end":23,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":23}}, "meta": { "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "import" - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18},"identifierName":"import"}, "name": "import" }, "property": { "type": "Identifier", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "meta" - }, + "start":19,"end":23,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":23},"identifierName":"meta"}, "name": "meta" } } diff --git a/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-export-all/output.json b/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-export-all/output.json index 2ab38b87e8..c45fef74fd 100644 --- a/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-export-all/output.json +++ b/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-export-all/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportAllDeclaration", - "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}}, "source": { "type": "StringLiteral", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-export-default/output.json b/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-export-default/output.json index ed67207623..f97a48e3ef 100644 --- a/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-export-default/output.json +++ b/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-export-default/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "declaration": { "type": "ObjectExpression", - "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}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-export-named/output.json b/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-export-named/output.json index d3f3d57692..3aa29e11df 100644 --- a/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-export-named/output.json +++ b/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-export-named/output.json @@ -1,79 +1,23 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 7, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":7,"end":22,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "fn" - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -81,18 +25,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-import/output.json b/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-import/output.json index 329db7b046..95736fdee6 100644 --- a/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-import/output.json +++ b/packages/babel-parser/test/fixtures/core/sourcetype-unambiguous/module-import/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [], "source": { "type": "StringLiteral", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/1/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/1/output.json index 1cf6441fff..066e563843 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/1/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/1/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "ThisExpression", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}} } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/10/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/10/output.json index d2f456d828..021db7e307 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/10/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/10/output.json @@ -1,119 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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": "=", "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": "ArrayExpression", - "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}}, + "extra": { + "trailingComma": 8 }, "elements": [ { "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" }, "value": 42 } - ], - "extra": { - "trailingComma": 8 - } + ] } } } 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 69ff486c62..8bbf441a1b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/100/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/100/output.json @@ -1,63 +1,19 @@ { "type": "File", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "value": { "type": "DirectiveLiteral", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "value": "Hello\\\nworld", "extra": { "raw": "\"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 e95ac9779c..b34917f7e6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/101/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/101/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\1World", "extra": { "raw": "\"Hello\\1World\"", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/102/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/102/output.json index edf979f658..b0e0b89e8f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/102/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/102/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "extra": { "raw": "/[a-z]/i" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/103/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/103/output.json index 4ec3778aaf..7330808104 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/103/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/103/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "extra": { "raw": "/[x-z]/i" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/104/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/104/output.json index 7c5bfd0d7d..60a5a8fea2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/104/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/104/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "extra": { "raw": "/[a-c]/i" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/105/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/105/output.json index c79985fcb2..1eea2fed3a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/105/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/105/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17}}, "extra": { "raw": "/[P QR]/i" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/106/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/106/output.json index abec94d30e..2e5490d094 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/106/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/106/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":4,"end":18,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":8,"end":18,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":18}}, "extra": { "raw": "/foo\\/bar/" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/107/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/107/output.json index 311090fd6a..a9e8ee6e33 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/107/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/107/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":4,"end":21,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":8,"end":21,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":21}}, "extra": { "raw": "/=([^=\\s])+/g" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json index 65ac2b95f1..287f2a0533 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/108/output.json @@ -1,17 +1,6 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: Invalid regular expression flag (1:17)", "SyntaxError: Invalid regular expression flag (1:19)", @@ -21,81 +10,25 @@ ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":22}}, "extra": { "raw": "/[P QR]/\\u0067" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/109/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/109/output.json index 832564eca4..d0e31b332f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/109/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/109/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/11/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/11/output.json index b0025ea338..207c5b9613 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/11/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/11/output.json @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ArrayExpression", - "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}}, "elements": [ null, null, { "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" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/110/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/110/output.json index 7bd85bcc02..31c748c495 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/110/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/110/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/111/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/111/output.json index 8890dbc0a5..b700e71957 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/111/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/111/output.json @@ -1,91 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/112/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/112/output.json index 74dfc01529..2a305b55c4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/112/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/112/output.json @@ -1,91 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/113/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/113/output.json index 9a7b0d5681..6b3dccf75c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/113/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/113/output.json @@ -1,124 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": [] }, "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 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 aed252faf1..2a3507d72d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/114/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/114/output.json @@ -1,108 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 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 0177eead60..3a2644e842 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/115/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/115/output.json @@ -1,108 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 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 2e5825aecf..6dfef381ed 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/116/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/116/output.json @@ -1,105 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": [], @@ -110,19 +32,7 @@ }, "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 diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/117/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/117/output.json index 38dadd7078..0bbb304c6e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/117/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/117/output.json @@ -1,112 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/118/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/118/output.json index f8bf7daf5b..b86053f12a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/118/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/118/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/119/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/119/output.json index 82d3e1035a..d55ddd1b61 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/119/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/119/output.json @@ -1,94 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/12/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/12/output.json index 0c39b167df..4bc8d58ff2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/12/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/12/output.json @@ -1,109 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ArrayExpression", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, + "extra": { + "trailingComma": 13 }, "elements": [ { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -112,18 +37,7 @@ }, { "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": 2, "raw": "2" @@ -132,28 +46,14 @@ }, { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 3, "raw": "3" }, "value": 3 } - ], - "extra": { - "trailingComma": 13 - } + ] } } } 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 a446cdb8fb..90f241ea29 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/120/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/120/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 }, "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 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 cb1cbf606f..6ebb1a398b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/121/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/121/output.json @@ -1,160 +1,46 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 }, "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 }, "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 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 fbb61eb44b..35c3eaa5e2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/122/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/122/output.json @@ -1,126 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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" } ] 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 4d221db72d..5ccfa4a76d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/123/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/123/output.json @@ -1,94 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 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 f3ec5d8857..5fa10d856c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/124/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/124/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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" @@ -112,19 +34,7 @@ }, "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 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 a0d7dd6582..5fe9e49343 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/125/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/125/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" @@ -113,19 +35,7 @@ }, "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 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 3d93d997f9..e7068fd5ca 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/126/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/126/output.json @@ -1,136 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" @@ -141,19 +41,7 @@ }, "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 @@ -161,18 +49,7 @@ "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" @@ -181,18 +58,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" @@ -201,18 +67,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" @@ -223,19 +78,7 @@ }, "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 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 bc3d887ec0..645ac82f55 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/127/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/127/output.json @@ -1,174 +1,49 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 }, "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 }, "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 @@ -176,18 +51,7 @@ "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/fixtures/core/uncategorised/128/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/128/output.json index 8e2550dfe5..96d56d51f4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/128/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/128/output.json @@ -1,94 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 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 88fce0c713..834a12a4eb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/129/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/129/output.json @@ -1,94 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/13/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/13/output.json index c2fec5bfcf..48a9251900 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/13/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/13/output.json @@ -1,109 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ArrayExpression", - "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}}, + "extra": { + "trailingComma": 14 }, "elements": [ { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -112,18 +37,7 @@ }, { "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": 2, "raw": "2" @@ -133,28 +47,14 @@ null, { "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": 3, "raw": "3" }, "value": 3 } - ], - "extra": { - "trailingComma": 14 - } + ] } } } 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 c40e59d22d..e7664cfc93 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/130/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/130/output.json @@ -1,94 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 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 9739e7a6f3..d9b4c0dd9e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/131/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/131/output.json @@ -1,94 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/132/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/132/output.json index 603d0ca75c..798e7f2d3c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/132/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/132/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/133/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/133/output.json index 0c86ed9cfa..2470e7fd78 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/133/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/133/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/134/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/134/output.json index acdf9d06a9..87c3e0871f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/134/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/134/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/135/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/135/output.json index 16a8b4d997..1798f7e296 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/135/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/135/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/136/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/136/output.json index 1ae88c0512..6237a6d3dd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/136/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/136/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/137/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/137/output.json index f9aca6bfaa..31b78a3ccb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/137/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/137/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/138/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/138/output.json index 620fca4048..2b55f4dc54 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/138/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/138/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/139/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/139/output.json index 2179523b38..e9b5955636 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/139/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/139/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/14/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/14/output.json index 4a76c9ff39..a51e468a58 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/14/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/14/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "日本語" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"日本語"}, "name": "日本語" }, "right": { "type": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/140/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/140/output.json index 82b23bcc25..334ceaff24 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/140/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/140/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/141/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/141/output.json index 88d60f45c5..d2960c20fb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/141/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/141/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/142/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/142/output.json index 15827d1115..00218c0e04 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/142/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/142/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/143/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/143/output.json index e9f55cbe39..f83d741ef5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/143/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/143/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/144/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/144/output.json index fd8b542217..f8707b9018 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/144/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/144/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/145/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/145/output.json index 00936f4b0f..cee848a92a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/145/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/145/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/146/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/146/output.json index 533a669dfc..38ba1fbd5d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/146/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/146/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/147/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/147/output.json index b017ac4d4b..37e26f32fe 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/147/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/147/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/148/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/148/output.json index 4a0bf74a8a..eb5d31ccb8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/148/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/148/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/149/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/149/output.json index add0b1fc84..96c7f5c024 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/149/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/149/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/15/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/15/output.json index e0b6f1f741..0598d0ee00 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/15/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/15/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "T‿" - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"T‿"}, "name": "T‿" }, "right": { "type": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/150/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/150/output.json index db311ef3bb..b42af7e2ff 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/150/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/150/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/151/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/151/output.json index d6c2f9a3e0..f90dba3c9c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/151/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/151/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/152/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/152/output.json index edeb7a67b9..8a3977855d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/152/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/152/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/153/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/153/output.json index 65b21159bd..7d67196d62 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/153/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/153/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/154/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/154/output.json index c2adfba4b5..7d87c8fc6e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/154/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/154/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/155/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/155/output.json index 13cc3bbdfc..5226c2ebfb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/155/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/155/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/156/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/156/output.json index a73cf0cf3f..967c39273d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/156/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/156/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/157/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/157/output.json index 8a2005065f..71da5f24f2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/157/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/157/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/158/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/158/output.json index 79e6ab49f0..37f18c8f1c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/158/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/158/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/159/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/159/output.json index da4b728c5e..85ab5afc44 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/159/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/159/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/16/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/16/output.json index fcbcba00f5..62eafe1037 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/16/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/16/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "T‌" - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"T‌"}, "name": "T‌" }, "right": { "type": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/160/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/160/output.json index 7e1b9c51b1..b6ecda2e0a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/160/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/160/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/161/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/161/output.json index 0fb742510b..75141bc2be 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/161/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/161/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/162/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/162/output.json index ad8dec06b0..8276ce96fc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/162/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/162/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/163/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/163/output.json index bb04fff526..bd09306d3c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/163/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/163/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/164/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/164/output.json index 6dc11018bc..e636283e42 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/164/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/164/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/165/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/165/output.json index 03f750d1df..726d741dfc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/165/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/165/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/166/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/166/output.json index 1be43c5d3e..f9d37f650f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/166/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/166/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/167/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/167/output.json index 7fdf6f8aa3..509a2fa878 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/167/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/167/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/168/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/168/output.json index 4e3733ed6b..910c4ace54 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/168/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/168/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/169/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/169/output.json index d439d193a7..b84db6eff7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/169/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/169/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/17/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/17/output.json index aa17794200..a9cc992689 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/17/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/17/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "T‍" - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"T‍"}, "name": "T‍" }, "right": { "type": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/170/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/170/output.json index 0782650869..f2ef76b6ef 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/170/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/170/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/171/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/171/output.json index a036d7feee..d1cc74acf7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/171/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/171/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/172/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/172/output.json index 3f0401d051..793dc10c6c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/172/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/172/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/173/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/173/output.json index 12c80600d8..94fc529252 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/173/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/173/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/174/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/174/output.json index 7a4cb9d5bd..12de61e60e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/174/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/174/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/175/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/175/output.json index d95f951f8e..68a6d08d72 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/175/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/175/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/176/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/176/output.json index 4449ac1fc3..cdaf1460cf 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/176/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/176/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/177/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/177/output.json index 11b4c83b84..5d60fa9a4f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/177/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/177/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/178/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/178/output.json index 33ebd32af2..cfb1d7d325 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/178/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/178/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/179/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/179/output.json index c6716f6d5b..e4ad518b49 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/179/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/179/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/18/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/18/output.json index 77ed83cfe5..ca44a6f181 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/18/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/18/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "ⅣⅡ" - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"ⅣⅡ"}, "name": "ⅣⅡ" }, "right": { "type": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/180/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/180/output.json index d7d6a0eb4c..c9172b4c0e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/180/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/180/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/181/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/181/output.json index 55536bf01e..928ebf4c4c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/181/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/181/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/182/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/182/output.json index b0249f734e..b2def55e60 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/182/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/182/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/183/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/183/output.json index 42134f8776..f135242de7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/183/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/183/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/184/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/184/output.json index 64aa2ad301..ad23fc9dbb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/184/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/184/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/185/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/185/output.json index 8a205f26f6..299c2101fd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/185/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/185/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/186/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/186/output.json index 76106e9d4f..8450ad8b97 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/186/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/186/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/187/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/187/output.json index 19599c7b1c..fb85cecd3e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/187/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/187/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/188/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/188/output.json index 9e8b8d3fa8..3565086f71 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/188/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/188/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/189/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/189/output.json index c7661fa85d..9d88d7ba1c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/189/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/189/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/19/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/19/output.json index 77ed83cfe5..ca44a6f181 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/19/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/19/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "ⅣⅡ" - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"ⅣⅡ"}, "name": "ⅣⅡ" }, "right": { "type": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/190/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/190/output.json index fcccd1684f..ba82d25b87 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/190/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/190/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/191/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/191/output.json index ab60eb5ab7..b9a75b550b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/191/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/191/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/192/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/192/output.json index beb961a6f0..156e6398fd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/192/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/192/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/193/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/193/output.json index c2de2c5ec3..0ece3ff33f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/193/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/193/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/194/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/194/output.json index 8ef39b3fcd..ea8daaf85f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/194/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/194/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/195/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/195/output.json index c75389bc6c..776f47eea1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/195/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/195/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/196/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/196/output.json index 0d49dfa5a7..29d1920ab7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/196/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/196/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/197/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/197/output.json index 9256d55782..6bd9c8a488 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/197/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/197/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" @@ -96,18 +29,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/fixtures/core/uncategorised/198/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/198/output.json index 78cba5d992..73ed52c6a7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/198/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/198/output.json @@ -1,126 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" @@ -129,18 +39,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/fixtures/core/uncategorised/199/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/199/output.json index a5a52c1e2d..53a8bda384 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/199/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/199/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/2/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/2/output.json index 3d18314470..4bb0f76377 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/2/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/2/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NullLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}} } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/20/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/20/output.json index ace60cd560..b3d6b552a8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/20/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/20/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ObjectExpression", - "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}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/200/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/200/output.json index e1363b4f98..09238f85c9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/200/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/200/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/201/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/201/output.json index 9ced89e225..45ca46801c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/201/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/201/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/202/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/202/output.json index 4c6da633f9..4305f9c34d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/202/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/202/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/203/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/203/output.json index 2ae6136428..ed4728f171 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/203/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/203/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/204/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/204/output.json index 62a87b6a49..c3f3df7e5f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/204/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/204/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/205/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/205/output.json index 987e2eb785..2ccf078c9d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/205/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/205/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/206/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/206/output.json index 077c01c701..2ba631424d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/206/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/206/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/207/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/207/output.json index 9fc98d2128..5d0d198371 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/207/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/207/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/208/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/208/output.json index 6cefd83e32..320ab23201 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/208/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/208/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/209/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/209/output.json index c12350d6a4..9c04a76a8e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/209/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/209/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/21/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/21/output.json index 475c1afc13..dd1feb7b33 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/21/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/21/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ObjectExpression", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/210/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/210/output.json index f97a88dd99..b35bbd4d76 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/210/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/210/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/211/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/211/output.json index f12219cdff..cf0974cabc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/211/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/211/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/212/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/212/output.json index d29652f48f..6141658267 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/212/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/212/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/core/uncategorised/213/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/213/output.json index 598c96a56b..c606339577 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/213/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/213/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, "expression": { "type": "Identifier", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "foo" - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5},"identifierName":"foo"}, "name": "foo" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/214/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/214/output.json index 9eed13dbf1..61bba56429 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/214/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/214/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "body": [ { "type": "ExpressionStatement", - "start": 2, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":2,"end":11,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":11}}, "expression": { "type": "CallExpression", - "start": 2, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":2,"end":10,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":10}}, "callee": { "type": "Identifier", - "start": 2, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "doThis" - }, + "start":2,"end":8,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":8},"identifierName":"doThis"}, "name": "doThis" }, "arguments": [] @@ -94,47 +27,13 @@ }, { "type": "ExpressionStatement", - "start": 12, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":12,"end":21,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":21}}, "expression": { "type": "CallExpression", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "callee": { "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "doThat" - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18},"identifierName":"doThat"}, "name": "doThat" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/215/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/215/output.json index 9c65b7b8cb..b2560defc5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/215/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/215/output.json @@ -1,48 +1,15 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/216/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/216/output.json index c2d1aa9e82..1fad75e9a9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/216/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/216/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/217/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/217/output.json index 2292f444ff..765527f777 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/217/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/217/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": null }, { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "y" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"y"}, "name": "y" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/218/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/218/output.json index 338b1ef14f..26d684ab89 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/218/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/218/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/219/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/219/output.json index 64faa9a0c0..46dc4683a1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/219/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/219/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "eval" - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8},"identifierName":"eval"}, "name": "eval" }, "init": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "extra": { "rawValue": 42, "raw": "42" @@ -98,49 +31,15 @@ }, { "type": "VariableDeclarator", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":15,"end":29,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":29}}, "id": { "type": "Identifier", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "arguments" - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24},"identifierName":"arguments"}, "name": "arguments" }, "init": { "type": "NumericLiteral", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/22/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/22/output.json index 245feff142..e7d5402c92 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/22/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/22/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "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": "ObjectExpression", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":4,"end":18,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":18}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":6,"end":16,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "answer" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"answer"}, "name": "answer" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/220/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/220/output.json index cb147f686b..bdc2834baf 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/220/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/220/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": 14, "raw": "14" @@ -98,49 +31,15 @@ }, { "type": "VariableDeclarator", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "y" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"y"}, "name": "y" }, "init": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 3, "raw": "3" @@ -150,49 +49,15 @@ }, { "type": "VariableDeclarator", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "z" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"z"}, "name": "z" }, "init": { "type": "NumericLiteral", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27}}, "extra": { "rawValue": 1977, "raw": "1977" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/221/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/221/output.json index d6d6794fe5..1c191ef723 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/221/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/221/output.json @@ -1,144 +1,42 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "implements" - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14},"identifierName":"implements"}, "name": "implements" }, "init": null }, { "type": "VariableDeclarator", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":16,"end":25,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "interface" - }, + "start":16,"end":25,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":25},"identifierName":"interface"}, "name": "interface" }, "init": null }, { "type": "VariableDeclarator", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "package" - }, + "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34},"identifierName":"package"}, "name": "package" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/222/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/222/output.json index 4b8305ce1e..8a4c16c4b1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/222/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/222/output.json @@ -1,177 +1,52 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "private" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"private"}, "name": "private" }, "init": null }, { "type": "VariableDeclarator", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":13,"end":22,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "protected" - }, + "start":13,"end":22,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":22},"identifierName":"protected"}, "name": "protected" }, "init": null }, { "type": "VariableDeclarator", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "public" - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30},"identifierName":"public"}, "name": "public" }, "init": null }, { "type": "VariableDeclarator", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}}, "id": { "type": "Identifier", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "static" - }, + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38},"identifierName":"static"}, "name": "static" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/223/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/223/output.json index 1c109c350c..1056212c97 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/223/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/223/output.json @@ -1,48 +1,15 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EmptyStatement", - "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}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/224/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/224/output.json index 46cd57504e..8bb741bae2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/224/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/224/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/225/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/225/output.json index 769e912a7e..c6a529bc13 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/225/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/225/output.json @@ -1,95 +1,27 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "SequenceExpression", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expressions": [ { "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" }, { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "y" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"y"}, "name": "y" } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/226/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/226/output.json index db7aee01cc..54266dae6d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/226/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/226/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/227/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/227/output.json index 8f9a8687f6..9636de1941 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/227/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/227/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "aa" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"aa"}, "name": "aa" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/228/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/228/output.json index 078b39d33a..7dcb2358b5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/228/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/228/output.json @@ -1,108 +1,29 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "test": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "morning" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"morning"}, "name": "morning" }, "consequent": { "type": "ExpressionStatement", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "expression": { "type": "CallExpression", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "callee": { "type": "Identifier", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "goodMorning" - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24},"identifierName":"goodMorning"}, "name": "goodMorning" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/229/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/229/output.json index 46b9ab0f4a..cfe4ca1e26 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/229/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/229/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "test": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "morning" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"morning"}, "name": "morning" }, "consequent": { "type": "ExpressionStatement", - "start": 13, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":13,"end":27,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":27}}, "expression": { "type": "FunctionExpression", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/23/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/23/output.json index 87c6c01640..934336937d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/23/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/23/output.json @@ -1,143 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 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": "ObjectExpression", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "if" - }, + "start":6,"end":8,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":8},"identifierName":"if"}, "name": "if" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/230/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/230/output.json index d2e4bb7013..3fb7587ba6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/230/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/230/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "test": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "morning" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"morning"}, "name": "morning" }, "consequent": { "type": "VariableDeclaration", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":13,"end":23,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/231/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/231/output.json index 3a5f512ccc..37986cf131 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/231/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/231/output.json @@ -1,108 +1,29 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "test": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "morning" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"morning"}, "name": "morning" }, "consequent": { "type": "ExpressionStatement", - "start": 13, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":13,"end":27,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":27}}, "expression": { "type": "CallExpression", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "callee": { "type": "Identifier", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "goodMorning" - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24},"identifierName":"goodMorning"}, "name": "goodMorning" }, "arguments": [] @@ -110,47 +31,13 @@ }, "alternate": { "type": "ExpressionStatement", - "start": 33, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":33,"end":42,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":42}}, "expression": { "type": "CallExpression", - "start": 33, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":33,"end":42,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":42}}, "callee": { "type": "Identifier", - "start": 33, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "goodDay" - }, + "start":33,"end":40,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":40},"identifierName":"goodDay"}, "name": "goodDay" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/232/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/232/output.json index ea8f8f1ee1..17cddefa31 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/232/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/232/output.json @@ -1,91 +1,24 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "DoWhileStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "body": { "type": "ExpressionStatement", - "start": 3, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":3,"end":10,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":10}}, "expression": { "type": "CallExpression", - "start": 3, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":3,"end":9,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":9}}, "callee": { "type": "Identifier", - "start": 3, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "keep" - }, + "start":3,"end":7,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":7},"identifierName":"keep"}, "name": "keep" }, "arguments": [] @@ -93,18 +26,7 @@ }, "test": { "type": "BooleanLiteral", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "value": true } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/233/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/233/output.json index 58dc5fcc7b..8328102958 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/233/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/233/output.json @@ -1,91 +1,24 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "DoWhileStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "body": { "type": "ExpressionStatement", - "start": 3, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":3,"end":10,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":10}}, "expression": { "type": "CallExpression", - "start": 3, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":3,"end":9,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":9}}, "callee": { "type": "Identifier", - "start": 3, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "keep" - }, + "start":3,"end":7,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":7},"identifierName":"keep"}, "name": "keep" }, "arguments": [] @@ -93,18 +26,7 @@ }, "test": { "type": "BooleanLiteral", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "value": true } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/234/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/234/output.json index 2dc7a4b042..0d0752b806 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/234/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/234/output.json @@ -1,157 +1,45 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "DoWhileStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "body": { "type": "BlockStatement", - "start": 3, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":3,"end":16,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":16}}, "body": [ { "type": "ExpressionStatement", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "expression": { "type": "UpdateExpression", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "operator": "++", "prefix": false, "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" } } }, { "type": "ExpressionStatement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "expression": { "type": "UpdateExpression", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "operator": "--", "prefix": false, "argument": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "y" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"y"}, "name": "y" } } @@ -161,50 +49,16 @@ }, "test": { "type": "BinaryExpression", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}}, "left": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"x"}, "name": "x" }, "operator": "<", "right": { "type": "NumericLiteral", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "extra": { "rawValue": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/235/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/235/output.json index 78775d7e09..e9a09cf01b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/235/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/235/output.json @@ -1,125 +1,37 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "body": [ { "type": "DoWhileStatement", - "start": 2, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":2,"end":23,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":23}}, "body": { "type": "BlockStatement", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "body": [], "directives": [] }, "test": { "type": "BooleanLiteral", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "value": false } }, { "type": "ExpressionStatement", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "expression": { "type": "BooleanLiteral", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "value": false } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/236/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/236/output.json index 4f0b42bf91..14379aca37 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/236/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/236/output.json @@ -1,107 +1,29 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "ExpressionStatement", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "expression": { "type": "CallExpression", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "callee": { "type": "Identifier", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "doSomething" - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24},"identifierName":"doSomething"}, "name": "doSomething" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/237/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/237/output.json index cab2b6c289..855a078a1e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/237/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/237/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "test": { "type": "BinaryExpression", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "left": { "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" }, "operator": "<", "right": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "extra": { "rawValue": 10, "raw": "10" @@ -98,113 +31,34 @@ }, "body": { "type": "BlockStatement", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "body": [ { "type": "ExpressionStatement", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21}}, "expression": { "type": "UpdateExpression", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "operator": "++", "prefix": false, "argument": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"x"}, "name": "x" } } }, { "type": "ExpressionStatement", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":22,"end":26,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":26}}, "expression": { "type": "UpdateExpression", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "operator": "--", "prefix": false, "argument": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "y" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"y"}, "name": "y" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/238/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/238/output.json index ef81cf2ef0..2e3d9f6a43 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/238/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/238/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "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}}, "init": null, "test": null, "update": null, "body": { "type": "EmptyStatement", - "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}} } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/239/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/239/output.json index eca6e822f6..4b8a7f23f0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/239/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/239/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "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}}, "init": null, "test": null, "update": null, "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/24/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/24/output.json index 3a19ed468d..923dff08f3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/24/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/24/output.json @@ -1,143 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "true" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"true"}, "name": "true" }, "computed": false, "shorthand": false, "value": { "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/fixtures/core/uncategorised/240/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/240/output.json index 087317911d..dbc5316223 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/240/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/240/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "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}}, "init": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "right": { "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": 0, "raw": "0" @@ -100,18 +33,7 @@ "update": null, "body": { "type": "EmptyStatement", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}} } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/241/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/241/output.json index aa78dd8a11..c66442c43c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/241/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/241/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "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}}, "init": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "id": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 0, "raw": "0" @@ -117,18 +39,7 @@ "update": null, "body": { "type": "EmptyStatement", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}} } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/242/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/242/output.json index 02714a4af3..2fd8f619a8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/242/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/242/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "init": { "type": "VariableDeclaration", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "id": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 0, "raw": "0" @@ -112,49 +34,15 @@ }, { "type": "VariableDeclarator", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "y" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"y"}, "name": "y" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" @@ -169,18 +57,7 @@ "update": null, "body": { "type": "EmptyStatement", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/243/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/243/output.json index ae77e9c9c0..d4c5c67c94 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/243/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/243/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "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}}, "init": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "right": { "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": 0, "raw": "0" @@ -98,50 +31,16 @@ }, "test": { "type": "BinaryExpression", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "left": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "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" @@ -152,18 +51,7 @@ "update": null, "body": { "type": "EmptyStatement", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}} } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/244/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/244/output.json index 8cae092843..cd2ea8ed46 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/244/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/244/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "init": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "right": { "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": 0, "raw": "0" @@ -98,50 +31,16 @@ }, "test": { "type": "BinaryExpression", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "left": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "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" @@ -151,52 +50,18 @@ }, "update": { "type": "UpdateExpression", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, "operator": "++", "prefix": false, "argument": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "x" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"x"}, "name": "x" } }, "body": { "type": "EmptyStatement", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/245/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/245/output.json index 0623e2624b..35c53b58e7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/245/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/245/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "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}}, "init": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "right": { "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": 0, "raw": "0" @@ -98,50 +31,16 @@ }, "test": { "type": "BinaryExpression", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "left": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "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" @@ -151,99 +50,30 @@ }, "update": { "type": "UpdateExpression", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, "operator": "++", "prefix": false, "argument": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "x" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"x"}, "name": "x" } }, "body": { "type": "ExpressionStatement", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":24,"end":35,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":35}}, "expression": { "type": "CallExpression", - "start": 24, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":24,"end":34,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":34}}, "callee": { "type": "Identifier", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "process" - }, + "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "x" - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/246/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/246/output.json index 4ce8157544..0dcc76e29b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/246/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/246/output.json @@ -1,143 +1,40 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "right": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "list" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 15, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":15,"end":26,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":26}}, "expression": { "type": "CallExpression", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":15,"end":25,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":25}}, "callee": { "type": "Identifier", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "process" - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/247/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/247/output.json index d418bc0ac8..b132a32e5e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/247/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/247/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "left": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "init": null @@ -96,82 +29,24 @@ }, "right": { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "list" - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "expression": { "type": "CallExpression", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "callee": { "type": "Identifier", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "process" - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "x" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/25/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/25/output.json index dbb1747c78..024dcc1726 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/25/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/25/output.json @@ -1,143 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "false" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"false"}, "name": "false" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/250/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/250/output.json index 976ebcc715..797c741a6e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/250/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/250/output.json @@ -1,93 +1,27 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "body": [ { "type": "ContinueStatement", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/251/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/251/output.json index b14a15b253..320fd8e869 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/251/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/251/output.json @@ -1,93 +1,27 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":13,"end":25,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":25}}, "body": [ { "type": "ContinueStatement", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/252/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/252/output.json index 618cec22e8..d69535cf35 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/252/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/252/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "body": { "type": "WhileStatement", - "start": 6, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":6,"end":36,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":36}}, "test": { "type": "BooleanLiteral", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17}}, "value": true }, "body": { "type": "BlockStatement", - "start": 19, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":19,"end":36,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":36}}, "body": [ { "type": "ContinueStatement", - "start": 21, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":21,"end":34,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":34}}, "label": { "type": "Identifier", - "start": 30, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "done" - }, + "start":30,"end":34,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":34},"identifierName":"done"}, "name": "done" } } @@ -126,19 +37,7 @@ }, "label": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "done" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"done"}, "name": "done" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/253/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/253/output.json index 1ae8f40f97..3036808c3c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/253/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/253/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "body": { "type": "WhileStatement", - "start": 6, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":6,"end":37,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":37}}, "test": { "type": "BooleanLiteral", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17}}, "value": true }, "body": { "type": "BlockStatement", - "start": 19, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":19,"end":37,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":37}}, "body": [ { "type": "ContinueStatement", - "start": 21, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":21,"end":35,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":35}}, "label": { "type": "Identifier", - "start": 30, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "done" - }, + "start":30,"end":34,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":34},"identifierName":"done"}, "name": "done" } } @@ -126,19 +37,7 @@ }, "label": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "done" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"done"}, "name": "done" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/254/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/254/output.json index f719006e5a..bdda42876a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/254/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/254/output.json @@ -1,93 +1,27 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":13,"end":22,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":22}}, "body": [ { "type": "BreakStatement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/255/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/255/output.json index 09cd88be36..12f3b1a77a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/255/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/255/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "body": { "type": "WhileStatement", - "start": 6, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":6,"end":33,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":33}}, "test": { "type": "BooleanLiteral", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17}}, "value": true }, "body": { "type": "BlockStatement", - "start": 19, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":19,"end":33,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":33}}, "body": [ { "type": "BreakStatement", - "start": 21, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":21,"end":31,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":31}}, "label": { "type": "Identifier", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "done" - }, + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31},"identifierName":"done"}, "name": "done" } } @@ -126,19 +37,7 @@ }, "label": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "done" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"done"}, "name": "done" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/256/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/256/output.json index 612f1abd2b..856e2d676e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/256/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/256/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "body": { "type": "WhileStatement", - "start": 6, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":6,"end":34,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":34}}, "test": { "type": "BooleanLiteral", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17}}, "value": true }, "body": { "type": "BlockStatement", - "start": 19, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":19,"end":34,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":34}}, "body": [ { "type": "BreakStatement", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "label": { "type": "Identifier", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "done" - }, + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31},"identifierName":"done"}, "name": "done" } } @@ -126,19 +37,7 @@ }, "label": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "done" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"done"}, "name": "done" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/257/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/257/output.json index 43f74a6146..da1bb68d71 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/257/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/257/output.json @@ -1,136 +1,36 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "body": { "type": "LabeledStatement", - "start": 9, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":9,"end":52,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":52}}, "body": { "type": "WhileStatement", - "start": 18, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":18,"end":52,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":52}}, "test": { "type": "BooleanLiteral", - "start": 25, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":25,"end":29,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":29}}, "value": true }, "body": { "type": "BlockStatement", - "start": 31, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":31,"end":52,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":52}}, "body": [ { "type": "ContinueStatement", - "start": 33, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":33,"end":50,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":50}}, "label": { "type": "Identifier", - "start": 42, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 49 - }, - "identifierName": "target1" - }, + "start":42,"end":49,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":49},"identifierName":"target1"}, "name": "target1" } } @@ -140,37 +40,13 @@ }, "label": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "target2" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"target2"}, "name": "target2" } }, "label": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "target1" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"target1"}, "name": "target1" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/258/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/258/output.json index fabfd48570..fb3e701b74 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/258/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/258/output.json @@ -1,150 +1,39 @@ { "type": "File", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "program": { "type": "Program", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "body": { "type": "LabeledStatement", - "start": 9, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":9,"end":61,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":61}}, "body": { "type": "LabeledStatement", - "start": 18, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":18,"end":61,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":61}}, "body": { "type": "WhileStatement", - "start": 27, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":27,"end":61,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":61}}, "test": { "type": "BooleanLiteral", - "start": 34, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":34,"end":38,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":38}}, "value": true }, "body": { "type": "BlockStatement", - "start": 40, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":40,"end":61,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":61}}, "body": [ { "type": "ContinueStatement", - "start": 42, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":42,"end":59,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":59}}, "label": { "type": "Identifier", - "start": 51, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 58 - }, - "identifierName": "target1" - }, + "start":51,"end":58,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":58},"identifierName":"target1"}, "name": "target1" } } @@ -154,55 +43,19 @@ }, "label": { "type": "Identifier", - "start": 18, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "target3" - }, + "start":18,"end":25,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":25},"identifierName":"target3"}, "name": "target3" } }, "label": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "target2" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"target2"}, "name": "target2" } }, "label": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "target1" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"target1"}, "name": "target1" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/259/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/259/output.json index 34df72d1dd..12be6ac788 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/259/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/259/output.json @@ -1,95 +1,29 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":1,"end":21,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":21}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21}}, "body": [ { "type": "ReturnStatement", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}}, "argument": null } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/26/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/26/output.json index 2918b16e85..5ee065601e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/26/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/26/output.json @@ -1,143 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "null" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"null"}, "name": "null" }, "computed": false, "shorthand": false, "value": { "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/fixtures/core/uncategorised/260/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/260/output.json index ea1e209f24..23e0a043e2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/260/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/260/output.json @@ -1,95 +1,29 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":1,"end":22,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":22}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":11,"end":22,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":22}}, "body": [ { "type": "ReturnStatement", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "argument": null } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/261/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/261/output.json index c0cd7f5516..b6cb58fdb0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/261/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/261/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":1,"end":24,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":24}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":11,"end":24,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":24}}, "body": [ { "type": "ReturnStatement", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":13,"end":22,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":22}}, "argument": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/262/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/262/output.json index dc6bc1917e..129603ce64 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/262/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/262/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":1,"end":27,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":27}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":11,"end":27,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":27}}, "body": [ { "type": "ReturnStatement", - "start": 13, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":13,"end":25,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":25}}, "argument": { "type": "BinaryExpression", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25}}, "left": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"x"}, "name": "x" }, "operator": "*", "right": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "y" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"y"}, "name": "y" } } 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 738083370c..ccc3410c91 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/263/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/263/output.json @@ -1,126 +1,35 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WithStatement", - "start": 17, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":17,"end":36,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":36}}, "object": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"x"}, "name": "x" }, "body": { "type": "ExpressionStatement", - "start": 26, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":26,"end":36,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":36}}, "expression": { "type": "AssignmentExpression", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":26,"end":35,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":35}}, "operator": "=", "left": { "type": "Identifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "foo" - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "bar" - }, + "start":32,"end":35,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":35},"identifierName":"bar"}, "name": "bar" } } @@ -130,32 +39,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use\\x20strict", "extra": { "raw": "'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 3ff3f82cfe..10bfd0ed11 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/264/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/264/output.json @@ -1,126 +1,35 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WithStatement", - "start": 17, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":17,"end":36,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":36}}, "object": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"x"}, "name": "x" }, "body": { "type": "ExpressionStatement", - "start": 26, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":26,"end":36,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":36}}, "expression": { "type": "AssignmentExpression", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":26,"end":35,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":35}}, "operator": "=", "left": { "type": "Identifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "foo" - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "bar" - }, + "start":32,"end":35,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":35},"identifierName":"bar"}, "name": "bar" } } @@ -130,32 +39,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use\\x20strict", "extra": { "raw": "\"use\\x20strict\"", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/265/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/265/output.json index de556d5854..4e092c03ea 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/265/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/265/output.json @@ -1,126 +1,35 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WithStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "object": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "body": { "type": "ExpressionStatement", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "expression": { "type": "AssignmentExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "operator": "=", "left": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "bar" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/266/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/266/output.json index b8b6377905..4f5b295c2b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/266/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/266/output.json @@ -1,126 +1,35 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WithStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "object": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "body": { "type": "ExpressionStatement", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19}}, "expression": { "type": "AssignmentExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "operator": "=", "left": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "bar" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/267/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/267/output.json index 67715145c7..7675a58299 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/267/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/267/output.json @@ -1,141 +1,39 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WithStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "object": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "body": { "type": "BlockStatement", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "body": [ { "type": "ExpressionStatement", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20}}, "expression": { "type": "AssignmentExpression", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20}}, "operator": "=", "left": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "bar" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/268/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/268/output.json index 2676e60076..191390407c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/268/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/268/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "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}}, "discriminant": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, "cases": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/269/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/269/output.json index 26eb0ec7e2..34304235c8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/269/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/269/output.json @@ -1,124 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "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}}, "discriminant": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "answer" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"answer"}, "name": "answer" }, "cases": [ { "type": "SwitchCase", - "start": 18, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":18,"end":39,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":39}}, "consequent": [ { "type": "ExpressionStatement", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32}}, "expression": { "type": "CallExpression", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31}}, "callee": { "type": "Identifier", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "hi" - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29},"identifierName":"hi"}, "name": "hi" }, "arguments": [] @@ -126,35 +36,13 @@ }, { "type": "BreakStatement", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":33,"end":39,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":39}}, "label": null } ], "test": { "type": "NumericLiteral", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/27/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/27/output.json index 367eac5310..e5cdd1426d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/27/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/27/output.json @@ -1,124 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "StringLiteral", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "extra": { "rawValue": "answer", "raw": "\"answer\"" @@ -129,18 +40,7 @@ "shorthand": false, "value": { "type": "NumericLiteral", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/270/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/270/output.json index 1295bdfcf9..e91e6f437f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/270/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/270/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "discriminant": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "answer" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"answer"}, "name": "answer" }, "cases": [ { "type": "SwitchCase", - "start": 18, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":18,"end":39,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":39}}, "consequent": [ { "type": "ExpressionStatement", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32}}, "expression": { "type": "CallExpression", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31}}, "callee": { "type": "Identifier", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "hi" - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29},"identifierName":"hi"}, "name": "hi" }, "arguments": [] @@ -126,35 +36,13 @@ }, { "type": "BreakStatement", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":33,"end":39,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":39}}, "label": null } ], "test": { "type": "NumericLiteral", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "extra": { "rawValue": 42, "raw": "42" @@ -164,33 +52,11 @@ }, { "type": "SwitchCase", - "start": 40, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":40,"end":54,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":54}}, "consequent": [ { "type": "BreakStatement", - "start": 49, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":49,"end":54,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":54}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/271/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/271/output.json index acbeba45c5..9a1c53c853 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/271/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/271/output.json @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "body": { "type": "ForStatement", - "start": 7, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":7,"end":27,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":27}}, "init": null, "test": null, "update": null, "body": { "type": "BreakStatement", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":16,"end":27,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":27}}, "label": { "type": "Identifier", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "start" - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27},"identifierName":"start"}, "name": "start" } } }, "label": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "start" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"start"}, "name": "start" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/272/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/272/output.json index 5251cd078d..758f4d4bd8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/272/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/272/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "body": { "type": "WhileStatement", - "start": 7, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":7,"end":31,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":31}}, "test": { "type": "BooleanLiteral", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}}, "value": true }, "body": { "type": "BreakStatement", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "label": { "type": "Identifier", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "start" - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31},"identifierName":"start"}, "name": "start" } } }, "label": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "start" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"start"}, "name": "start" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/273/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/273/output.json index 4d485ddd96..16e82da75c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/273/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/273/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ThrowStatement", - "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}}, "argument": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/274/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/274/output.json index 0099a2d97e..2835e74689 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/274/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/274/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ThrowStatement", - "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}}, "argument": { "type": "BinaryExpression", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "left": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "operator": "*", "right": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "y" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"y"}, "name": "y" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/275/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/275/output.json index ef879544f9..5caef91e52 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/275/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/275/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ThrowStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "argument": { "type": "ObjectExpression", - "start": 6, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":6,"end":26,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":26}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":8,"end":24,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":24}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "message" - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15},"identifierName":"message"}, "name": "message" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}}, "extra": { "rawValue": "Error", "raw": "\"Error\"" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/276/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/276/output.json index 7124a7ba6f..cb43070c27 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/276/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/276/output.json @@ -1,110 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "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}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":8,"end":21,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":21}}, "param": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "e" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"e"}, "name": "e" }, "body": { "type": "BlockStatement", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/277/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/277/output.json index 0f104da5ae..bca060357b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/277/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/277/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":8,"end":24,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":24}}, "param": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "eval" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"eval"}, "name": "eval" }, "body": { "type": "BlockStatement", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/278/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/278/output.json index 8721f9d984..d1a65bb67c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/278/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/278/output.json @@ -1,110 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "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}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":8,"end":29,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":29}}, "param": { "type": "Identifier", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "arguments" - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24},"identifierName":"arguments"}, "name": "arguments" }, "body": { "type": "BlockStatement", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/279/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/279/output.json index 49094bb0e6..fb80b314fa 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/279/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/279/output.json @@ -1,172 +1,48 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":8,"end":28,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":28}}, "param": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "e" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"e"}, "name": "e" }, "body": { "type": "BlockStatement", - "start": 18, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":18,"end":28,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":28}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26}}, "expression": { "type": "CallExpression", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26}}, "callee": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "say" - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23},"identifierName":"say"}, "name": "say" }, "arguments": [ { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "e" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"e"}, "name": "e" } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/28/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/28/output.json index 81194dadc7..b8f82071b2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/28/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/28/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "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": "ObjectExpression", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":4,"end":18,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":18}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "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" @@ -147,52 +46,18 @@ }, { "type": "ObjectProperty", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/280/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/280/output.json index b1589f69dc..a079acf849 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/280/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/280/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "body": [], "directives": [] }, "handler": null, "finalizer": { "type": "BlockStatement", - "start": 16, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":16,"end":34,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":34}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "expression": { "type": "CallExpression", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "callee": { "type": "Identifier", - "start": 18, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "cleanup" - }, + "start":18,"end":25,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":25},"identifierName":"cleanup"}, "name": "cleanup" }, "arguments": [ { "type": "Identifier", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "stuff" - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31},"identifierName":"stuff"}, "name": "stuff" } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/281/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/281/output.json index 7bb5acfbed..0453b860b1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/281/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/281/output.json @@ -1,106 +1,28 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "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}}, "block": { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "expression": { "type": "CallExpression", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "callee": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "doThat" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"doThat"}, "name": "doThat" }, "arguments": [] @@ -111,111 +33,31 @@ }, "handler": { "type": "CatchClause", - "start": 18, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":18,"end":38,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":38}}, "param": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "e" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"e"}, "name": "e" }, "body": { "type": "BlockStatement", - "start": 28, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":28,"end":38,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":38}}, "body": [ { "type": "ExpressionStatement", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}}, "expression": { "type": "CallExpression", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}}, "callee": { "type": "Identifier", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "say" - }, + "start":30,"end":33,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":33},"identifierName":"say"}, "name": "say" }, "arguments": [ { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "e" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"e"}, "name": "e" } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/282/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/282/output.json index 91b0085400..bddc435c75 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/282/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/282/output.json @@ -1,106 +1,28 @@ { "type": "File", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":65}}, "program": { "type": "Program", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":65}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":65}}, "block": { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "expression": { "type": "CallExpression", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "callee": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "doThat" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"doThat"}, "name": "doThat" }, "arguments": [] @@ -111,111 +33,31 @@ }, "handler": { "type": "CatchClause", - "start": 18, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":18,"end":38,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":38}}, "param": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "e" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"e"}, "name": "e" }, "body": { "type": "BlockStatement", - "start": 28, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":28,"end":38,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":38}}, "body": [ { "type": "ExpressionStatement", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}}, "expression": { "type": "CallExpression", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}}, "callee": { "type": "Identifier", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "say" - }, + "start":30,"end":33,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":33},"identifierName":"say"}, "name": "say" }, "arguments": [ { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "e" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"e"}, "name": "e" } ] @@ -227,80 +69,23 @@ }, "finalizer": { "type": "BlockStatement", - "start": 47, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":47,"end":65,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":65}}, "body": [ { "type": "ExpressionStatement", - "start": 49, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":49,"end":63,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":63}}, "expression": { "type": "CallExpression", - "start": 49, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":49,"end":63,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":63}}, "callee": { "type": "Identifier", - "start": 49, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 56 - }, - "identifierName": "cleanup" - }, + "start":49,"end":56,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":56},"identifierName":"cleanup"}, "name": "cleanup" }, "arguments": [ { "type": "Identifier", - "start": 57, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 62 - }, - "identifierName": "stuff" - }, + "start":57,"end":62,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":62},"identifierName":"stuff"}, "name": "stuff" } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/283/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/283/output.json index 86fbfde778..a0ef6bdc2f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/283/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/283/output.json @@ -1,48 +1,15 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "DebuggerStatement", - "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}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/284/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/284/output.json index d5cdac1d36..352ffb6fc1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/284/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/284/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -65,62 +20,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "expression": { "type": "CallExpression", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}}, "callee": { "type": "Identifier", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "sayHi" - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24},"identifierName":"sayHi"}, "name": "sayHi" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/285/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/285/output.json index 3104ab9ccf..91afc6eae0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/285/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/285/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "eval" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -65,18 +20,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/286/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/286/output.json index d26abaf0e3..e14cc06b04 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/286/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/286/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "arguments" - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18},"identifierName":"arguments"}, "name": "arguments" }, "generator": false, @@ -65,18 +20,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/287/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/287/output.json index db77094d78..02b469112a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/287/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/287/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "test" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"test"}, "name": "test" }, "generator": false, @@ -65,53 +20,18 @@ "params": [ { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "t" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"t"}, "name": "t" }, { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "t" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"t"}, "name": "t" } ], "body": { "type": "BlockStatement", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/288/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/288/output.json index 1d7e31b526..518d4ff517 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/288/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/288/output.json @@ -1,77 +1,21 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":1,"end":24,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "test" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"test"}, "name": "test" }, "generator": false, @@ -79,53 +23,18 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "t" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"t"}, "name": "t" }, { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "t" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"t"}, "name": "t" } ], "body": { "type": "BlockStatement", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24}}, "body": [], "directives": [] }, 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 77acd2e88e..68368affc1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/289/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/289/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "eval" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -65,48 +20,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":16,"end":53,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":53}}, "body": [ { "type": "FunctionDeclaration", - "start": 18, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":18,"end":51,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":51}}, "id": { "type": "Identifier", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "inner" - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32},"identifierName":"inner"}, "name": "inner" }, "generator": false, @@ -114,48 +35,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 35, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":35,"end":51,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":51}}, "body": [], "directives": [ { "type": "Directive", - "start": 37, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":37,"end":49,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":49}}, "value": { "type": "DirectiveLiteral", - "start": 37, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":37,"end":49,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":49}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/29/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/29/output.json index ea42451525..834b20a1eb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/29/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/29/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":4,"end":38,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":38}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":6,"end":36,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":36}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "width" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"width"}, "name": "width" }, "computed": false, @@ -130,48 +40,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":18,"end":36,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":36}}, "body": [ { "type": "ReturnStatement", - "start": 20, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":20,"end":34,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":34}}, "argument": { "type": "Identifier", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "m_width" - }, + "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34},"identifierName":"m_width"}, "name": "m_width" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/290/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/290/output.json index a0915a8bde..058bf6f3e4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/290/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/290/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -65,80 +20,23 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "expression": { "type": "CallExpression", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27}}, "callee": { "type": "Identifier", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "sayHi" - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"sayHi"}, "name": "sayHi" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/291/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/291/output.json index 4a6668b95a..2c224fe253 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/291/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/291/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -65,97 +20,28 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "b" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"b"}, "name": "b" } ], "body": { "type": "BlockStatement", - "start": 21, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, "body": [ { "type": "ExpressionStatement", - "start": 23, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":23,"end":31,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":31}}, "expression": { "type": "CallExpression", - "start": 23, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":23,"end":30,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":30}}, "callee": { "type": "Identifier", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "sayHi" - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28},"identifierName":"sayHi"}, "name": "sayHi" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/292/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/292/output.json index a110a24d43..fded91217c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/292/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/292/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -65,51 +20,17 @@ "params": [ { "type": "RestElement", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22}}, "argument": { "type": "Identifier", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "rest" - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22},"identifierName":"rest"}, "name": "rest" } } ], "body": { "type": "BlockStatement", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/293/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/293/output.json index 9750c148e9..3cacc47f31 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/293/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/293/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -65,68 +20,22 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "start": 18, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":18,"end":25,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":25}}, "argument": { "type": "Identifier", - "start": 21, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "rest" - }, + "start":21,"end":25,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":25},"identifierName":"rest"}, "name": "rest" } } ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/294/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/294/output.json index ad99f992e1..834ffa769d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/294/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/294/output.json @@ -1,156 +1,44 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":4,"end":31,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "hi" - }, + "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6},"identifierName":"hi"}, "name": "hi" }, "init": { "type": "FunctionExpression", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "body": [ { "type": "ExpressionStatement", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29}}, "expression": { "type": "CallExpression", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29}}, "callee": { "type": "Identifier", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "sayHi" - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27},"identifierName":"sayHi"}, "name": "sayHi" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/295/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/295/output.json index bc58b11365..843a9d4db0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/295/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/295/output.json @@ -1,189 +1,54 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "hi" - }, + "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6},"identifierName":"hi"}, "name": "hi" }, "init": { "type": "FunctionExpression", - "start": 9, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":9,"end":36,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":36}}, "id": null, "generator": false, "async": false, "params": [ { "type": "RestElement", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":19,"end":23,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":23}}, "argument": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "r" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"r"}, "name": "r" } } ], "body": { "type": "BlockStatement", - "start": 25, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":25,"end":36,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":36}}, "body": [ { "type": "ExpressionStatement", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34}}, "expression": { "type": "CallExpression", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34}}, "callee": { "type": "Identifier", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "sayHi" - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32},"identifierName":"sayHi"}, "name": "sayHi" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/296/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/296/output.json index c6c506d544..902977b899 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/296/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/296/output.json @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":4,"end":28,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "hi" - }, + "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6},"identifierName":"hi"}, "name": "hi" }, "init": { "type": "FunctionExpression", - "start": 9, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":9,"end":28,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "eval" - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -111,18 +32,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":25,"end":28,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":28}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/297/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/297/output.json index 2c6c0d75a8..695e91aedd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/297/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/297/output.json @@ -1,109 +1,30 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":4,"end":33,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "hi" - }, + "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6},"identifierName":"hi"}, "name": "hi" }, "init": { "type": "FunctionExpression", - "start": 9, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "arguments" - }, + "start":18,"end":27,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":27},"identifierName":"arguments"}, "name": "arguments" }, "generator": false, @@ -111,18 +32,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":30,"end":33,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/298/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/298/output.json index 7f0a025696..26b3458197 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/298/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/298/output.json @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":4,"end":37,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "hello" - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9},"identifierName":"hello"}, "name": "hello" }, "init": { "type": "FunctionExpression", - "start": 12, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":12,"end":37,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "hi" - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23},"identifierName":"hi"}, "name": "hi" }, "generator": false, @@ -111,62 +32,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 26, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":26,"end":37,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":37}}, "body": [ { "type": "ExpressionStatement", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35}}, "expression": { "type": "CallExpression", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35}}, "callee": { "type": "Identifier", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "sayHi" - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33},"identifierName":"sayHi"}, "name": "sayHi" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/299/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/299/output.json index aefb638ad9..cbd2d18d22 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/299/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/299/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/3/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/3/output.json index bf57e074cc..ab48d0f9ef 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/3/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/3/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":5,"end":7,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "expression": { "type": "NumericLiteral", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":5,"end":7,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/30/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/30/output.json index 9392a4586d..67a3af336f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/30/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/30/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "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": "ObjectExpression", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":6,"end":20,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "undef" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"undef"}, "name": "undef" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/300/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/300/output.json index 110a8a000b..2b437f1204 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/300/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/300/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "body": [ { "type": "ExpressionStatement", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "expression": { "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" } }, { "type": "ExpressionStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":4,"end":7,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "expression": { "type": "UpdateExpression", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":4,"end":7,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "operator": "++", "prefix": true, "argument": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "y" - }, + "start":6,"end":7,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"y"}, "name": "y" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/301/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/301/output.json index 867fc3fc00..c289ddae85 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/301/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/301/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "body": [ { "type": "ExpressionStatement", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "expression": { "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" } }, { "type": "ExpressionStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":4,"end":7,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "expression": { "type": "UpdateExpression", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":4,"end":7,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "operator": "--", "prefix": true, "argument": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "y" - }, + "start":6,"end":7,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"y"}, "name": "y" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/302/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/302/output.json index 412ba4db54..6ee561c3d4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/302/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/302/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": null, @@ -80,18 +24,7 @@ { "type": "CommentBlock", "value": " comment ", - "start": 6, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}} } ] } @@ -105,18 +38,7 @@ { "type": "CommentBlock", "value": " comment ", - "start": 6, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/303/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/303/output.json index d4e339d66f..fb37cb7dd9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/303/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/303/output.json @@ -1,109 +1,31 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "body": [ { "type": "VariableDeclaration", - "start": 2, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":2,"end":19,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 14, "raw": "14" @@ -113,49 +35,15 @@ }, { "type": "VariableDeclarator", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "y" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"y"}, "name": "y" }, "init": { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 3, "raw": "3" @@ -168,33 +56,10 @@ }, { "type": "ExpressionStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":20,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "expression": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "z" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/304/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/304/output.json index ccd2a5557c..50691134a0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/304/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/304/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":13,"end":32,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":8}}, "body": [ { "type": "ContinueStatement", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "label": null }, { "type": "ExpressionStatement", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":24,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "there" - }, + "start":24,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5},"identifierName":"there"}, "name": "there" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/305/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/305/output.json index 3fcb48aa32..79fce2dd49 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/305/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/305/output.json @@ -1,160 +1,49 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":13,"end":43,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":8}}, "body": [ { "type": "ContinueStatement", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "label": null, "trailingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 24, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 34 - } - } + "start":24,"end":34,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":34}} } ] }, { "type": "ExpressionStatement", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":35,"end":41,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 35, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "there" - }, + "start":35,"end":40,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5},"identifierName":"there"}, "name": "there" }, "leadingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 24, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 34 - } - } + "start":24,"end":34,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":34}} } ] } @@ -169,18 +58,7 @@ { "type": "CommentLine", "value": " Comment", - "start": 24, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 34 - } - } + "start":24,"end":34,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":34}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/306/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/306/output.json index 395230285f..a496fcfd3a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/306/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/306/output.json @@ -1,160 +1,49 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":13,"end":55,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":18}}, "body": [ { "type": "ContinueStatement", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "label": null, "trailingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 24, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":24,"end":47,"loc":{"start":{"line":1,"column":24},"end":{"line":2,"column":10}} } ] }, { "type": "ExpressionStatement", - "start": 47, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":47,"end":53,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}}, "expression": { "type": "Identifier", - "start": 47, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "there" - }, + "start":47,"end":52,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":15},"identifierName":"there"}, "name": "there" }, "leadingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 24, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":24,"end":47,"loc":{"start":{"line":1,"column":24},"end":{"line":2,"column":10}} } ] } @@ -169,18 +58,7 @@ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 24, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":24,"end":47,"loc":{"start":{"line":1,"column":24},"end":{"line":2,"column":10}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/307/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/307/output.json index 40442d2489..8e63588753 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/307/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/307/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":13,"end":29,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":8}}, "body": [ { "type": "BreakStatement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "label": null }, { "type": "ExpressionStatement", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":21,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "there" - }, + "start":21,"end":26,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5},"identifierName":"there"}, "name": "there" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/308/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/308/output.json index 074c0c8bb6..db5aabc02b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/308/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/308/output.json @@ -1,160 +1,49 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":13,"end":40,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":8}}, "body": [ { "type": "BreakStatement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "label": null, "trailingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 21, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":21,"end":31,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":31}} } ] }, { "type": "ExpressionStatement", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":32,"end":38,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 32, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "there" - }, + "start":32,"end":37,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5},"identifierName":"there"}, "name": "there" }, "leadingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 21, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":21,"end":31,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":31}} } ] } @@ -169,18 +58,7 @@ { "type": "CommentLine", "value": " Comment", - "start": 21, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":21,"end":31,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":31}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/309/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/309/output.json index f58cfb0778..07e673f84e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/309/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/309/output.json @@ -1,160 +1,49 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":13,"end":52,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":18}}, "body": [ { "type": "BreakStatement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "label": null, "trailingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 21, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":21,"end":44,"loc":{"start":{"line":1,"column":21},"end":{"line":2,"column":10}} } ] }, { "type": "ExpressionStatement", - "start": 44, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":44,"end":50,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}}, "expression": { "type": "Identifier", - "start": 44, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "there" - }, + "start":44,"end":49,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":15},"identifierName":"there"}, "name": "there" }, "leadingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 21, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":21,"end":44,"loc":{"start":{"line":1,"column":21},"end":{"line":2,"column":10}} } ] } @@ -169,18 +58,7 @@ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 21, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":21,"end":44,"loc":{"start":{"line":1,"column":21},"end":{"line":2,"column":10}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/31/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/31/output.json index 96fd3b7e93..0bd7432907 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/31/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/31/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "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": "ObjectExpression", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "if" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"if"}, "name": "if" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/310/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/310/output.json index a6f087d5e2..90a7b471fe 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/310/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/310/output.json @@ -1,126 +1,37 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":1,"end":24,"loc":{"start":{"line":1,"column":1},"end":{"line":2,"column":4}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":11,"end":24,"loc":{"start":{"line":1,"column":11},"end":{"line":2,"column":4}}, "body": [ { "type": "ReturnStatement", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}}, "argument": null }, { "type": "ExpressionStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":20,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "expression": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/311/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/311/output.json index 205e7e5731..636d44f1ca 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/311/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/311/output.json @@ -1,162 +1,51 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":2,"column":4}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":11,"end":35,"loc":{"start":{"line":1,"column":11},"end":{"line":2,"column":4}}, "body": [ { "type": "ReturnStatement", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}}, "argument": null, "trailingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}} } ] }, { "type": "ExpressionStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":31,"end":33,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "expression": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "x" - }, + "start":31,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"x"}, "name": "x" }, "leadingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}} } ] } @@ -176,18 +65,7 @@ { "type": "CommentLine", "value": " Comment", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/312/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/312/output.json index 98570e79f9..a7c128bbeb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/312/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/312/output.json @@ -1,162 +1,51 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":1,"end":46,"loc":{"start":{"line":1,"column":1},"end":{"line":2,"column":14}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":11,"end":46,"loc":{"start":{"line":1,"column":11},"end":{"line":2,"column":14}}, "body": [ { "type": "ReturnStatement", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}}, "argument": null, "trailingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 19, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":19,"end":42,"loc":{"start":{"line":1,"column":19},"end":{"line":2,"column":10}} } ] }, { "type": "ExpressionStatement", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":42,"end":44,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":12}}, "expression": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":42,"end":43,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" }, "leadingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 19, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":19,"end":42,"loc":{"start":{"line":1,"column":19},"end":{"line":2,"column":10}} } ] } @@ -176,18 +65,7 @@ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 19, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":19,"end":42,"loc":{"start":{"line":1,"column":19},"end":{"line":2,"column":10}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/313/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/313/output.json index aed9954aa3..e6e9eaa784 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/313/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/313/output.json @@ -1,110 +1,31 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "body": [ { "type": "ThrowStatement", - "start": 2, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":2,"end":13,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":13}}, "argument": { "type": "Identifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "error" - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"error"}, "name": "error" } }, { "type": "ExpressionStatement", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":14,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "error" - }, + "start":14,"end":19,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5},"identifierName":"error"}, "name": "error" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/314/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/314/output.json index ab8810f09c..5929da115c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/314/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/314/output.json @@ -1,146 +1,45 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "body": [ { "type": "ThrowStatement", - "start": 2, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":2,"end":13,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":13}}, "argument": { "type": "Identifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "error" - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"error"}, "name": "error" }, "trailingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":13,"end":23,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":23}} } ] }, { "type": "ExpressionStatement", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":24,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "error" - }, + "start":24,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5},"identifierName":"error"}, "name": "error" }, "leadingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":13,"end":23,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":23}} } ] } @@ -154,18 +53,7 @@ { "type": "CommentLine", "value": " Comment", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":13,"end":23,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":23}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/315/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/315/output.json index 183a587ddc..97e46379c3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/315/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/315/output.json @@ -1,146 +1,45 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "body": [ { "type": "ThrowStatement", - "start": 2, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":2,"end":13,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":13}}, "argument": { "type": "Identifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "error" - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"error"}, "name": "error" }, "trailingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 13, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":13,"end":36,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":10}} } ] }, { "type": "ExpressionStatement", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":36,"end":42,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}}, "expression": { "type": "Identifier", - "start": 36, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "error" - }, + "start":36,"end":41,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":15},"identifierName":"error"}, "name": "error" }, "leadingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 13, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":13,"end":36,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":10}} } ] } @@ -154,18 +53,7 @@ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 13, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":13,"end":36,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":10}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/316/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/316/output.json index 145f80b57b..6146b79739 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/316/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/316/output.json @@ -1,31 +1,9 @@ { "type": "File", - "start": 0, - "end": 0, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 0 - } - }, + "start":0,"end":0,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":0}}, "program": { "type": "Program", - "start": 0, - "end": 0, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 0 - } - }, + "start":0,"end":0,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":0}}, "sourceType": "script", "interpreter": null, "body": [], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/317/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/317/output.json index 6ff0a1889e..91415c46c8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/317/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/317/output.json @@ -1,107 +1,29 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "body": { "type": "IfStatement", - "start": 5, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":5,"end":25,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":25}}, "test": { "type": "BooleanLiteral", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "value": true }, "consequent": { "type": "BreakStatement", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":15,"end":25,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":25}}, "label": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "foo" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"foo"}, "name": "foo" } }, @@ -109,19 +31,7 @@ }, "label": { "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" } } 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 c9d958dcaa..07b0ebfb1a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/318/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/318/output.json @@ -1,124 +1,36 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 4 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 4 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 4 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":4}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":1,"end":39,"loc":{"start":{"line":1,"column":1},"end":{"line":4,"column":3}}, "callee": { "type": "FunctionExpression", - "start": 1, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":1,"end":37,"loc":{"start":{"line":1,"column":1},"end":{"line":4,"column":1}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":13,"end":37,"loc":{"start":{"line":1,"column":13},"end":{"line":4,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 16, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":16,"end":29,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":14}}, "value": { "type": "DirectiveLiteral", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":16,"end":28,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":13}}, "value": "use strict", "extra": { "raw": "'use strict'", @@ -128,32 +40,10 @@ }, { "type": "Directive", - "start": 31, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":31,"end":35,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":5}}, "value": { "type": "DirectiveLiteral", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":31,"end":34,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":4}}, "value": "\u0000", "extra": { "raw": "'\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 5f9a367005..0652e0f830 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/319/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/319/output.json @@ -1,90 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "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": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 123, "raw": "123." @@ -93,19 +27,7 @@ }, "property": { "type": "Identifier", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "toString" - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13},"identifierName":"toString"}, "name": "toString" }, "computed": false @@ -113,18 +35,7 @@ "arguments": [ { "type": "NumericLiteral", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "extra": { "rawValue": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/32/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/32/output.json index b3ef7da7ca..dea4eee607 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/32/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/32/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":4,"end":21,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":21}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "true" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"true"}, "name": "true" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/320/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/320/output.json index 1b6d860e3c..c4cf365f62 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/320/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/320/output.json @@ -1,76 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 123, "raw": "123." @@ -80,18 +25,7 @@ "operator": "+", "right": { "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": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/321/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/321/output.json index adac14cf88..1f23cac3b6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/321/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/321/output.json @@ -1,95 +1,27 @@ { "type": "File", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } }, { "type": "ExpressionStatement", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":2,"end":3,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1}}, "expression": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "b" - }, + "start":2,"end":3,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"b"}, "name": "b" } } 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 511f68de82..86a454183f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/322/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/322/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "a\\u0026b", "extra": { "raw": "'a\\u0026b'", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/323/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/323/output.json index 91c5a480cf..1f2858e789 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/323/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/323/output.json @@ -1,76 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "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}}, "body": { "type": "ExpressionStatement", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "expression": { "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": 10, "raw": "10" @@ -80,64 +25,19 @@ }, "label": { "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" } }, { "type": "LabeledStatement", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "body": { "type": "ExpressionStatement", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "expression": { "type": "NumericLiteral", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "extra": { "rawValue": 20, "raw": "20" @@ -147,19 +47,7 @@ }, "label": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/324/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/324/output.json index db94d9b88a..e0a04f74bd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/324/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/324/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "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}}, "test": { "type": "NumericLiteral", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4}}, "extra": { "rawValue": 1, "raw": "1" @@ -65,32 +21,10 @@ }, "consequent": { "type": "ExpressionStatement", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "expression": { "type": "RegExpLiteral", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "extra": { "raw": "/ foo/" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/325/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/325/output.json index 74d07f2d4c..58ddd297b5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/325/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/325/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "price_9̶9̶_89" - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":13},"identifierName":"price_9̶9̶_89"}, "name": "price_9̶9̶_89" } } 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 3c7e8925fa..f86ce18fe5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/326/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/326/output.json @@ -1,108 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "left": { "type": "MemberExpression", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "object": { "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" }, "property": { "type": "Identifier", - "start": 2, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "in" - }, + "start":2,"end":4,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":4},"identifierName":"in"}, "name": "in" }, "computed": false @@ -110,19 +31,7 @@ "operator": "/", "right": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "b" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/327/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/327/output.json index e99a33b544..53c2b7304b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/327/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/327/output.json @@ -1,93 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ReturnStatement", - "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}}, "argument": { "type": "BinaryExpression", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "left": { "type": "ObjectExpression", - "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}}, "properties": [] }, "operator": "/", "right": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/328/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/328/output.json index d3904d2ba2..7e3261f57e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/328/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/328/output.json @@ -1,95 +1,29 @@ { "type": "File", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ReturnStatement", - "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}}, "argument": null }, { "type": "BlockStatement", - "start": 7, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":7,"end":9,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "body": [], "directives": [] }, { "type": "ExpressionStatement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":10,"end":15,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":5}}, "expression": { "type": "RegExpLiteral", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":10,"end":15,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":5}}, "extra": { "raw": "/foo/" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/329/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/329/output.json index 0625ca7597..6601db0580 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/329/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/329/output.json @@ -1,110 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "UnaryExpression", - "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": "ObjectExpression", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "properties": [] } }, "operator": "/", "right": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/33/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/33/output.json index e055a31d00..17909837b8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/33/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/33/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "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": "ObjectExpression", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":6,"end":20,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "false" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"false"}, "name": "false" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/330/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/330/output.json index 219acad008..8b551d3126 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/330/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/330/output.json @@ -1,79 +1,24 @@ { "type": "File", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [], "directives": [] }, { "type": "ExpressionStatement", - "start": 3, - "end": 8, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":3,"end":8,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}}, "expression": { "type": "RegExpLiteral", - "start": 3, - "end": 8, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":3,"end":8,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}}, "extra": { "raw": "/foo/" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/331/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/331/output.json index 5d71c2b58f..afb15fd5fb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/331/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/331/output.json @@ -1,128 +1,39 @@ { "type": "File", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } }, { "type": "BlockStatement", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":4,"end":6,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "body": [], "directives": [] }, { "type": "ExpressionStatement", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":7,"end":12,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":5}}, "expression": { "type": "RegExpLiteral", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":7,"end":12,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":5}}, "extra": { "raw": "/foo/" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/332/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/332/output.json index 3ca6c097e9..feba7e6eac 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/332/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/332/output.json @@ -1,94 +1,28 @@ { "type": "File", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "body": [ { "type": "BlockStatement", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "body": [], "directives": [] }, { "type": "ExpressionStatement", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":4,"end":9,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}}, "expression": { "type": "RegExpLiteral", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":4,"end":9,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}}, "extra": { "raw": "/foo/" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/333/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/333/output.json index 887b2e1ad1..256b8c05ae 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/333/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/333/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "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}}, "test": { "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": 1, "raw": "1" @@ -65,32 +21,10 @@ }, "body": { "type": "ExpressionStatement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "expression": { "type": "RegExpLiteral", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "extra": { "raw": "/foo/" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/334/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/334/output.json index 781d5a1bad..b2ddf7c3cc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/334/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/334/output.json @@ -1,76 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "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", @@ -82,18 +27,7 @@ "operator": "/", "right": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/335/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/335/output.json index 56da6db363..3d544b67bd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/335/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/335/output.json @@ -1,154 +1,43 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "BinaryExpression", - "start": 1, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, "left": { "type": "ObjectExpression", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":2,"end":8,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":8}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ArrayExpression", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "elements": [ { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -163,18 +52,7 @@ "operator": "+", "right": { "type": "ArrayExpression", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "elements": [] }, "extra": { @@ -185,18 +63,7 @@ "operator": "/", "right": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/336/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/336/output.json index 6687dfac3a..0f449dfd97 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/336/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/336/output.json @@ -1,92 +1,26 @@ { "type": "File", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "expression": { "type": "ArrayExpression", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "elements": [ { "type": "NumericLiteral", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "extra": { "rawValue": 1, "raw": "1" @@ -101,32 +35,10 @@ }, { "type": "ExpressionStatement", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":6,"end":11,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}}, "expression": { "type": "RegExpLiteral", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":6,"end":11,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}}, "extra": { "raw": "/foo/" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/337/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/337/output.json index da4ac2be40..4f66727643 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/337/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/337/output.json @@ -1,126 +1,37 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "discriminant": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, "cases": [ { "type": "SwitchCase", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":12,"end":28,"loc":{"start":{"line":1,"column":12},"end":{"line":2,"column":5}}, "consequent": [ { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] }, { "type": "ExpressionStatement", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":23,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}}, "expression": { "type": "RegExpLiteral", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":23,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}}, "extra": { "raw": "/foo/" }, @@ -131,18 +42,7 @@ ], "test": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/338/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/338/output.json index 77346f3909..9d16601e56 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/338/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/338/output.json @@ -1,92 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":2,"end":11,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":11}}, "method": false, "key": { "type": "NumericLiteral", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "extra": { "rawValue": 1, "raw": "1" @@ -97,49 +31,16 @@ "shorthand": false, "value": { "type": "BinaryExpression", - "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": "ObjectExpression", - "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}}, "properties": [] }, "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": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/339/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/339/output.json index 62ef9146ea..1189e92737 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/339/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/339/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "left": { "type": "UnaryExpression", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "operator": "+", "prefix": true, "argument": { "type": "UpdateExpression", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "operator": "++", "prefix": false, "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" } } @@ -111,18 +33,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" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/34/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/34/output.json index 2ba79ca360..ac45a4338b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/34/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/34/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":4,"end":21,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":21}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "null" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"null"}, "name": "null" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } 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 7ccd83051b..57a5959b41 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/340/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/340/output.json @@ -1,94 +1,26 @@ { "type": "File", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "MemberExpression", - "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}}, "object": { "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" }, "property": { "type": "Identifier", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "in" - }, + "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6},"identifierName":"in"}, "name": "in" }, "computed": false @@ -96,49 +28,16 @@ }, { "type": "BlockStatement", - "start": 7, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":7,"end":9,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "body": [], "directives": [] }, { "type": "ExpressionStatement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":10,"end":15,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":5}}, "expression": { "type": "RegExpLiteral", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":10,"end":15,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":5}}, "extra": { "raw": "/foo/" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/341/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/341/output.json index 395326a8c6..856912990e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/341/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/341/output.json @@ -1,79 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [], "directives": [] }, { "type": "ExpressionStatement", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, "expression": { "type": "RegExpLiteral", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, "extra": { "raw": "/=/" }, 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 8db37405c8..d6ad31a3e9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/342/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/342/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "left": { "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", "trailingComments": [ { "type": "CommentLine", "value": "bar", - "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}} } ] }, "operator": "+", "right": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "baz" - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":4},"identifierName":"baz"}, "name": "baz", "leadingComments": [ { "type": "CommentLine", "value": "bar", - "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}} } ] } @@ -137,18 +47,7 @@ { "type": "CommentLine", "value": "bar", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/343/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/343/output.json index 8332cec4eb..c4d3d78908 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/343/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/343/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "BinaryExpression", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "left": { "type": "UpdateExpression", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "operator": "--", "prefix": false, "argument": { "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": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": 10, "raw": "10" @@ -150,18 +49,7 @@ { "type": "CommentLine", "value": " nothing", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 12 - } - } + "start":13,"end":24,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":12}} } ] } @@ -172,18 +60,7 @@ { "type": "CommentLine", "value": " nothing", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 12 - } - } + "start":13,"end":24,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":12}} } ] } \ No newline at end of file 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 54af5b6d0b..faed8b5020 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/344/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/344/output.json @@ -1,108 +1,29 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":14,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "expression": { "type": "CallExpression", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":14,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":15}}, "callee": { "type": "MemberExpression", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":14,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "object": { "type": "Identifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "object" - }, + "start":14,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6},"identifierName":"object"}, "name": "object" }, "property": { "type": "Identifier", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "static" - }, + "start":21,"end":27,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":13},"identifierName":"static"}, "name": "static" }, "computed": false @@ -114,32 +35,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json index 284fac8c43..b2d2e40318 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/349/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid number (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "3e" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/35/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/35/output.json index ea3146a858..4e52a2f943 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/35/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/35/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "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": "ObjectExpression", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":6,"end":22,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":22}}, "method": false, "key": { "type": "StringLiteral", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "extra": { "rawValue": "undef", "raw": "\"undef\"" @@ -133,18 +44,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json index 6b6e666b00..1591ec979e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/350/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid number (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "3e+" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json index b52b27d1ef..42c6c5a67a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/351/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid number (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "3e-" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json index ffcb3680fd..9a1a7ea608 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/354/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 16 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": null, "raw": "0x" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/355/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/355/output.json index 22fa47db88..3e85623558 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/355/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/355/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "09" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/356/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/356/output.json index 5be4b4f8c1..03afc3896c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/356/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/356/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 18, "raw": "018" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/36/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/36/output.json index c02bf897d3..620c3d2cc9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/36/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/36/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "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": "ObjectExpression", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, "method": false, "key": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 10, "raw": "10" @@ -133,18 +44,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json index fbb1d3b5d5..5dd7b5d3fc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/361/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "xx\\" - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"xx\\"}, "name": "xx\\" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json index fae32b78cd..d9a89994f0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/362/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid Unicode escape (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x\\" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"x\\"}, "name": "x\\" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json index 37312f42ce..32180fcde9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/363/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid Unicode escape (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x*" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"x*"}, "name": "x*" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json index 68d637a981..d42d61f8a5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/366/output.json @@ -1,98 +1,31 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Invalid regular expression flag (1:16)", "SyntaxError: Invalid regular expression flag (1:18)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":4,"end":18,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":8,"end":18,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":18}}, "extra": { "raw": "/[a-z]/\\ux" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json index 99a3e74a04..d4d2cf5dfe 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/367/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "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": 3, "raw": "3" @@ -83,18 +28,7 @@ }, "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": 4, "raw": "4" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json index 8770df4abb..edc3258403 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/368/output.json @@ -1,113 +1,35 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "CallExpression", - "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}}, "callee": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "func" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"func"}, "name": "func" }, "arguments": [] }, "right": { "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": 4, "raw": "4" 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 ec3792255a..46112c6c88 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/369/output.json @@ -1,95 +1,29 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:1)", "SyntaxError: Invalid left-hand side in assignment expression (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "BinaryExpression", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "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" @@ -99,18 +33,7 @@ "operator": "+", "right": { "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": 1, "raw": "1" @@ -124,18 +47,7 @@ }, "right": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/37/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/37/output.json index a15882b52d..6854d518cf 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/37/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/37/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "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": "ObjectExpression", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":6,"end":34,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":34}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "width" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"width"}, "name": "width" }, "computed": false, @@ -130,98 +40,29 @@ "params": [ { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "w" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"w"}, "name": "w" } ], "body": { "type": "BlockStatement", - "start": 19, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":19,"end":34,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":34}}, "body": [ { "type": "ExpressionStatement", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "expression": { "type": "AssignmentExpression", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "operator": "=", "left": { "type": "Identifier", - "start": 21, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "m_width" - }, + "start":21,"end":28,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":28},"identifierName":"m_width"}, "name": "m_width" }, "right": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "w" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"w"}, "name": "w" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json index ce2cb3d23d..89b9c579fa 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/370/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in postfix operation (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "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": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json index 57d55fec0b..b0387fd4ff 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/371/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in postfix operation (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "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": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json index 9a7a240c5b..e86e86ca22 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/372/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in prefix operation (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "NumericLiteral", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json index 85107220da..de49f7815b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/373/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in prefix operation (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "NumericLiteral", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "extra": { "rawValue": 1, "raw": "1" 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 6cbd087660..609aed8d62 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/374/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:5)", "SyntaxError: Invalid left-hand side in for-in statement (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "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}}, "left": { "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": "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": 1, "raw": "1" @@ -84,18 +29,7 @@ "operator": "+", "right": { "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" @@ -109,82 +43,24 @@ }, "right": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "list" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "expression": { "type": "CallExpression", - "start": 21, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":21,"end":31,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":31}}, "callee": { "type": "Identifier", - "start": 21, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "process" - }, + "start":21,"end":28,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":28},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "x" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/38/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/38/output.json index d672770fbc..c1d2713e76 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/38/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/38/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "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": "ObjectExpression", - "start": 4, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":4,"end":30,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":30}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":6,"end":28,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":28}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "if" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"if"}, "name": "if" }, "computed": false, @@ -130,98 +40,29 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "w" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"w"}, "name": "w" } ], "body": { "type": "BlockStatement", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "expression": { "type": "AssignmentExpression", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "operator": "=", "left": { "type": "Identifier", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "m_if" - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22},"identifierName":"m_if"}, "name": "m_if" }, "right": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "w" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"w"}, "name": "w" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json index ac910291b7..71a10a5324 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/382/output.json @@ -1,97 +1,30 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'if' (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "if" - }, + "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6},"identifierName":"if"}, "name": "if" }, "init": { "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" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json index 56547ff7be..62e9955107 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/383/output.json @@ -1,112 +1,34 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "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": "i" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"i"}, "name": "i" }, "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": 2, "raw": "2" @@ -116,18 +38,7 @@ }, "right": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json index ece139488e..ba27c1c609 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/384/output.json @@ -1,114 +1,36 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "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": "i" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"i"}, "name": "i" } }, "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/fixtures/core/uncategorised/39/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/39/output.json index 3322d7a98a..daf210e071 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/39/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/39/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "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": "ObjectExpression", - "start": 4, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":4,"end":34,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":34}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":6,"end":32,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":32}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "true" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"true"}, "name": "true" }, "computed": false, @@ -130,98 +40,29 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "w" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"w"}, "name": "w" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "expression": { "type": "AssignmentExpression", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "operator": "=", "left": { "type": "Identifier", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "m_true" - }, + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26},"identifierName":"m_true"}, "name": "m_true" }, "right": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "w" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"w"}, "name": "w" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json index 0e5a7503ec..e005c14c8e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/397/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Unexpected keyword 'if' (1:11)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "t" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"t"}, "name": "t" }, "generator": false, @@ -68,36 +23,13 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "if" - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13},"identifierName":"if"}, "name": "if" } ], "body": { "type": "BlockStatement", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json index 9da054e4ab..6ec5cbae6e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/398/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'true' (1:11)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "t" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"t"}, "name": "t" }, "generator": false, @@ -68,36 +23,13 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "true" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"true"}, "name": "true" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json index f4f5b906e9..52f3a55384 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/399/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'false' (1:11)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "t" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"t"}, "name": "t" }, "generator": false, @@ -68,36 +23,13 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "false" - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"false"}, "name": "false" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/4/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/4/output.json index 812d26fa77..7f6c378d08 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/4/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/4/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "RegExpLiteral", - "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}}, "extra": { "raw": "/foobar/" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/40/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/40/output.json index a26b8b4009..c04c402e27 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/40/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/40/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "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": "ObjectExpression", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":6,"end":34,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":34}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "false" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"false"}, "name": "false" }, "computed": false, @@ -130,98 +40,29 @@ "params": [ { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "w" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"w"}, "name": "w" } ], "body": { "type": "BlockStatement", - "start": 19, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":19,"end":34,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":34}}, "body": [ { "type": "ExpressionStatement", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "expression": { "type": "AssignmentExpression", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "operator": "=", "left": { "type": "Identifier", - "start": 21, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "m_false" - }, + "start":21,"end":28,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":28},"identifierName":"m_false"}, "name": "m_false" }, "right": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "w" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"w"}, "name": "w" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json index b8eaca925a..501517e632 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/400/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'null' (1:11)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "t" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"t"}, "name": "t" }, "generator": false, @@ -68,36 +23,13 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "null" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"null"}, "name": "null" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json index 3fea78461b..9ac27929ac 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/401/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Unexpected keyword 'null' (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "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" }, "generator": false, @@ -68,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json index fc0c10f2f7..4d6a82553f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/402/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Unexpected keyword 'true' (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "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" }, "generator": false, @@ -68,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json index 7e708faf36..9939c11439 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/403/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'false' (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "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" }, "generator": false, @@ -68,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json index 813c4e9b90..18e0bcd2fc 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/404/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'if' (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "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" }, "generator": false, @@ -68,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json index d3a105c584..8ce94b9605 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/409/output.json @@ -1,51 +1,18 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unsyntactic break (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BreakStatement", - "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}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/41/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/41/output.json index 96e1bccd51..cb6827eebf 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/41/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/41/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "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": "ObjectExpression", - "start": 4, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":4,"end":34,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":34}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":6,"end":32,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":32}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "null" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"null"}, "name": "null" }, "computed": false, @@ -130,98 +40,29 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "w" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"w"}, "name": "w" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "expression": { "type": "AssignmentExpression", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "operator": "=", "left": { "type": "Identifier", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "m_null" - }, + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26},"identifierName":"m_null"}, "name": "m_null" }, "right": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "w" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"w"}, "name": "w" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json index c32c5b0891..6d89822f15 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/411/output.json @@ -1,51 +1,18 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unsyntactic continue (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ContinueStatement", - "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}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json index 3844a4d151..d3af5238b3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/417/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Invalid left-hand side in for-in statement (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "left": { "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": "i" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"i"}, "name": "i" }, "operator": "+", "right": { "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" @@ -101,34 +34,12 @@ }, "right": { "type": "ObjectExpression", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "properties": [] }, "body": { "type": "EmptyStatement", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}} } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json index 9d008175f6..a68f97021f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/418/output.json @@ -1,115 +1,37 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in for-in statement (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "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": "UnaryExpression", - "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}}, "operator": "+", "prefix": true, "argument": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "i" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"i"}, "name": "i" } }, "right": { "type": "ObjectExpression", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "properties": [] }, "body": { "type": "EmptyStatement", - "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}} } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/42/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/42/output.json index 2fa4b803dd..185c7ceda3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/42/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/42/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "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": "ObjectExpression", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":6,"end":34,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":34}}, "method": false, "key": { "type": "StringLiteral", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}}, "extra": { "rawValue": "null", "raw": "\"null\"" @@ -133,98 +44,29 @@ "params": [ { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "w" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"w"}, "name": "w" } ], "body": { "type": "BlockStatement", - "start": 20, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":20,"end":34,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":34}}, "body": [ { "type": "ExpressionStatement", - "start": 22, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":22,"end":32,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":32}}, "expression": { "type": "AssignmentExpression", - "start": 22, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":22,"end":32,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":32}}, "operator": "=", "left": { "type": "Identifier", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "m_null" - }, + "start":22,"end":28,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":28},"identifierName":"m_null"}, "name": "m_null" }, "right": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "w" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"w"}, "name": "w" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json index 3d2ee0555b..a0bb1f5c08 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/425/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Missing catch or finally clause (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "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}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json index c90c4eefdc..322359217c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/427/output.json @@ -1,100 +1,33 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Multiple default clauses (1:22)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "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}}, "discriminant": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "c" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"c"}, "name": "c" }, "cases": [ { "type": "SwitchCase", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21}}, "consequent": [], "test": null }, { "type": "SwitchCase", - "start": 22, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":22,"end":30,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":30}}, "consequent": [], "test": null } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/43/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/43/output.json index 21dd434a7a..c7e5a73217 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/43/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/43/output.json @@ -1,124 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":4,"end":32,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":32}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":6,"end":30,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":30}}, "method": false, "key": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 10, "raw": "10" @@ -133,98 +44,29 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "w" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"w"}, "name": "w" } ], "body": { "type": "BlockStatement", - "start": 16, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":16,"end":30,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":30}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":18,"end":28,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":28}}, "expression": { "type": "AssignmentExpression", - "start": 18, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":18,"end":28,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":28}}, "operator": "=", "left": { "type": "Identifier", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "m_null" - }, + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24},"identifierName":"m_null"}, "name": "m_null" }, "right": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "w" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"w"}, "name": "w" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/44/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/44/output.json index 1a0a1b9547..3ae13a3f41 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/44/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/44/output.json @@ -1,143 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "get" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"get"}, "name": "get" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json index 1db488318b..f0be819b2d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/446/output.json @@ -1,67 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)", "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "\\\\\\" - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"\\\\\\"}, "name": "\\\\\\" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json index d44909ca99..6c34e22a00 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/447/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid Unicode escape (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "\\" - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"\\"}, "name": "\\" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json index 38cc0c05b0..cc7b3b44d6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/448/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "\\x" - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"\\x"}, "name": "\\x" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json index 380e6ec698..3af7d55ae1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/449/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid Unicode escape (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "\u0000" - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"\u0000"}, "name": "\u0000" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/45/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/45/output.json index 8caddf6f2a..26fa046a12 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/45/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/45/output.json @@ -1,143 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "set" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"set"}, "name": "set" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "extra": { "rawValue": 43, "raw": "43" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json index e43da23745..5875cb58be 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/454/output.json @@ -1,51 +1,18 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: 'return' outside of function (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ReturnStatement", - "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}}, "argument": null } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json index d3a105c584..8ce94b9605 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/455/output.json @@ -1,51 +1,18 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unsyntactic break (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BreakStatement", - "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}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json index c32c5b0891..6d89822f15 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/456/output.json @@ -1,51 +1,18 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unsyntactic continue (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ContinueStatement", - "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}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json index b83145faf5..37451db0ed 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/457/output.json @@ -1,98 +1,31 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ "SyntaxError: Unsyntactic continue (1:22)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "discriminant": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, "cases": [ { "type": "SwitchCase", - "start": 13, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":13,"end":31,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":31}}, "consequent": [ { "type": "ContinueStatement", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json index a7c8d4f9a0..ae9cb401dd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/459/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ "SyntaxError: Unsyntactic break (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":13,"end":25,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":25}}, "body": [ { "type": "BreakStatement", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "label": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/46/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/46/output.json index 0a8172ce68..9dfe7b1c37 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/46/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/46/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "expression": { "type": "NumericLiteral", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "extra": { "rawValue": 42, "raw": "42" @@ -67,18 +23,7 @@ { "type": "CommentBlock", "value": " block comment ", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}} } ] } @@ -89,18 +34,7 @@ { "type": "CommentBlock", "value": " block comment ", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json index 2f1c8737b2..39c5663443 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/460/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ "SyntaxError: Unsyntactic continue (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":13,"end":28,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":28}}, "body": [ { "type": "ContinueStatement", - "start": 15, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":15,"end":26,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":26}}, "label": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"x"}, "name": "x" } } 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 7337acd3e8..3939133b3b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/461/output.json @@ -1,172 +1,50 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ "SyntaxError: Unsyntactic break (1:33)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "body": { "type": "WhileStatement", - "start": 3, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":3,"end":47,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":47}}, "test": { "type": "BooleanLiteral", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": true }, "body": { "type": "BlockStatement", - "start": 16, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":16,"end":47,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":47}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":18,"end":45,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":45}}, "expression": { "type": "FunctionExpression", - "start": 19, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":19,"end":43,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":43}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 31, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":31,"end":43,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":43}}, "body": [ { "type": "BreakStatement", - "start": 33, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":33,"end":41,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":41}}, "label": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "x" - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"x"}, "name": "x" } } @@ -185,19 +63,7 @@ }, "label": { "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" } } 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 18bc9b977c..d65c7f7da9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/462/output.json @@ -1,172 +1,50 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ "SyntaxError: Unsyntactic continue (1:33)" ], "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "body": { "type": "WhileStatement", - "start": 3, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":3,"end":50,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":50}}, "test": { "type": "BooleanLiteral", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": true }, "body": { "type": "BlockStatement", - "start": 16, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":16,"end":50,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":50}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":18,"end":48,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":48}}, "expression": { "type": "FunctionExpression", - "start": 19, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":19,"end":46,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":46}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [ { "type": "ContinueStatement", - "start": 33, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":33,"end":44,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":44}}, "label": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "x" - }, + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"x"}, "name": "x" } } @@ -185,19 +63,7 @@ }, "label": { "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" } } 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 59ae007d6f..336add4fe3 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/463/output.json @@ -1,157 +1,47 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unsyntactic break (1:33)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "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}}, "body": { "type": "WhileStatement", - "start": 3, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":3,"end":45,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":45}}, "test": { "type": "BooleanLiteral", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": true }, "body": { "type": "BlockStatement", - "start": 16, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":16,"end":45,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":45}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":18,"end":43,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":43}}, "expression": { "type": "FunctionExpression", - "start": 19, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":19,"end":41,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":41}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 31, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":31,"end":41,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":41}}, "body": [ { "type": "BreakStatement", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":33,"end":39,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":39}}, "label": null } ], @@ -169,19 +59,7 @@ }, "label": { "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" } } 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 d26e37b080..ac86039c65 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/464/output.json @@ -1,157 +1,47 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "errors": [ "SyntaxError: Unsyntactic continue (1:33)" ], "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "body": { "type": "WhileStatement", - "start": 3, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":3,"end":48,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":48}}, "test": { "type": "BooleanLiteral", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": true }, "body": { "type": "BlockStatement", - "start": 16, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":16,"end":48,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":48}}, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "FunctionExpression", - "start": 19, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":19,"end":44,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":44}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 31, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":31,"end":44,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":44}}, "body": [ { "type": "ContinueStatement", - "start": 33, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":33,"end":42,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":42}}, "label": null } ], @@ -169,19 +59,7 @@ }, "label": { "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" } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/465/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/465/output.json index 3025d6bfbf..815a430cb2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/465/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/465/output.json @@ -1,173 +1,51 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Label 'x' is already declared (1:18)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "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}}, "body": { "type": "WhileStatement", - "start": 3, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":3,"end":39,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":39}}, "test": { "type": "BooleanLiteral", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": true }, "body": { "type": "BlockStatement", - "start": 16, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":16,"end":39,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":39}}, "body": [ { "type": "LabeledStatement", - "start": 18, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":18,"end":37,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":37}}, "body": { "type": "WhileStatement", - "start": 21, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":21,"end":37,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":37}}, "test": { "type": "BooleanLiteral", - "start": 28, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":28,"end":32,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":32}}, "value": true }, "body": { "type": "BlockStatement", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":34,"end":37,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":37}}, "body": [], "directives": [] } }, "label": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"x"}, "name": "x" } } @@ -177,19 +55,7 @@ }, "label": { "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" } } 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 f22f0efb06..392c525509 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/466/output.json @@ -1,143 +1,43 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ "SyntaxError: Deleting local variable in strict mode (1:29)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, "callee": { "type": "FunctionExpression", - "start": 1, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":13,"end":40,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":40}}, "body": [ { "type": "ExpressionStatement", - "start": 29, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":29,"end":38,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":38}}, "expression": { "type": "UnaryExpression", - "start": 29, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":29,"end":37,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":37}}, "operator": "delete", "prefix": true, "argument": { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "i" - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37},"identifierName":"i"}, "name": "i" } } @@ -146,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "value": { "type": "DirectiveLiteral", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "value": "use strict", "extra": { "raw": "'use strict'", 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 1567b18881..62cf67d34e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/467/output.json @@ -1,175 +1,53 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ "SyntaxError: 'with' in strict mode (1:29)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, "callee": { "type": "FunctionExpression", - "start": 1, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":13,"end":40,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":40}}, "body": [ { "type": "WithStatement", - "start": 29, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":29,"end":38,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":38}}, "object": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "i" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"i"}, "name": "i" }, "body": { "type": "EmptyStatement", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - } - } + "start":37,"end":38,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":38}} } } ], "directives": [ { "type": "Directive", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "value": { "type": "DirectiveLiteral", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "value": "use strict", "extra": { "raw": "'use strict'", 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 7598b7431e..fcd0ab9858 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/468/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:36)" ], "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,79 +23,23 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":17,"end":48,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":48}}, "body": [ { "type": "VariableDeclaration", - "start": 32, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":32,"end":46,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":46}}, "declarations": [ { "type": "VariableDeclarator", - "start": 36, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":36,"end":45,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":45}}, "id": { "type": "Identifier", - "start": 36, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "eval" - }, + "start":36,"end":40,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":40},"identifierName":"eval"}, "name": "eval" }, "init": { "type": "NumericLiteral", - "start": 43, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":43,"end":45,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":45}}, "extra": { "rawValue": 10, "raw": "10" @@ -155,32 +54,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 7101109189..d557326e99 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/469/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:36)" ], "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,79 +23,23 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":17,"end":53,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":53}}, "body": [ { "type": "VariableDeclaration", - "start": 32, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":32,"end":51,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":51}}, "declarations": [ { "type": "VariableDeclarator", - "start": 36, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":36,"end":50,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":50}}, "id": { "type": "Identifier", - "start": 36, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "arguments" - }, + "start":36,"end":45,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":45},"identifierName":"arguments"}, "name": "arguments" }, "init": { "type": "NumericLiteral", - "start": 48, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":48,"end":50,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":50}}, "extra": { "rawValue": 10, "raw": "10" @@ -155,32 +54,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/47/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/47/output.json index ea571b1b6b..8b919bca31 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/47/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/47/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 42, "raw": "42" @@ -67,34 +23,12 @@ { "type": "CommentBlock", "value": "The", - "start": 3, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 10 - } - } + "start":3,"end":10,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":10}} }, { "type": "CommentBlock", "value": "Answer", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21}} } ] } @@ -105,34 +39,12 @@ { "type": "CommentBlock", "value": "The", - "start": 3, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 10 - } - } + "start":3,"end":10,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":10}} }, { "type": "CommentBlock", "value": "Answer", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21}} } ] } \ No newline at end of file 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 dd5fca85f2..3040718fd5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/470/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:47)" ], "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,95 +23,28 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":17,"end":58,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":58}}, "body": [ { "type": "TryStatement", - "start": 32, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":32,"end":56,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":56}}, "block": { "type": "BlockStatement", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":36,"end":39,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":39}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 40, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":40,"end":56,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":56}}, "param": { "type": "Identifier", - "start": 47, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "eval" - }, + "start":47,"end":51,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":51},"identifierName":"eval"}, "name": "eval" }, "body": { "type": "BlockStatement", - "start": 53, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":53,"end":56,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":56}}, "body": [], "directives": [] } @@ -167,32 +55,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 3b89f63424..429d686ed4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/471/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:47)" ], "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,95 +23,28 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":17,"end":63,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":63}}, "body": [ { "type": "TryStatement", - "start": 32, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":32,"end":61,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":61}}, "block": { "type": "BlockStatement", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":36,"end":39,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":39}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 40, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":40,"end":61,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":61}}, "param": { "type": "Identifier", - "start": 47, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 56 - }, - "identifierName": "arguments" - }, + "start":47,"end":56,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":56},"identifierName":"arguments"}, "name": "arguments" }, "body": { "type": "BlockStatement", - "start": 58, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 58 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":58,"end":61,"loc":{"start":{"line":1,"column":58},"end":{"line":1,"column":61}}, "body": [], "directives": [] } @@ -167,32 +55,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 2973f35176..79c71ebb54 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/472/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "errors": [ "SyntaxError: Assigning to 'eval' in strict mode (1:32)" ], "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,79 +23,23 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":17,"end":44,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":44}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":32,"end":42,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":42}}, "expression": { "type": "AssignmentExpression", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":32,"end":41,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":41}}, "operator": "=", "left": { "type": "Identifier", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "eval" - }, + "start":32,"end":36,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":36},"identifierName":"eval"}, "name": "eval" }, "right": { "type": "NumericLiteral", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":39,"end":41,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":41}}, "extra": { "rawValue": 10, "raw": "10" @@ -153,32 +52,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 e328a1e98e..ec34fa9d5c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/473/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ "SyntaxError: Assigning to 'arguments' in strict mode (1:32)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,79 +23,23 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":17,"end":49,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":49}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":32,"end":47,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":47}}, "expression": { "type": "AssignmentExpression", - "start": 32, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":32,"end":46,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":46}}, "operator": "=", "left": { "type": "Identifier", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "arguments" - }, + "start":32,"end":41,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":41},"identifierName":"arguments"}, "name": "arguments" }, "right": { "type": "NumericLiteral", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":44,"end":46,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":46}}, "extra": { "rawValue": 10, "raw": "10" @@ -153,32 +52,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 95091e6536..2ad9422223 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/474/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'eval' in strict mode (1:34)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":17,"end":41,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":41}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":32,"end":39,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":39}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}}, "operator": "++", "prefix": true, "argument": { "type": "Identifier", - "start": 34, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "eval" - }, + "start":34,"end":38,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":38},"identifierName":"eval"}, "name": "eval" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 8473055a41..c85c53c215 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/475/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'eval' in strict mode (1:34)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":17,"end":41,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":41}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":32,"end":39,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":39}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}}, "operator": "--", "prefix": true, "argument": { "type": "Identifier", - "start": 34, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "eval" - }, + "start":34,"end":38,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":38},"identifierName":"eval"}, "name": "eval" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 c997493244..8635017ed5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/476/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'arguments' in strict mode (1:34)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":17,"end":46,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":46}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":32,"end":44,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":44}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":32,"end":43,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":43}}, "operator": "++", "prefix": true, "argument": { "type": "Identifier", - "start": 34, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "arguments" - }, + "start":34,"end":43,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":43},"identifierName":"arguments"}, "name": "arguments" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 cf31420c53..0090b60112 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/477/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'arguments' in strict mode (1:34)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":17,"end":46,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":46}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":32,"end":44,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":44}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":32,"end":43,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":43}}, "operator": "--", "prefix": true, "argument": { "type": "Identifier", - "start": 34, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "arguments" - }, + "start":34,"end":43,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":43},"identifierName":"arguments"}, "name": "arguments" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 59618c91e2..439436ef7e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/478/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'eval' in strict mode (1:32)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":17,"end":41,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":41}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":32,"end":39,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":39}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}}, "operator": "++", "prefix": false, "argument": { "type": "Identifier", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "eval" - }, + "start":32,"end":36,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":36},"identifierName":"eval"}, "name": "eval" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 0b6b047c7b..b68c731a58 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/479/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'eval' in strict mode (1:32)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":17,"end":41,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":41}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":32,"end":39,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":39}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}}, "operator": "--", "prefix": false, "argument": { "type": "Identifier", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "eval" - }, + "start":32,"end":36,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":36},"identifierName":"eval"}, "name": "eval" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/48/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/48/output.json index 7def54a91b..06e1564e76 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/48/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/48/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 42, "raw": "42" @@ -67,34 +23,12 @@ { "type": "CommentBlock", "value": "the", - "start": 3, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 10 - } - } + "start":3,"end":10,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":10}} }, { "type": "CommentBlock", "value": "answer", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21}} } ] } @@ -105,34 +39,12 @@ { "type": "CommentBlock", "value": "the", - "start": 3, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 10 - } - } + "start":3,"end":10,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":10}} }, { "type": "CommentBlock", "value": "answer", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21}} } ] } \ No newline at end of file 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 64f2c09fd9..52dbdc3d5c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/480/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'arguments' in strict mode (1:32)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":17,"end":46,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":46}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":32,"end":44,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":44}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":32,"end":43,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":43}}, "operator": "++", "prefix": false, "argument": { "type": "Identifier", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "arguments" - }, + "start":32,"end":41,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":41},"identifierName":"arguments"}, "name": "arguments" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 34c1b59c4e..48c2df5468 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/481/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'arguments' in strict mode (1:32)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":17,"end":46,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":46}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":32,"end":44,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":44}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":32,"end":43,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":43}}, "operator": "--", "prefix": false, "argument": { "type": "Identifier", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "arguments" - }, + "start":32,"end":41,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":41},"identifierName":"arguments"}, "name": "arguments" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 35af060b7c..3c4ac7fd38 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/482/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:41)" ], "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":17,"end":53,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":53}}, "body": [ { "type": "FunctionDeclaration", - "start": 32, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":32,"end":51,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":51}}, "id": { "type": "Identifier", - "start": 41, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "eval" - }, + "start":41,"end":45,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":45},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -117,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":48,"end":51,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":51}}, "body": [], "directives": [] } @@ -137,32 +47,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 7419ba446d..e183294a23 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/483/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:41)" ], "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":17,"end":58,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":58}}, "body": [ { "type": "FunctionDeclaration", - "start": 32, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":32,"end":56,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":56}}, "id": { "type": "Identifier", - "start": 41, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 50 - }, - "identifierName": "arguments" - }, + "start":41,"end":50,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":50},"identifierName":"arguments"}, "name": "arguments" }, "generator": false, @@ -117,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 53, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":53,"end":56,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":56}}, "body": [], "directives": [] } @@ -137,32 +47,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 ede15490b6..c252adad5c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/484/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "eval" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -68,48 +23,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":16,"end":32,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":32}}, "body": [], "directives": [ { "type": "Directive", - "start": 17, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":17,"end":30,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":30}}, "value": { "type": "DirectiveLiteral", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "value": "use strict", "extra": { "raw": "'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 aeccd1a07e..2c691b4f70 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/485/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "arguments" - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18},"identifierName":"arguments"}, "name": "arguments" }, "generator": false, @@ -68,48 +23,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":21,"end":37,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":37}}, "body": [], "directives": [ { "type": "Directive", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":22,"end":35,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":35}}, "value": { "type": "DirectiveLiteral", - "start": 22, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, "value": "use strict", "extra": { "raw": "'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 4e8af9c85d..9e3046fe27 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/486/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:42)" ], "program": { "type": "Program", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,76 +23,20 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":17,"end":57,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":57}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":32,"end":55,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":55}}, "expression": { "type": "CallExpression", - "start": 33, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":33,"end":54,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":54}}, "callee": { "type": "FunctionExpression", - "start": 33, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, "id": { "type": "Identifier", - "start": 42, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "eval" - }, + "start":42,"end":46,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":46},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -145,18 +44,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":49,"end":52,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":52}}, "body": [], "directives": [] } @@ -172,32 +60,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 49a2e0086f..2502c52e18 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/487/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:42)" ], "program": { "type": "Program", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,76 +23,20 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":17,"end":62,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":62}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":32,"end":60,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":60}}, "expression": { "type": "CallExpression", - "start": 33, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, "callee": { "type": "FunctionExpression", - "start": 33, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":33,"end":57,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":57}}, "id": { "type": "Identifier", - "start": 42, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "arguments" - }, + "start":42,"end":51,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":51},"identifierName":"arguments"}, "name": "arguments" }, "generator": false, @@ -145,18 +44,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 54, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":54,"end":57,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":57}}, "body": [], "directives": [] } @@ -172,32 +60,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 6d1387258a..887c411495 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/488/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "callee": { "type": "FunctionExpression", - "start": 1, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "eval" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -96,48 +29,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":17,"end":33,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":33}}, "body": [], "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'use strict'", 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 d3b5c36283..250afef7d8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/489/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "FunctionExpression", - "start": 1, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, "id": { "type": "Identifier", - "start": 10, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "arguments" - }, + "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19},"identifierName":"arguments"}, "name": "arguments" }, "generator": false, @@ -96,48 +29,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 22, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":22,"end":38,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":38}}, "body": [], "directives": [ { "type": "Directive", - "start": 23, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":23,"end":36,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":36}}, "value": { "type": "DirectiveLiteral", - "start": 23, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/49/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/49/output.json index 5523233f47..fe7e90ef94 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/49/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/49/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":13}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 5, - "column": 11 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":42,"end":44,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":13}}, "expression": { "type": "NumericLiteral", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 5, - "column": 11 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":42,"end":44,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":13}}, "extra": { "rawValue": 42, "raw": "42" @@ -67,18 +23,7 @@ { "type": "CommentBlock", "value": " multiline\ncomment\nshould\nbe\nignored ", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 10 - } - } + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":10}} } ] } @@ -89,18 +34,7 @@ { "type": "CommentBlock", "value": " multiline\ncomment\nshould\nbe\nignored ", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 10 - } - } + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":10}} } ] } \ No newline at end of file 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 d0eb8e29b2..03985eff0b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/490/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:47)" ], "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,111 +23,32 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":17,"end":63,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":63}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":32,"end":61,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":61}}, "expression": { "type": "ObjectExpression", - "start": 33, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, "properties": [ { "type": "ObjectProperty", - "start": 35, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":35,"end":57,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":57}}, "method": false, "key": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "s" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"s"}, "name": "s" }, "computed": false, "shorthand": false, "value": { "type": "FunctionExpression", - "start": 38, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":38,"end":57,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":57}}, "id": { "type": "Identifier", - "start": 47, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "eval" - }, + "start":47,"end":51,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":51},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -180,18 +56,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 54, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":54,"end":57,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":57}}, "body": [], "directives": [] } @@ -208,32 +73,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 d651009493..29ce013f0b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/491/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'package' in strict mode (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "FunctionExpression", - "start": 1, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":1,"end":36,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "package" - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17},"identifierName":"package"}, "name": "package" }, "generator": false, @@ -96,48 +29,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":20,"end":36,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":36}}, "body": [], "directives": [ { "type": "Directive", - "start": 21, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":21,"end":34,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":34}}, "value": { "type": "DirectiveLiteral", - "start": 21, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, "value": "use strict", "extra": { "raw": "'use strict'", 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 98e0968778..60d4df26f9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/492/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:48)" ], "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,96 +23,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":17,"end":63,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":63}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":32,"end":61,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":61}}, "expression": { "type": "ObjectExpression", - "start": 33, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, "properties": [ { "type": "ObjectProperty", - "start": 35, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":35,"end":40,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":40}}, "method": false, "key": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "i" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"i"}, "name": "i" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":38,"end":40,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":40}}, "extra": { "rawValue": 10, "raw": "10" @@ -167,34 +55,11 @@ }, { "type": "ObjectMethod", - "start": 42, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":42,"end":57,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":57}}, "method": false, "key": { "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "s" - }, + "start":46,"end":47,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":47},"identifierName":"s"}, "name": "s" }, "computed": false, @@ -205,36 +70,13 @@ "params": [ { "type": "Identifier", - "start": 48, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 52 - }, - "identifierName": "eval" - }, + "start":48,"end":52,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":52},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 54, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":54,"end":57,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":57}}, "body": [], "directives": [] } @@ -250,32 +92,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 f974d83f5a..4ee83b1402 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/493/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:41)" ], "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,78 +23,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":17,"end":56,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":56}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":32,"end":54,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":54}}, "expression": { "type": "ObjectExpression", - "start": 33, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, "properties": [ { "type": "ObjectMethod", - "start": 35, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":35,"end":50,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":50}}, "method": false, "key": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "s" - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"s"}, "name": "s" }, "computed": false, @@ -150,36 +49,13 @@ "params": [ { "type": "Identifier", - "start": 41, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "eval" - }, + "start":41,"end":45,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":45},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":47,"end":50,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":50}}, "body": [], "directives": [] } @@ -195,32 +71,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 2993cf6488..0c8905156a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/494/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:49)" ], "program": { "type": "Program", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,111 +23,32 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":17,"end":64,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":64}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":32,"end":62,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":62}}, "expression": { "type": "ObjectExpression", - "start": 33, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":33,"end":60,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":60}}, "properties": [ { "type": "ObjectProperty", - "start": 35, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":35,"end":58,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":58}}, "method": false, "key": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "s" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"s"}, "name": "s" }, "computed": false, "shorthand": false, "value": { "type": "FunctionExpression", - "start": 38, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":38,"end":58,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":58}}, "id": { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "s" - }, + "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48},"identifierName":"s"}, "name": "s" }, "generator": false, @@ -180,36 +56,13 @@ "params": [ { "type": "Identifier", - "start": 49, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 53 - }, - "identifierName": "eval" - }, + "start":49,"end":53,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":53},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 55, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":55,"end":58,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":58}}, "body": [], "directives": [] } @@ -226,32 +79,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 4534376b27..3ccaace1b1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/495/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,66 +23,21 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "eval" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 21, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":21,"end":36,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":36}}, "body": [], "directives": [ { "type": "Directive", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":22,"end":35,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":35}}, "value": { "type": "DirectiveLiteral", - "start": 22, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, "value": "use strict", "extra": { "raw": "'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 cb41c27834..dc142e7610 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/496/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:15)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,66 +23,21 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "arguments" - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24},"identifierName":"arguments"}, "name": "arguments" } ], "body": { "type": "BlockStatement", - "start": 26, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":26,"end":41,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":41}}, "body": [], "directives": [ { "type": "Directive", - "start": 27, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":27,"end":40,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":40}}, "value": { "type": "DirectiveLiteral", - "start": 27, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":27,"end":39,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":39}}, "value": "use strict", "extra": { "raw": "'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 d8df2c1c2d..d887db53f5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/497/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:48)" ], "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":17,"end":58,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":58}}, "body": [ { "type": "FunctionDeclaration", - "start": 33, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":33,"end":56,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":56}}, "id": { "type": "Identifier", - "start": 42, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "inner" - }, + "start":42,"end":47,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":47},"identifierName":"inner"}, "name": "inner" }, "generator": false, @@ -117,36 +38,13 @@ "params": [ { "type": "Identifier", - "start": 48, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 52 - }, - "identifierName": "eval" - }, + "start":48,"end":52,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":52},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 54, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":54,"end":56,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":56}}, "body": [], "directives": [] } @@ -155,32 +53,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "'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 a2fc6cb4db..ded1814137 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/498/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:48)" ], "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":17,"end":63,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":63}}, "body": [ { "type": "FunctionDeclaration", - "start": 33, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":33,"end":61,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":61}}, "id": { "type": "Identifier", - "start": 42, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "inner" - }, + "start":42,"end":47,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":47},"identifierName":"inner"}, "name": "inner" }, "generator": false, @@ -117,36 +38,13 @@ "params": [ { "type": "Identifier", - "start": 48, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 57 - }, - "identifierName": "arguments" - }, + "start":48,"end":57,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":57},"identifierName":"arguments"}, "name": "arguments" } ], "body": { "type": "BlockStatement", - "start": 59, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 59 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":59,"end":61,"loc":{"start":{"line":1,"column":59},"end":{"line":1,"column":61}}, "body": [], "directives": [] } @@ -155,32 +53,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/499/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/499/output.json index 4f1229be25..a7ce0eaeba 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/499/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/499/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:35)" ], "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,48 +23,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":17,"end":40,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":40}}, "body": [], "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "'use strict'", @@ -119,32 +41,10 @@ }, { "type": "Directive", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":33,"end":38,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":38}}, "value": { "type": "DirectiveLiteral", - "start": 33, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37}}, "value": "\\1", "extra": { "raw": "\"\\1\"", @@ -158,4 +58,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/5/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/5/output.json index b192978c9f..96df76bb0e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/5/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/5/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "RegExpLiteral", - "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}}, "extra": { "raw": "/[a-z]/g" }, diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/50/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/50/output.json index 666876f21a..fd256c8b41 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/50/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/50/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":8,"end":10,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "expression": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":8,"end":10,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "extra": { "rawValue": 42, "raw": "42" @@ -67,18 +23,7 @@ { "type": "CommentBlock", "value": "a\nb", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - } + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":3}} } ] } @@ -89,18 +34,7 @@ { "type": "CommentBlock", "value": "a\nb", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - } + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":3}} } ] } \ No newline at end of file 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 343c7244d1..f4096149d8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/500/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:33)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,47 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":17,"end":39,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":39}}, "body": [ { "type": "ExpressionStatement", - "start": 33, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37}}, "expression": { "type": "NumericLiteral", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":33,"end":36,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":36}}, "extra": { "rawValue": 17, "raw": "021" @@ -120,32 +42,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "'use strict'", @@ -159,4 +59,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/501/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/501/output.json index 6d3d9feff3..2c29a7df14 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/501/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/501/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:38)" ], "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,77 +23,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":17,"end":50,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":50}}, "body": [ { "type": "ExpressionStatement", - "start": 33, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":33,"end":48,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":48}}, "expression": { "type": "ObjectExpression", - "start": 34, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":34,"end":46,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":46}}, "properties": [ { "type": "ObjectProperty", - "start": 36, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":36,"end":44,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":44}}, "method": false, "key": { "type": "StringLiteral", - "start": 36, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":36,"end":40,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":40}}, "extra": { "rawValue": "\u0001", "raw": "\"\\1\"" @@ -149,18 +49,7 @@ "shorthand": false, "value": { "type": "NumericLiteral", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":42,"end":44,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":44}}, "extra": { "rawValue": 42, "raw": "42" @@ -179,32 +68,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "'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 5eb3bcef0b..8caf22da60 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/502/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:36)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,77 +23,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":17,"end":49,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":49}}, "body": [ { "type": "ExpressionStatement", - "start": 33, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":33,"end":47,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":47}}, "expression": { "type": "ObjectExpression", - "start": 34, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":34,"end":45,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":45}}, "properties": [ { "type": "ObjectProperty", - "start": 36, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":36,"end":43,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":43}}, "method": false, "key": { "type": "NumericLiteral", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":36,"end":39,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":39}}, "extra": { "rawValue": 17, "raw": "021" @@ -149,18 +49,7 @@ "shorthand": false, "value": { "type": "NumericLiteral", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":41,"end":43,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":43}}, "extra": { "rawValue": 42, "raw": "42" @@ -179,32 +68,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/503/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/503/output.json index 81ea6460e3..d559db4b56 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/503/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/503/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 76 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":76}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:69)" ], "program": { "type": "Program", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 76 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":76}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 76 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":76}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 76 - } - }, + "start":17,"end":76,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":76}}, "body": [ { "type": "FunctionDeclaration", - "start": 33, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 74 - } - }, + "start":33,"end":74,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":74}}, "id": { "type": "Identifier", - "start": 42, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "inner" - }, + "start":42,"end":47,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":47},"identifierName":"inner"}, "name": "inner" }, "generator": false, @@ -117,48 +38,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 50, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 74 - } - }, + "start":50,"end":74,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":74}}, "body": [], "directives": [ { "type": "Directive", - "start": 52, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 72 - } - }, + "start":52,"end":72,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":72}}, "value": { "type": "DirectiveLiteral", - "start": 52, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 71 - } - }, + "start":52,"end":71,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":71}}, "value": "octal directive\\1", "extra": { "raw": "\"octal directive\\1\"", @@ -173,32 +61,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 2201ea3de8..a3eee1ca11 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/504/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ "SyntaxError: Unexpected reserved word 'implements' (1:37)" ], "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":17,"end":50,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":50}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":33,"end":48,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":48}}, "declarations": [ { "type": "VariableDeclarator", - "start": 37, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":37,"end":47,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":47}}, "id": { "type": "Identifier", - "start": 37, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "implements" - }, + "start":37,"end":47,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":47},"identifierName":"implements"}, "name": "implements" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 be76deabc7..cffcb241d4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/505/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ "SyntaxError: Unexpected reserved word 'interface' (1:37)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":17,"end":49,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":49}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":33,"end":47,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":47}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 37, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "interface" - }, + "start":37,"end":46,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":46},"identifierName":"interface"}, "name": "interface" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 414e229fac..3d7bd0ac8e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/506/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ "SyntaxError: Unexpected reserved word 'package' (1:37)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":17,"end":47,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":47}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":33,"end":45,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":45}}, "declarations": [ { "type": "VariableDeclarator", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":37,"end":44,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "package" - }, + "start":37,"end":44,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":44},"identifierName":"package"}, "name": "package" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 32efcd46a6..4c1f2d2844 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/507/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ "SyntaxError: Unexpected reserved word 'private' (1:37)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":17,"end":47,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":47}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":33,"end":45,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":45}}, "declarations": [ { "type": "VariableDeclarator", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":37,"end":44,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "private" - }, + "start":37,"end":44,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":44},"identifierName":"private"}, "name": "private" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 e3d3f255c2..dcf994402a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/508/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ "SyntaxError: Unexpected reserved word 'protected' (1:37)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":17,"end":49,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":49}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":33,"end":47,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":47}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 37, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "protected" - }, + "start":37,"end":46,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":46},"identifierName":"protected"}, "name": "protected" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 2e801038c7..c7306ecdb6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/509/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected reserved word 'public' (1:37)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":17,"end":46,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":46}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":33,"end":44,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":44}}, "declarations": [ { "type": "VariableDeclarator", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43}}, "id": { "type": "Identifier", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "public" - }, + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43},"identifierName":"public"}, "name": "public" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/51/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/51/output.json index 60bb34d552..0bcd7848fe 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/51/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/51/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":8,"end":10,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "expression": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":8,"end":10,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "extra": { "rawValue": 42, "raw": "42" @@ -67,18 +23,7 @@ { "type": "CommentBlock", "value": "a\rb", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - } + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":3}} } ] } @@ -89,18 +34,7 @@ { "type": "CommentBlock", "value": "a\rb", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - } + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":3}} } ] } \ No newline at end of file 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 4ed420518d..41fd579945 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/510/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected reserved word 'static' (1:37)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":17,"end":46,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":46}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":33,"end":44,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":44}}, "declarations": [ { "type": "VariableDeclarator", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43}}, "id": { "type": "Identifier", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "static" - }, + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43},"identifierName":"static"}, "name": "static" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 ab669586dc..1605445790 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/511/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ "SyntaxError: Binding 'static' in strict mode (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,66 +23,21 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "static" - }, + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21},"identifierName":"static"}, "name": "static" } ], "body": { "type": "BlockStatement", - "start": 23, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":23,"end":40,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":40}}, "body": [], "directives": [ { "type": "Directive", - "start": 25, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":25,"end":38,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":38}}, "value": { "type": "DirectiveLiteral", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":25,"end":37,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":37}}, "value": "use strict", "extra": { "raw": "\"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 be76a2099b..b184d58817 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/512/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'static' in strict mode (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "static" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"static"}, "name": "static" }, "generator": false, @@ -68,48 +23,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":18,"end":35,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":35}}, "body": [], "directives": [ { "type": "Directive", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":20,"end":33,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":33}}, "value": { "type": "DirectiveLiteral", - "start": 20, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, "value": "use strict", "extra": { "raw": "\"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 c249f39209..07cfc93246 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/513/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected reserved word 'static' (1:23)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":14,"end":35,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":35}}, "id": { "type": "Identifier", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "static" - }, + "start":23,"end":29,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":29},"identifierName":"static"}, "name": "static" }, "generator": false, @@ -68,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":32,"end":35,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":35}}, "body": [], "directives": [] } @@ -88,32 +32,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 f945eeb574..3b77c9170b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/514/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ "SyntaxError: Argument name clash (1:14)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,83 +23,26 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "t" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"t"}, "name": "t" }, { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "t" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"t"}, "name": "t" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":17,"end":34,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":34}}, "body": [], "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 f2ff5d38de..0581517d99 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/515/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:11)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,66 +23,21 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "eval" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":17,"end":34,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":34}}, "body": [], "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 2f734055a4..aafa09421c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/516/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ "SyntaxError: Binding 'package' in strict mode (1:11)" ], "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,66 +23,21 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "package" - }, + "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18},"identifierName":"package"}, "name": "package" } ], "body": { "type": "BlockStatement", - "start": 20, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":20,"end":37,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":37}}, "body": [], "directives": [ { "type": "Directive", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":22,"end":35,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":35}}, "value": { "type": "DirectiveLiteral", - "start": 22, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, "value": "use strict", "extra": { "raw": "\"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 60ac3ce8c9..df3094e728 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/517/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "errors": [ "SyntaxError: Argument name clash (1:43)" ], "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":13,"end":52,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":52}}, "body": [ { "type": "FunctionDeclaration", - "start": 29, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":29,"end":49,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "b" - }, + "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39},"identifierName":"b"}, "name": "b" }, "generator": false, @@ -117,102 +38,34 @@ "params": [ { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "t" - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"t"}, "name": "t" }, { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "t" - }, + "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44},"identifierName":"t"}, "name": "t" } ], "body": { "type": "BlockStatement", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":46,"end":49,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":49}}, "body": [], "directives": [] } }, { "type": "EmptyStatement", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 50 - } - } + "start":49,"end":50,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":50}} } ], "directives": [ { "type": "Directive", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "value": { "type": "DirectiveLiteral", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "value": "use strict", "extra": { "raw": "\"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 766ec14c5a..bcaf874206 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/518/output.json @@ -1,80 +1,24 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Argument name clash (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -82,83 +26,26 @@ "params": [ { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "t" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"t"}, "name": "t" }, { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "t" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"t"}, "name": "t" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":18,"end":35,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":35}}, "body": [], "directives": [ { "type": "Directive", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":20,"end":33,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":33}}, "value": { "type": "DirectiveLiteral", - "start": 20, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, "value": "use strict", "extra": { "raw": "\"use strict\"", 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 0f2e3c5dce..65f5a908f0 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/519/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "errors": [ "SyntaxError: Argument name clash (1:44)" ], "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,62 +23,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":13,"end":54,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":54}}, "body": [ { "type": "ExpressionStatement", - "start": 29, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":29,"end":52,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":52}}, "expression": { "type": "FunctionExpression", - "start": 30, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":30,"end":50,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":50}}, "id": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "b" - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"b"}, "name": "b" }, "generator": false, @@ -131,53 +41,18 @@ "params": [ { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "t" - }, + "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42},"identifierName":"t"}, "name": "t" }, { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "t" - }, + "start":44,"end":45,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":45},"identifierName":"t"}, "name": "t" } ], "body": { "type": "BlockStatement", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":47,"end":50,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":50}}, "body": [], "directives": [] }, @@ -191,32 +66,10 @@ "directives": [ { "type": "Directive", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "value": { "type": "DirectiveLiteral", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/52/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/52/output.json index 666876f21a..fd256c8b41 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/52/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/52/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":8,"end":10,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "expression": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":8,"end":10,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "extra": { "rawValue": 42, "raw": "42" @@ -67,18 +23,7 @@ { "type": "CommentBlock", "value": "a\nb", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - } + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":3}} } ] } @@ -89,18 +34,7 @@ { "type": "CommentBlock", "value": "a\nb", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - } + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":3}} } ] } \ No newline at end of file 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 7945e482ca..a1ab8b4653 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/520/output.json @@ -1,80 +1,24 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:12)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -82,66 +26,21 @@ "params": [ { "type": "Identifier", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "eval" - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":18,"end":35,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":35}}, "body": [], "directives": [ { "type": "Directive", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":20,"end":33,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":33}}, "value": { "type": "DirectiveLiteral", - "start": 20, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, "value": "use strict", "extra": { "raw": "\"use strict\"", 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 304b4237e9..7caed97929 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/521/output.json @@ -1,80 +1,24 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'package' in strict mode (1:12)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -82,66 +26,21 @@ "params": [ { "type": "Identifier", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "package" - }, + "start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19},"identifierName":"package"}, "name": "package" } ], "body": { "type": "BlockStatement", - "start": 21, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":21,"end":38,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":38}}, "body": [], "directives": [ { "type": "Directive", - "start": 23, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":23,"end":36,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":36}}, "value": { "type": "DirectiveLiteral", - "start": 23, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, "value": "use strict", "extra": { "raw": "\"use strict\"", 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 98d2e05271..a53f5cb5d2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/522/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 69 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":69}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:65)" ], "program": { "type": "Program", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 69 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":69}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 13, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":13,"end":42,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":42}}, "id": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -68,48 +23,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":27,"end":42,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":42}}, "body": [], "directives": [ { "type": "Directive", - "start": 28, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":28,"end":41,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":41}}, "value": { "type": "DirectiveLiteral", - "start": 28, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":28,"end":40,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":40}}, "value": "use strict", "extra": { "raw": "\"use strict\"", @@ -122,33 +44,10 @@ }, { "type": "FunctionDeclaration", - "start": 42, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 69 - } - }, + "start":42,"end":69,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":69}}, "id": { "type": "Identifier", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 54 - }, - "identifierName": "bar" - }, + "start":51,"end":54,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":54},"identifierName":"bar"}, "name": "bar" }, "generator": false, @@ -156,79 +55,23 @@ "params": [], "body": { "type": "BlockStatement", - "start": 56, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 56 - }, - "end": { - "line": 1, - "column": 69 - } - }, + "start":56,"end":69,"loc":{"start":{"line":1,"column":56},"end":{"line":1,"column":69}}, "body": [ { "type": "VariableDeclaration", - "start": 57, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 68 - } - }, + "start":57,"end":68,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":68}}, "declarations": [ { "type": "VariableDeclarator", - "start": 61, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 61 - }, - "end": { - "line": 1, - "column": 68 - } - }, + "start":61,"end":68,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":68}}, "id": { "type": "Identifier", - "start": 61, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 61 - }, - "end": { - "line": 1, - "column": 62 - }, - "identifierName": "v" - }, + "start":61,"end":62,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":62},"identifierName":"v"}, "name": "v" }, "init": { "type": "NumericLiteral", - "start": 65, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 65 - }, - "end": { - "line": 1, - "column": 68 - } - }, + "start":65,"end":68,"loc":{"start":{"line":1,"column":65},"end":{"line":1,"column":68}}, "extra": { "rawValue": 13, "raw": "015" @@ -247,32 +90,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json index 90808a26c8..98b811bf5f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/523/output.json @@ -1,97 +1,30 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'this' (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "this" - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8},"identifierName":"this"}, "name": "this" }, "init": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "extra": { "rawValue": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json index 55552e2994..4323a83f4c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/524/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":3}}, "errors": [ "SyntaxError: Illegal newline after throw (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":3}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ThrowStatement", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":3}}, "argument": { "type": "NumericLiteral", - "start": 6, - "end": 8, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":6,"end":8,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "extra": { "rawValue": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/525/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/525/output.json index d1a07b1d64..b68ff2e27c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/525/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/525/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/526/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/526/output.json index 75ffb7751c..1d8ef585d5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/526/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/526/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": null }, { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "y" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"y"}, "name": "y" }, "init": null diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/527/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/527/output.json index 7316afbc42..baaa39d495 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/527/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/527/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/528/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/528/output.json index d552a2e285..3b79014390 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/528/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/528/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "eval" - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8},"identifierName":"eval"}, "name": "eval" }, "init": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "extra": { "rawValue": 42, "raw": "42" @@ -98,49 +31,15 @@ }, { "type": "VariableDeclarator", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":15,"end":29,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":29}}, "id": { "type": "Identifier", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "arguments" - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24},"identifierName":"arguments"}, "name": "arguments" }, "init": { "type": "NumericLiteral", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/529/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/529/output.json index 69ce880368..75cbded094 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/529/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/529/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": 14, "raw": "14" @@ -98,49 +31,15 @@ }, { "type": "VariableDeclarator", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "y" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"y"}, "name": "y" }, "init": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 3, "raw": "3" @@ -150,49 +49,15 @@ }, { "type": "VariableDeclarator", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "z" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"z"}, "name": "z" }, "init": { "type": "NumericLiteral", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27}}, "extra": { "rawValue": 1977, "raw": "1977" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/53/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/53/output.json index f7a4ee21f4..1e7689710f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/53/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/53/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":8,"end":10,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "expression": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":8,"end":10,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "extra": { "rawValue": 42, "raw": "42" @@ -67,18 +23,7 @@ { "type": "CommentBlock", "value": "a\nc", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - } + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":3}} } ] } @@ -89,18 +34,7 @@ { "type": "CommentBlock", "value": "a\nc", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - } + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":3}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/530/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/530/output.json index 8cee92a6a4..333c5c3949 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/530/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/530/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "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}}, "init": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "id": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 0, "raw": "0" @@ -117,18 +39,7 @@ "update": null, "body": { "type": "EmptyStatement", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}} } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/531/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/531/output.json index 5f71cebfc7..90d05b8eaa 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/531/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/531/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "init": { "type": "VariableDeclaration", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "id": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 0, "raw": "0" @@ -112,49 +34,15 @@ }, { "type": "VariableDeclarator", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "y" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"y"}, "name": "y" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" @@ -169,18 +57,7 @@ "update": null, "body": { "type": "EmptyStatement", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/532/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/532/output.json index 3cfd26fb69..65791b99b8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/532/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/532/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "left": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "init": null @@ -96,82 +29,24 @@ }, "right": { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "list" - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "expression": { "type": "CallExpression", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "callee": { "type": "Identifier", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "process" - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "x" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/533/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/533/output.json index db86a852e1..396a6c89cb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/533/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/533/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/534/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/534/output.json index 8c262ae27f..2f9c843e40 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/534/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/534/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "id": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "eval" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"eval"}, "name": "eval" }, "init": { "type": "NumericLiteral", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "extra": { "rawValue": 42, "raw": "42" @@ -98,49 +31,15 @@ }, { "type": "VariableDeclarator", - "start": 17, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":17,"end":31,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "arguments" - }, + "start":17,"end":26,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":26},"identifierName":"arguments"}, "name": "arguments" }, "init": { "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": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/535/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/535/output.json index 8239aac13d..2b827120af 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/535/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/535/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 14, "raw": "14" @@ -98,49 +31,15 @@ }, { "type": "VariableDeclarator", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "y" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"y"}, "name": "y" }, "init": { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 3, "raw": "3" @@ -150,49 +49,15 @@ }, { "type": "VariableDeclarator", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "z" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"z"}, "name": "z" }, "init": { "type": "NumericLiteral", - "start": 25, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":25,"end":29,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":29}}, "extra": { "rawValue": 1977, "raw": "1977" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/537/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/537/output.json index 318e474d79..25ba7b0015 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/537/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/537/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "init": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" }, "init": { "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": 0, "raw": "0" @@ -117,18 +39,7 @@ "update": null, "body": { "type": "EmptyStatement", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}} } } ], diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/538/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/538/output.json index 0859973b9d..b2a7aba814 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/538/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/538/output.json @@ -1,64 +1,20 @@ { "type": "File", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EmptyStatement", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":5,"end":6,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1}}, "leadingComments": [ { "type": "CommentLine", "value": "", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}} } ] } @@ -69,18 +25,7 @@ { "type": "CommentLine", "value": "", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}} } ] } \ No newline at end of file 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 a5c684bd18..09dfa53195 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/539/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/539/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,66 +20,21 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "f" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"f"}, "name": "f" } ], "body": { "type": "BlockStatement", - "start": 14, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":14,"end":31,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":31}}, "body": [], "directives": [ { "type": "Directive", - "start": 16, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":16,"end":29,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":29}}, "value": { "type": "DirectiveLiteral", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/54/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/54/output.json index 2c263698dc..719c0b3bcd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/54/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/54/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "expression": { "type": "NumericLiteral", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "extra": { "rawValue": 42, "raw": "42" @@ -67,18 +23,7 @@ { "type": "CommentLine", "value": " line comment", - "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}} } ] } @@ -89,18 +34,7 @@ { "type": "CommentLine", "value": " line comment", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/540/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/540/output.json index 702cd2b59f..6d43f8fc49 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/540/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/540/output.json @@ -1,94 +1,28 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "start": 1, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":1,"end":19,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":19}}, "left": { "type": "FunctionExpression", - "start": 1, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":1,"end":15,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":15}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "body": [], "directives": [] } @@ -96,18 +30,7 @@ "operator": "/", "right": { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/541/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/541/output.json index 30281e1958..e3a3e3b901 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/541/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/541/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,50 +20,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "body": [], "directives": [] } }, { "type": "ExpressionStatement", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "expression": { "type": "RegExpLiteral", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "extra": { "raw": "/ 1 /" }, 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 c6d8d429fa..9cbc40e7c5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/542/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/542/output.json @@ -1,90 +1,24 @@ { "type": "File", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "program": { "type": "Program", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "callee": { "type": "MemberExpression", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "object": { "type": "StringLiteral", - "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}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -93,19 +27,7 @@ }, "property": { "type": "Identifier", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "split" - }, + "start":7,"end":12,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":6},"identifierName":"split"}, "name": "split" }, "computed": false @@ -113,18 +35,7 @@ "arguments": [ { "type": "StringLiteral", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":10}}, "extra": { "rawValue": " ", "raw": "\" \"" 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 befe2fa25a..0a23440389 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/543/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/543/output.json @@ -1,142 +1,42 @@ { "type": "File", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 5 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 5 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":4,"end":56,"loc":{"start":{"line":1,"column":4},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "fn" - }, + "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6},"identifierName":"fn"}, "name": "fn" }, "init": { "type": "FunctionExpression", - "start": 9, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":9,"end":56,"loc":{"start":{"line":1,"column":9},"end":{"line":4,"column":1}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":21,"end":56,"loc":{"start":{"line":1,"column":21},"end":{"line":4,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 25, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":25,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":25,"end":37,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "value": "use strict", "extra": { "raw": "\"use strict\"", @@ -146,32 +46,10 @@ }, { "type": "Directive", - "start": 41, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":41,"end":54,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 41, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":41,"end":53,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "value": "use strict", "extra": { "raw": "\"use strict\"", @@ -188,32 +66,10 @@ }, { "type": "ExpressionStatement", - "start": 59, - "end": 64, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 5 - } - }, + "start":59,"end":64,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":5}}, "expression": { "type": "NumericLiteral", - "start": 59, - "end": 63, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 4 - } - }, + "start":59,"end":63,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":4}}, "extra": { "rawValue": 64, "raw": "0100" 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 d3b1ca7ae0..87e0021bd4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/544/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ "SyntaxError: Unexpected reserved word 'public' (2:8)" ], "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 14, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":14,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 20, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":20,"end":38,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":24}}, "id": { "type": "ObjectPattern", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":20,"end":30,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":16}}, "properties": [ { "type": "ObjectProperty", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "public" - }, + "start":22,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14},"identifierName":"public"}, "name": "public" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "public" - }, + "start":22,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14},"identifierName":"public"}, "name": "public" }, "extra": { @@ -135,33 +45,10 @@ }, "init": { "type": "CallExpression", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":33,"end":38,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":24}}, "callee": { "type": "Identifier", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "foo" - }, + "start":33,"end":36,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":22},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -174,32 +61,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 34af0a196c..d0a88458d8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/545/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ "SyntaxError: Unexpected reserved word 'public' (1:8)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":6,"end":24,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":24}}, "id": { "type": "ObjectPattern", - "start": 6, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":6,"end":16,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":16}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "public" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"public"}, "name": "public" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "public" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"public"}, "name": "public" }, "extra": { @@ -135,33 +45,10 @@ }, "init": { "type": "CallExpression", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "callee": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "foo" - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/546/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/546/output.json index 21d7b12022..5b80a70f2a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/546/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/546/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":6,"end":24,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":24}}, "id": { "type": "ObjectPattern", - "start": 6, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":6,"end":16,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":16}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "public" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"public"}, "name": "public" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "public" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"public"}, "name": "public" }, "extra": { @@ -132,33 +42,10 @@ }, "init": { "type": "CallExpression", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "callee": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "foo" - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/547/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/547/output.json index 39ef331a20..c2e81901a1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/547/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/547/output.json @@ -1,131 +1,41 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":28}}, "errors": [ "SyntaxError: Unexpected reserved word 'arguments' (2:8)", "SyntaxError: Binding 'arguments' in strict mode (2:8)" ], "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 14, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":14,"end":42,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 20, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":20,"end":41,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":27}}, "id": { "type": "ObjectPattern", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":20,"end":33,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":19}}, "properties": [ { "type": "ObjectProperty", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":22,"end":31,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":17}}, "method": false, "key": { "type": "Identifier", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "arguments" - }, + "start":22,"end":31,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":17},"identifierName":"arguments"}, "name": "arguments" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "arguments" - }, + "start":22,"end":31,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":17},"identifierName":"arguments"}, "name": "arguments" }, "extra": { @@ -136,33 +46,10 @@ }, "init": { "type": "CallExpression", - "start": 36, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":36,"end":41,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":27}}, "callee": { "type": "Identifier", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "foo" - }, + "start":36,"end":39,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -175,32 +62,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/548/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/548/output.json index 132483692b..6065ead498 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/548/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/548/output.json @@ -1,131 +1,41 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ "SyntaxError: Unexpected reserved word 'arguments' (1:8)", "SyntaxError: Binding 'arguments' in strict mode (1:8)" ], "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":6,"end":27,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":27}}, "id": { "type": "ObjectPattern", - "start": 6, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "arguments" - }, + "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17},"identifierName":"arguments"}, "name": "arguments" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "arguments" - }, + "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17},"identifierName":"arguments"}, "name": "arguments" }, "extra": { @@ -136,33 +46,10 @@ }, "init": { "type": "CallExpression", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27}}, "callee": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/549/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/549/output.json index c49b14fdab..50c48c3446 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/549/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/549/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":6,"end":27,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":27}}, "id": { "type": "ObjectPattern", - "start": 6, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "arguments" - }, + "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17},"identifierName":"arguments"}, "name": "arguments" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "arguments" - }, + "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17},"identifierName":"arguments"}, "name": "arguments" }, "extra": { @@ -132,33 +42,10 @@ }, "init": { "type": "CallExpression", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27}}, "callee": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/55/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/55/output.json index 7afc0a6719..c845e6ff49 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/55/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/55/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 42, "raw": "42" @@ -67,18 +23,7 @@ { "type": "CommentLine", "value": " line comment", - "start": 3, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":3,"end":18,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":18}} } ] } @@ -89,18 +34,7 @@ { "type": "CommentLine", "value": " line comment", - "start": 3, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":3,"end":18,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":18}} } ] } \ No newline at end of file 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 9b383cded8..e73c9a97f5 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/550/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (2:10)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":14,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "declarations": [ { "type": "VariableDeclarator", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":20,"end":26,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":12}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "a" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"a"}, "name": "a" }, "init": { "type": "NumericLiteral", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":12}}, "extra": { "rawValue": 7, "raw": "07" @@ -106,32 +39,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/551/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/551/output.json index d52ff8418d..2aaa38345f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/551/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/551/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 73, "raw": "0111" 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 a7d3e10860..765b5e13a1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/552/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (2:10)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":14,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "declarations": [ { "type": "VariableDeclarator", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":20,"end":26,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":12}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "a" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"a"}, "name": "a" }, "init": { "type": "NumericLiteral", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":12}}, "extra": { "rawValue": 8, "raw": "08" @@ -106,32 +39,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/553/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/553/output.json index 690fd47a34..a754dc4717 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/553/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/553/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 25257156155, "raw": "0274134317073" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/56/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/56/output.json index d20fe505db..ec6c58c4a7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/56/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/56/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":17,"end":19,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "expression": { "type": "NumericLiteral", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":17,"end":19,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "extra": { "rawValue": 42, "raw": "42" @@ -67,18 +23,7 @@ { "type": "CommentLine", "value": " Hello, world!", - "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}} } ] } @@ -89,18 +34,7 @@ { "type": "CommentLine", "value": " Hello, world!", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/57/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/57/output.json index 9618821b33..ec09f363c4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/57/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/57/output.json @@ -1,31 +1,9 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], @@ -34,18 +12,7 @@ { "type": "CommentLine", "value": " Hello, world!", - "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}} } ] }, @@ -53,18 +20,7 @@ { "type": "CommentLine", "value": " Hello, world!", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/58/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/58/output.json index 28d7a52866..2e92cc04b6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/58/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/58/output.json @@ -1,31 +1,9 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], @@ -34,18 +12,7 @@ { "type": "CommentLine", "value": " Hallo, world!", - "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}} } ] }, @@ -53,18 +20,7 @@ { "type": "CommentLine", "value": " Hallo, world!", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/59/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/59/output.json index ec6cf78bf9..3bbd6360e8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/59/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/59/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 3, - "end": 5, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":3,"end":5,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "expression": { "type": "NumericLiteral", - "start": 3, - "end": 5, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":3,"end":5,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "extra": { "rawValue": 42, "raw": "42" @@ -67,18 +23,7 @@ { "type": "CommentLine", "value": "", - "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}} } ] } @@ -89,18 +34,7 @@ { "type": "CommentLine", "value": "", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/6/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/6/output.json index e05c37f126..230f98af8a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/6/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/6/output.json @@ -1,90 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "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" @@ -94,18 +28,7 @@ "operator": "+", "right": { "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": 2, "raw": "2" @@ -120,18 +43,7 @@ "operator": "*", "right": { "type": "NumericLiteral", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "extra": { "rawValue": 3, "raw": "3" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/60/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/60/output.json index f9e7a22c6b..f156dd8eff 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/60/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/60/output.json @@ -1,31 +1,9 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], @@ -34,18 +12,7 @@ { "type": "CommentLine", "value": "", - "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}} } ] }, @@ -53,18 +20,7 @@ { "type": "CommentLine", "value": "", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/61/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/61/output.json index f9e7a22c6b..f156dd8eff 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/61/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/61/output.json @@ -1,31 +1,9 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], @@ -34,18 +12,7 @@ { "type": "CommentLine", "value": "", - "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}} } ] }, @@ -53,18 +20,7 @@ { "type": "CommentLine", "value": "", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/62/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/62/output.json index 30f3c2d9c3..26e4bb1d5e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/62/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/62/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" @@ -67,18 +23,7 @@ { "type": "CommentBlock", "value": "", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}} } ] } @@ -89,18 +34,7 @@ { "type": "CommentBlock", "value": "", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/63/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/63/output.json index 4239fdfb2b..aeae1aa8a7 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/63/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/63/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":37,"end":39,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":2}}, "expression": { "type": "NumericLiteral", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":37,"end":39,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":2}}, "extra": { "rawValue": 42, "raw": "42" @@ -67,34 +23,12 @@ { "type": "CommentLine", "value": " Hello, world!", - "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}} }, { "type": "CommentLine", "value": " Another hello", - "start": 18, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - } + "start":18,"end":36,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":18}} } ] } @@ -105,34 +39,12 @@ { "type": "CommentLine", "value": " Hello, world!", - "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}} }, { "type": "CommentLine", "value": " Another hello", - "start": 18, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - } + "start":18,"end":36,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":18}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/64/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/64/output.json index 770f5ef718..d561fe3125 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/64/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/64/output.json @@ -1,123 +1,33 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "test": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "consequent": { "type": "BlockStatement", - "start": 7, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":7,"end":36,"loc":{"start":{"line":1,"column":7},"end":{"line":2,"column":11}}, "body": [ { "type": "ExpressionStatement", - "start": 25, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":25,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":9}}, "expression": { "type": "CallExpression", - "start": 25, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":25,"end":33,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}}, "callee": { "type": "Identifier", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "doThat" - }, + "start":25,"end":31,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6},"identifierName":"doThat"}, "name": "doThat" }, "arguments": [] @@ -126,18 +36,7 @@ { "type": "CommentLine", "value": " Some comment", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}} } ] } @@ -153,18 +52,7 @@ { "type": "CommentLine", "value": " Some comment", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/65/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/65/output.json index 75e2c84167..c6e1f8bf31 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/65/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/65/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "discriminant": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "answer" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"answer"}, "name": "answer" }, "cases": [ { "type": "SwitchCase", - "start": 18, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":18,"end":48,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":48}}, "consequent": [ { "type": "ExpressionStatement", - "start": 41, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":41,"end":48,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":48}}, "expression": { "type": "CallExpression", - "start": 41, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":41,"end":48,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":48}}, "callee": { "type": "Identifier", - "start": 41, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "bingo" - }, + "start":41,"end":46,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":46},"identifierName":"bingo"}, "name": "bingo" }, "arguments": [] @@ -127,36 +37,14 @@ { "type": "CommentBlock", "value": " perfect ", - "start": 27, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 40 - } - } + "start":27,"end":40,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":40}} } ] } ], "test": { "type": "NumericLiteral", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "extra": { "rawValue": 42, "raw": "42" @@ -173,18 +61,7 @@ { "type": "CommentBlock", "value": " perfect ", - "start": 27, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 40 - } - } + "start":27,"end":40,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":40}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/66/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/66/output.json index 3b0df6852f..a1b891f677 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/66/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/66/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/67/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/67/output.json index b21e99bf2e..5ad0d74595 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/67/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/67/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 3, "raw": "3" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/68/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/68/output.json index a10e4151e3..aaeac684c1 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/68/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/68/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 5, "raw": "5" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/69/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/69/output.json index 20849b383b..db9c867205 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/69/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/69/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/7/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/7/output.json index 9446cbbae1..86fa33c5b8 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/7/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/7/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/70/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/70/output.json index a5255d5fce..ac4cc54d11 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/70/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/70/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0.14, "raw": ".14" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/71/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/71/output.json index bcb0e150ed..8f33cfd606 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/71/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/71/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3.14159, "raw": "3.14159" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/72/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/72/output.json index 85fdb9eb27..34d1f995b4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/72/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/72/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 6.02214179e+23, "raw": "6.02214179e+23" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/73/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/73/output.json index 570feb3f99..782f9c962a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/73/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/73/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 1.49241783e-10, "raw": "1.492417830e-10" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/74/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/74/output.json index 5dab1af37b..2cbe6c5f22 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/74/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/74/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0x0" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/75/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/75/output.json index 4d36c6d5ce..10e5ffff0e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/75/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/75/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0e+100" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/76/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/76/output.json index ffa4e3f03d..6155999213 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/76/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/76/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 2748, "raw": "0xabc" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/77/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/77/output.json index ca378cfb32..e713c6daf6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/77/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/77/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3567, "raw": "0xdef" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/78/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/78/output.json index e88d6a6431..273d629674 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/78/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/78/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 26, "raw": "0X1A" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/79/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/79/output.json index da0f5a5a07..b8debd493d 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/79/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/79/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 16, "raw": "0x10" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/8/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/8/output.json index 138fcb2e62..07143b67c9 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/8/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/8/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrayExpression", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/80/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/80/output.json index 3aeb059890..d269de6f53 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/80/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/80/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 256, "raw": "0x100" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/81/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/81/output.json index 508faca10f..9bfb038fdb 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/81/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/81/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 4, "raw": "0X04" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/82/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/82/output.json index 32add9ef9d..3e157b067a 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/82/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/82/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 2, "raw": "02" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/83/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/83/output.json index 25cd08d3e7..b173873622 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/83/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/83/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 10, "raw": "012" diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/84/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/84/output.json index 3c9b2c223f..ef45bffe39 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/84/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/84/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 10, "raw": "0012" 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 decc68148f..06adbec3fd 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/85/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/85/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello", "extra": { "raw": "\"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 13ba3c4eb9..85beda94d4 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/86/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/86/output.json @@ -1,63 +1,19 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "value": { "type": "DirectiveLiteral", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "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\"", 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 a6f1a992df..eaa53e6030 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/87/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/87/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\u0061", "extra": { "raw": "\"\\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 2b81d94ea7..fb5e0996bf 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/88/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/88/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\x61", "extra": { "raw": "\"\\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 1668494493..2bc5cf54b2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/89/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/89/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\nworld", "extra": { "raw": "\"Hello\\nworld\"", diff --git a/packages/babel-parser/test/fixtures/core/uncategorised/9/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/9/output.json index ef826212c2..ffa484a7df 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/9/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/9/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ArrayExpression", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "elements": [ { "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/fixtures/core/uncategorised/90/output.json b/packages/babel-parser/test/fixtures/core/uncategorised/90/output.json index 69ff486c62..8bbf441a1b 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/90/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/90/output.json @@ -1,63 +1,19 @@ { "type": "File", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "value": { "type": "DirectiveLiteral", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "value": "Hello\\\nworld", "extra": { "raw": "\"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 f3046102c2..7ba45ecc53 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/91/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/91/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\02World", "extra": { "raw": "\"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 5f31b1a576..6ff8b0773c 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/92/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/92/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\012World", "extra": { "raw": "\"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 9656f26c45..43e794894e 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/93/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/93/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\122World", "extra": { "raw": "\"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 5a8ab1f211..e51d6f3e51 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/94/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/94/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\0122World", "extra": { "raw": "\"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 e3470fcb4e..4dfa59a362 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/95/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/95/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\312World", "extra": { "raw": "\"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 04f8c8c1df..f7c0c7ae2f 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/96/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/96/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\412World", "extra": { "raw": "\"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 fdc28b5e16..dc27abbc37 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/97/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/97/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\812World", "extra": { "raw": "\"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 88a3f339c1..7ceb0644f6 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/98/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/98/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\712World", "extra": { "raw": "\"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 d73cfa2bd0..1a8fc198f2 100644 --- a/packages/babel-parser/test/fixtures/core/uncategorised/99/output.json +++ b/packages/babel-parser/test/fixtures/core/uncategorised/99/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\0World", "extra": { "raw": "\"Hello\\0World\"", diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/output.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/output.json index 3d5c2a07c8..2770669d14 100644 --- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/output.json +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-rest/output.json @@ -1,113 +1,35 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected trailing comma after rest element (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "ArrayPattern", - "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}}, "extra": { "trailingComma": 5 }, "elements": [ { "type": "RestElement", - "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}}, "argument": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" } } @@ -115,18 +37,7 @@ }, "right": { "type": "ArrayExpression", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/output.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/output.json index f97d7f0db8..e854b9c5e7 100644 --- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/output.json +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-for-in/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected trailing comma after rest element (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "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}}, "left": { "type": "ArrayPattern", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "extra": { "trailingComma": 10 }, "elements": [ { "type": "RestElement", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10}}, "argument": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" } } @@ -100,34 +33,12 @@ }, "right": { "type": "ArrayExpression", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "elements": [] }, "body": { "type": "EmptyStatement", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}} } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/output.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/output.json index 4cbc33abae..9d70fca940 100644 --- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/output.json +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread-nested/output.json @@ -1,128 +1,39 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected trailing comma after rest element (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrayPattern", - "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}}, "elements": [ { "type": "ArrayPattern", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "extra": { "trailingComma": 6 }, "elements": [ { "type": "RestElement", - "start": 2, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":2,"end":6,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":6}}, "argument": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" } } @@ -132,18 +43,7 @@ }, "right": { "type": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread/output.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread/output.json index 0a80d6e9f9..cb05858a6f 100644 --- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread/output.json +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/comma-after-spread/output.json @@ -1,99 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, + "extra": { + "trailingComma": 5 }, "elements": [ { "type": "SpreadElement", - "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}}, "argument": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" } } - ], - "extra": { - "trailingComma": 5 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/with-object/output.json b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/with-object/output.json index 00177fa4ac..9b316c6cf6 100644 --- a/packages/babel-parser/test/fixtures/es2015/array-rest-spread/with-object/output.json +++ b/packages/babel-parser/test/fixtures/es2015/array-rest-spread/with-object/output.json @@ -1,156 +1,44 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":4,"end":30,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":30}}, "id": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "RestElement", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}}, "argument": { "type": "ObjectPattern", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "properties": [ { "type": "ObjectProperty", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "method": false, "key": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "length" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"length"}, "name": "length" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "length" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"length"}, "name": "length" }, "extra": { @@ -164,33 +52,11 @@ }, "init": { "type": "ArrayExpression", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "elements": [ { "type": "NumericLiteral", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, "extra": { "rawValue": 1, "raw": "1" @@ -199,18 +65,7 @@ }, { "type": "NumericLiteral", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}}, "extra": { "rawValue": 2, "raw": "2" @@ -219,18 +74,7 @@ }, { "type": "NumericLiteral", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29}}, "extra": { "rawValue": 3, "raw": "3" diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/create-parenthesized-expressions/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/create-parenthesized-expressions/output.json index 09568c70bb..4ead80d69a 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/create-parenthesized-expressions/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/create-parenthesized-expressions/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "foo" - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"foo"}, "name": "foo" } ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/in-logic-expression/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/in-logic-expression/output.json index 9eda4fb8ae..a7556bef89 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/in-logic-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/in-logic-expression/output.json @@ -1,94 +1,28 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "LogicalExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "left": { "type": "ArrowFunctionExpression", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] }, @@ -100,82 +34,27 @@ "operator": "||", "right": { "type": "BooleanLiteral", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}}, "value": true } } }, { "type": "ExpressionStatement", - "start": 20, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":20,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "expression": { "type": "ConditionalExpression", - "start": 20, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":20,"end":38,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "test": { "type": "ArrowFunctionExpression", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":21,"end":29,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":9}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":27,"end":29,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":9}}, "body": [], "directives": [] }, @@ -186,36 +65,12 @@ }, "consequent": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "a" - }, + "start":33,"end":34,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"a"}, "name": "a" }, "alternate": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "b" - }, + "start":37,"end":38,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"b"}, "name": "b" } } diff --git a/packages/babel-parser/test/fixtures/es2015/arrow-functions/object-rest-spread/output.json b/packages/babel-parser/test/fixtures/es2015/arrow-functions/object-rest-spread/output.json index 1ab7351858..5207b62072 100644 --- a/packages/babel-parser/test/fixtures/es2015/arrow-functions/object-rest-spread/output.json +++ b/packages/babel-parser/test/fixtures/es2015/arrow-functions/object-rest-spread/output.json @@ -1,162 +1,49 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":4,"end":43,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":1}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":43,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":12,"end":31,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":31}}, "properties": [ { "type": "ObjectProperty", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "method": false, "key": { "type": "Identifier", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "title" - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19},"identifierName":"title"}, "name": "title" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "title" - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19},"identifierName":"title"}, "name": "title" }, "extra": { @@ -165,33 +52,10 @@ }, { "type": "RestElement", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "argument": { "type": "Identifier", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "other" - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29},"identifierName":"other"}, "name": "other" } } @@ -200,18 +64,7 @@ ], "body": { "type": "BlockStatement", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":3,"column":1}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/output.json index 6a343317ea..a7fb3e5724 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-in-object-method/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":3}}, "errors": [ "SyntaxError: super is only allowed in object methods and classes (4:13)" ], "program": { "type": "Program", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":3}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":3}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - }, + "start":0,"end":86,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}}, "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": "Identifier", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "Object" - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"Object"}, "name": "Object" }, "property": { "type": "Identifier", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "create" - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13},"identifierName":"create"}, "name": "create" }, "computed": false @@ -113,209 +34,63 @@ "arguments": [ { "type": "ObjectExpression", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "properties": [] }, { "type": "ObjectExpression", - "start": 18, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":18,"end":85,"loc":{"start":{"line":1,"column":18},"end":{"line":7,"column":1}}, "properties": [ { "type": "ObjectProperty", - "start": 22, - "end": 83, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":22,"end":83,"loc":{"start":{"line":2,"column":2},"end":{"line":6,"column":3}}, "method": false, "key": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": false, "value": { "type": "ObjectExpression", - "start": 27, - "end": 83, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":27,"end":83,"loc":{"start":{"line":2,"column":7},"end":{"line":6,"column":3}}, "properties": [ { "type": "ObjectProperty", - "start": 33, - "end": 79, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":33,"end":79,"loc":{"start":{"line":3,"column":4},"end":{"line":5,"column":5}}, "method": false, "key": { "type": "Identifier", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "get" - }, + "start":33,"end":36,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"get"}, "name": "get" }, "computed": false, "shorthand": false, "value": { "type": "FunctionExpression", - "start": 38, - "end": 79, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":38,"end":79,"loc":{"start":{"line":3,"column":9},"end":{"line":5,"column":5}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 48, - "end": 79, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":48,"end":79,"loc":{"start":{"line":3,"column":19},"end":{"line":5,"column":5}}, "body": [ { "type": "ReturnStatement", - "start": 56, - "end": 73, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 23 - } - }, + "start":56,"end":73,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":23}}, "argument": { "type": "MemberExpression", - "start": 63, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 22 - } - }, + "start":63,"end":72,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":22}}, "object": { "type": "Super", - "start": 63, - "end": 68, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 18 - } - } + "start":63,"end":68,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":18}} }, "property": { "type": "Identifier", - "start": 69, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 22 - }, - "identifierName": "foo" - }, + "start":69,"end":72,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":22},"identifierName":"foo"}, "name": "foo" }, "computed": false diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/output.json index 65fe6001d2..8813fbf719 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/direct-super-outside-constructor/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (2:8)" ], "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":28,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -119,61 +40,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":17,"end":26,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":16}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":18,"end":25,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":15}}, "expression": { "type": "CallExpression", - "start": 18, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":18,"end":25,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":15}}, "callee": { "type": "Super", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - } + "start":18,"end":23,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":13}} }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/output.json index 328e55a13f..4fa31326d3 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-duplicate-method-params/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Argument name clash (2:11)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":30,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":16,"end":28,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}}, "static": false, "key": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "bar" - }, + "start":16,"end":19,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -119,53 +40,18 @@ "params": [ { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "a" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "a" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"a"}, "name": "a" } ], "body": { "type": "BlockStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":26,"end":28,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/output.json index 0ffcd2fd05..d5de1e2c20 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-generator-prototype/output.json @@ -1,115 +1,36 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Classes may not have static property named prototype (2:10)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":36,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":12,"end":34,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":24}}, "static": true, "kind": "method", "key": { "type": "Identifier", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "prototype" - }, + "start":20,"end":29,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":19},"identifierName":"prototype"}, "name": "prototype" }, "computed": false, @@ -119,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":32,"end":34,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":24}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/output.json index f78f786f6a..c4d1636033 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/disallow-static-prototype/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Classes may not have static property named prototype (2:9)" ], "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":35,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":12,"end":33,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":23}}, "static": true, "key": { "type": "Identifier", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "prototype" - }, + "start":19,"end":28,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":18},"identifierName":"prototype"}, "name": "prototype" }, "computed": false, @@ -119,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":31,"end":33,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":23}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/output.json index 1f5262e935..a135021f7a 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/getter-signature/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: getter must not have any formal parameters (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":31,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":12,"end":29,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "static": false, "key": { "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "prop" - }, + "start":16,"end":20,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":10},"identifierName":"prop"}, "name": "prop" }, "computed": false, @@ -119,36 +40,13 @@ "params": [ { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "arg" - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15},"identifierName":"arg"}, "name": "arg" } ], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":27,"end":29,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/linebreaks/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/linebreaks/output.json index c8f7cb8d1c..db62df91f9 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/linebreaks/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/linebreaks/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 239, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 42, - "column": 1 - } - }, + "start":0,"end":239,"loc":{"start":{"line":1,"column":0},"end":{"line":42,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 239, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 42, - "column": 1 - } - }, + "start":0,"end":239,"loc":{"start":{"line":1,"column":0},"end":{"line":42,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 239, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 42, - "column": 1 - } - }, + "start":0,"end":239,"loc":{"start":{"line":1,"column":0},"end":{"line":42,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 239, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 42, - "column": 1 - } - }, + "start":8,"end":239,"loc":{"start":{"line":1,"column":8},"end":{"line":42,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":12,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":7}}, "static": false, "key": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "a" - }, + "start":18,"end":19,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":25,"end":27,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 31, - "end": 47, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 8, - "column": 8 - } - }, + "start":31,"end":47,"loc":{"start":{"line":6,"column":2},"end":{"line":8,"column":8}}, "static": false, "key": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 3 - }, - "identifierName": "a" - }, + "start":37,"end":38,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -172,70 +59,24 @@ "params": [ { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 8, - "column": 3 - }, - "end": { - "line": 8, - "column": 4 - }, - "identifierName": "a" - }, + "start":42,"end":43,"loc":{"start":{"line":8,"column":3},"end":{"line":8,"column":4},"identifierName":"a"}, "name": "a" } ], "body": { "type": "BlockStatement", - "start": 45, - "end": 47, - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 8 - } - }, + "start":45,"end":47,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":8}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 51, - "end": 70, - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 11, - "column": 7 - } - }, + "start":51,"end":70,"loc":{"start":{"line":10,"column":2},"end":{"line":11,"column":7}}, "static": false, "key": { "type": "Identifier", - "start": 51, - "end": 62, - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 10, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":51,"end":62,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -246,52 +87,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 68, - "end": 70, - "loc": { - "start": { - "line": 11, - "column": 5 - }, - "end": { - "line": 11, - "column": 7 - } - }, + "start":68,"end":70,"loc":{"start":{"line":11,"column":5},"end":{"line":11,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 74, - "end": 83, - "loc": { - "start": { - "line": 13, - "column": 2 - }, - "end": { - "line": 14, - "column": 7 - } - }, + "start":74,"end":83,"loc":{"start":{"line":13,"column":2},"end":{"line":14,"column":7}}, "static": false, "key": { "type": "Identifier", - "start": 74, - "end": 75, - "loc": { - "start": { - "line": 13, - "column": 2 - }, - "end": { - "line": 13, - "column": 3 - }, - "identifierName": "a" - }, + "start":74,"end":75,"loc":{"start":{"line":13,"column":2},"end":{"line":13,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -302,53 +109,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 81, - "end": 83, - "loc": { - "start": { - "line": 14, - "column": 5 - }, - "end": { - "line": 14, - "column": 7 - } - }, + "start":81,"end":83,"loc":{"start":{"line":14,"column":5},"end":{"line":14,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 87, - "end": 100, - "loc": { - "start": { - "line": 16, - "column": 2 - }, - "end": { - "line": 18, - "column": 7 - } - }, + "start":87,"end":100,"loc":{"start":{"line":16,"column":2},"end":{"line":18,"column":7}}, "static": false, "kind": "method", "key": { "type": "Identifier", - "start": 91, - "end": 92, - "loc": { - "start": { - "line": 17, - "column": 2 - }, - "end": { - "line": 17, - "column": 3 - }, - "identifierName": "a" - }, + "start":91,"end":92,"loc":{"start":{"line":17,"column":2},"end":{"line":17,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -358,52 +131,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 98, - "end": 100, - "loc": { - "start": { - "line": 18, - "column": 5 - }, - "end": { - "line": 18, - "column": 7 - } - }, + "start":98,"end":100,"loc":{"start":{"line":18,"column":5},"end":{"line":18,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 104, - "end": 128, - "loc": { - "start": { - "line": 20, - "column": 2 - }, - "end": { - "line": 23, - "column": 7 - } - }, + "start":104,"end":128,"loc":{"start":{"line":20,"column":2},"end":{"line":23,"column":7}}, "static": true, "key": { "type": "Identifier", - "start": 119, - "end": 120, - "loc": { - "start": { - "line": 22, - "column": 2 - }, - "end": { - "line": 22, - "column": 3 - }, - "identifierName": "a" - }, + "start":119,"end":120,"loc":{"start":{"line":22,"column":2},"end":{"line":22,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -414,52 +153,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 126, - "end": 128, - "loc": { - "start": { - "line": 23, - "column": 5 - }, - "end": { - "line": 23, - "column": 7 - } - }, + "start":126,"end":128,"loc":{"start":{"line":23,"column":5},"end":{"line":23,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 132, - "end": 157, - "loc": { - "start": { - "line": 25, - "column": 2 - }, - "end": { - "line": 28, - "column": 8 - } - }, + "start":132,"end":157,"loc":{"start":{"line":25,"column":2},"end":{"line":28,"column":8}}, "static": true, "key": { "type": "Identifier", - "start": 147, - "end": 148, - "loc": { - "start": { - "line": 27, - "column": 2 - }, - "end": { - "line": 27, - "column": 3 - }, - "identifierName": "a" - }, + "start":147,"end":148,"loc":{"start":{"line":27,"column":2},"end":{"line":27,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -470,70 +175,24 @@ "params": [ { "type": "Identifier", - "start": 152, - "end": 153, - "loc": { - "start": { - "line": 28, - "column": 3 - }, - "end": { - "line": 28, - "column": 4 - }, - "identifierName": "a" - }, + "start":152,"end":153,"loc":{"start":{"line":28,"column":3},"end":{"line":28,"column":4},"identifierName":"a"}, "name": "a" } ], "body": { "type": "BlockStatement", - "start": 155, - "end": 157, - "loc": { - "start": { - "line": 28, - "column": 6 - }, - "end": { - "line": 28, - "column": 8 - } - }, + "start":155,"end":157,"loc":{"start":{"line":28,"column":6},"end":{"line":28,"column":8}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 161, - "end": 189, - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 32, - "column": 7 - } - }, + "start":161,"end":189,"loc":{"start":{"line":30,"column":2},"end":{"line":32,"column":7}}, "static": true, "key": { "type": "Identifier", - "start": 170, - "end": 181, - "loc": { - "start": { - "line": 31, - "column": 2 - }, - "end": { - "line": 31, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":170,"end":181,"loc":{"start":{"line":31,"column":2},"end":{"line":31,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -544,52 +203,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 187, - "end": 189, - "loc": { - "start": { - "line": 32, - "column": 5 - }, - "end": { - "line": 32, - "column": 7 - } - }, + "start":187,"end":189,"loc":{"start":{"line":32,"column":5},"end":{"line":32,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 193, - "end": 211, - "loc": { - "start": { - "line": 34, - "column": 2 - }, - "end": { - "line": 36, - "column": 7 - } - }, + "start":193,"end":211,"loc":{"start":{"line":34,"column":2},"end":{"line":36,"column":7}}, "static": true, "key": { "type": "Identifier", - "start": 202, - "end": 203, - "loc": { - "start": { - "line": 35, - "column": 2 - }, - "end": { - "line": 35, - "column": 3 - }, - "identifierName": "a" - }, + "start":202,"end":203,"loc":{"start":{"line":35,"column":2},"end":{"line":35,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -600,53 +225,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 209, - "end": 211, - "loc": { - "start": { - "line": 36, - "column": 5 - }, - "end": { - "line": 36, - "column": 7 - } - }, + "start":209,"end":211,"loc":{"start":{"line":36,"column":5},"end":{"line":36,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 215, - "end": 237, - "loc": { - "start": { - "line": 38, - "column": 2 - }, - "end": { - "line": 41, - "column": 7 - } - }, + "start":215,"end":237,"loc":{"start":{"line":38,"column":2},"end":{"line":41,"column":7}}, "static": true, "kind": "method", "key": { "type": "Identifier", - "start": 228, - "end": 229, - "loc": { - "start": { - "line": 40, - "column": 2 - }, - "end": { - "line": 40, - "column": 3 - }, - "identifierName": "a" - }, + "start":228,"end":229,"loc":{"start":{"line":40,"column":2},"end":{"line":40,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -656,18 +247,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 235, - "end": 237, - "loc": { - "start": { - "line": 41, - "column": 5 - }, - "end": { - "line": 41, - "column": 7 - } - }, + "start":235,"end":237,"loc":{"start":{"line":41,"column":5},"end":{"line":41,"column":7}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/output.json index 6ecafb90e3..8fa6cbb497 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/malformed-super-expression/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (3:4)" ], "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":8,"end":39,"loc":{"start":{"line":1,"column":8},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":12,"end":37,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -119,77 +40,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":17,"end":37,"loc":{"start":{"line":2,"column":7},"end":{"line":4,"column":3}}, "body": [ { "type": "ExpressionStatement", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":23,"end":33,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":14}}, "expression": { "type": "BinaryExpression", - "start": 23, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":23,"end":32,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13}}, "left": { "type": "Super", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 9 - } - } + "start":23,"end":28,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":9}} }, "operator": "-", "right": { "type": "NumericLiteral", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":31,"end":32,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2015/class-methods/tricky-names/output.json b/packages/babel-parser/test/fixtures/es2015/class-methods/tricky-names/output.json index 7c4b9b67d1..05b7dbe0ca 100644 --- a/packages/babel-parser/test/fixtures/es2015/class-methods/tricky-names/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class-methods/tricky-names/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 311, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 55, - "column": 1 - } - }, + "start":0,"end":311,"loc":{"start":{"line":1,"column":0},"end":{"line":55,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 311, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 55, - "column": 1 - } - }, + "start":0,"end":311,"loc":{"start":{"line":1,"column":0},"end":{"line":55,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 311, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 55, - "column": 1 - } - }, + "start":0,"end":311,"loc":{"start":{"line":1,"column":0},"end":{"line":55,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 311, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 55, - "column": 1 - } - }, + "start":8,"end":311,"loc":{"start":{"line":1,"column":8},"end":{"line":55,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":7}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "get" - }, + "start":12,"end":15,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"get"}, "name": "get" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":21,"end":23,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 27, - "end": 38, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 6, - "column": 7 - } - }, + "start":27,"end":38,"loc":{"start":{"line":5,"column":2},"end":{"line":6,"column":7}}, "static": false, "key": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 5 - }, - "identifierName": "set" - }, + "start":27,"end":30,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":5},"identifierName":"set"}, "name": "set" }, "computed": false, @@ -172,53 +59,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 7 - } - }, + "start":36,"end":38,"loc":{"start":{"line":6,"column":5},"end":{"line":6,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 42, - "end": 56, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 9, - "column": 7 - } - }, + "start":42,"end":56,"loc":{"start":{"line":8,"column":2},"end":{"line":9,"column":7}}, "kind": "method", "computed": false, "key": { "type": "Identifier", - "start": 42, - "end": 48, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 8 - }, - "identifierName": "static" - }, + "start":42,"end":48,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":8},"identifierName":"static"}, "name": "static" }, "static": false, @@ -228,52 +81,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 54, - "end": 56, - "loc": { - "start": { - "line": 9, - "column": 5 - }, - "end": { - "line": 9, - "column": 7 - } - }, + "start":54,"end":56,"loc":{"start":{"line":9,"column":5},"end":{"line":9,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 60, - "end": 73, - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 12, - "column": 7 - } - }, + "start":60,"end":73,"loc":{"start":{"line":11,"column":2},"end":{"line":12,"column":7}}, "static": false, "key": { "type": "Identifier", - "start": 60, - "end": 65, - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 11, - "column": 7 - }, - "identifierName": "async" - }, + "start":60,"end":65,"loc":{"start":{"line":11,"column":2},"end":{"line":11,"column":7},"identifierName":"async"}, "name": "async" }, "computed": false, @@ -284,51 +103,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 71, - "end": 73, - "loc": { - "start": { - "line": 12, - "column": 5 - }, - "end": { - "line": 12, - "column": 7 - } - }, + "start":71,"end":73,"loc":{"start":{"line":12,"column":5},"end":{"line":12,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 78, - "end": 91, - "loc": { - "start": { - "line": 15, - "column": 2 - }, - "end": { - "line": 16, - "column": 7 - } - }, + "start":78,"end":91,"loc":{"start":{"line":15,"column":2},"end":{"line":16,"column":7}}, "static": false, "key": { "type": "StringLiteral", - "start": 78, - "end": 83, - "loc": { - "start": { - "line": 15, - "column": 2 - }, - "end": { - "line": 15, - "column": 7 - } - }, + "start":78,"end":83,"loc":{"start":{"line":15,"column":2},"end":{"line":15,"column":7}}, "extra": { "rawValue": "get", "raw": "'get'" @@ -343,51 +129,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 89, - "end": 91, - "loc": { - "start": { - "line": 16, - "column": 5 - }, - "end": { - "line": 16, - "column": 7 - } - }, + "start":89,"end":91,"loc":{"start":{"line":16,"column":5},"end":{"line":16,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 95, - "end": 108, - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 19, - "column": 7 - } - }, + "start":95,"end":108,"loc":{"start":{"line":18,"column":2},"end":{"line":19,"column":7}}, "static": false, "key": { "type": "StringLiteral", - "start": 95, - "end": 100, - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 7 - } - }, + "start":95,"end":100,"loc":{"start":{"line":18,"column":2},"end":{"line":18,"column":7}}, "extra": { "rawValue": "set", "raw": "'set'" @@ -402,51 +155,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 106, - "end": 108, - "loc": { - "start": { - "line": 19, - "column": 5 - }, - "end": { - "line": 19, - "column": 7 - } - }, + "start":106,"end":108,"loc":{"start":{"line":19,"column":5},"end":{"line":19,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 112, - "end": 127, - "loc": { - "start": { - "line": 21, - "column": 2 - }, - "end": { - "line": 22, - "column": 7 - } - }, + "start":112,"end":127,"loc":{"start":{"line":21,"column":2},"end":{"line":22,"column":7}}, "static": false, "key": { "type": "StringLiteral", - "start": 112, - "end": 119, - "loc": { - "start": { - "line": 21, - "column": 2 - }, - "end": { - "line": 21, - "column": 9 - } - }, + "start":112,"end":119,"loc":{"start":{"line":21,"column":2},"end":{"line":21,"column":9}}, "extra": { "rawValue": "async", "raw": "'async'" @@ -461,52 +181,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 125, - "end": 127, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 7 - } - }, + "start":125,"end":127,"loc":{"start":{"line":22,"column":5},"end":{"line":22,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 132, - "end": 152, - "loc": { - "start": { - "line": 25, - "column": 2 - }, - "end": { - "line": 27, - "column": 7 - } - }, + "start":132,"end":152,"loc":{"start":{"line":25,"column":2},"end":{"line":27,"column":7}}, "static": true, "key": { "type": "Identifier", - "start": 141, - "end": 144, - "loc": { - "start": { - "line": 26, - "column": 2 - }, - "end": { - "line": 26, - "column": 5 - }, - "identifierName": "get" - }, + "start":141,"end":144,"loc":{"start":{"line":26,"column":2},"end":{"line":26,"column":5},"identifierName":"get"}, "name": "get" }, "computed": false, @@ -517,52 +203,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 150, - "end": 152, - "loc": { - "start": { - "line": 27, - "column": 5 - }, - "end": { - "line": 27, - "column": 7 - } - }, + "start":150,"end":152,"loc":{"start":{"line":27,"column":5},"end":{"line":27,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 156, - "end": 176, - "loc": { - "start": { - "line": 29, - "column": 2 - }, - "end": { - "line": 31, - "column": 7 - } - }, + "start":156,"end":176,"loc":{"start":{"line":29,"column":2},"end":{"line":31,"column":7}}, "static": true, "key": { "type": "Identifier", - "start": 165, - "end": 168, - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 30, - "column": 5 - }, - "identifierName": "set" - }, + "start":165,"end":168,"loc":{"start":{"line":30,"column":2},"end":{"line":30,"column":5},"identifierName":"set"}, "name": "set" }, "computed": false, @@ -573,52 +225,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 174, - "end": 176, - "loc": { - "start": { - "line": 31, - "column": 5 - }, - "end": { - "line": 31, - "column": 7 - } - }, + "start":174,"end":176,"loc":{"start":{"line":31,"column":5},"end":{"line":31,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 180, - "end": 203, - "loc": { - "start": { - "line": 33, - "column": 2 - }, - "end": { - "line": 35, - "column": 7 - } - }, + "start":180,"end":203,"loc":{"start":{"line":33,"column":2},"end":{"line":35,"column":7}}, "static": true, "key": { "type": "Identifier", - "start": 189, - "end": 195, - "loc": { - "start": { - "line": 34, - "column": 2 - }, - "end": { - "line": 34, - "column": 8 - }, - "identifierName": "static" - }, + "start":189,"end":195,"loc":{"start":{"line":34,"column":2},"end":{"line":34,"column":8},"identifierName":"static"}, "name": "static" }, "computed": false, @@ -629,52 +247,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 201, - "end": 203, - "loc": { - "start": { - "line": 35, - "column": 5 - }, - "end": { - "line": 35, - "column": 7 - } - }, + "start":201,"end":203,"loc":{"start":{"line":35,"column":5},"end":{"line":35,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 207, - "end": 229, - "loc": { - "start": { - "line": 37, - "column": 2 - }, - "end": { - "line": 39, - "column": 7 - } - }, + "start":207,"end":229,"loc":{"start":{"line":37,"column":2},"end":{"line":39,"column":7}}, "static": true, "key": { "type": "Identifier", - "start": 216, - "end": 221, - "loc": { - "start": { - "line": 38, - "column": 2 - }, - "end": { - "line": 38, - "column": 7 - }, - "identifierName": "async" - }, + "start":216,"end":221,"loc":{"start":{"line":38,"column":2},"end":{"line":38,"column":7},"identifierName":"async"}, "name": "async" }, "computed": false, @@ -685,52 +269,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 227, - "end": 229, - "loc": { - "start": { - "line": 39, - "column": 5 - }, - "end": { - "line": 39, - "column": 7 - } - }, + "start":227,"end":229,"loc":{"start":{"line":39,"column":5},"end":{"line":39,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 233, - "end": 251, - "loc": { - "start": { - "line": 41, - "column": 2 - }, - "end": { - "line": 43, - "column": 7 - } - }, + "start":233,"end":251,"loc":{"start":{"line":41,"column":2},"end":{"line":43,"column":7}}, "static": true, "key": { "type": "Identifier", - "start": 242, - "end": 243, - "loc": { - "start": { - "line": 42, - "column": 2 - }, - "end": { - "line": 42, - "column": 3 - }, - "identifierName": "a" - }, + "start":242,"end":243,"loc":{"start":{"line":42,"column":2},"end":{"line":42,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -741,52 +291,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 249, - "end": 251, - "loc": { - "start": { - "line": 43, - "column": 5 - }, - "end": { - "line": 43, - "column": 7 - } - }, + "start":249,"end":251,"loc":{"start":{"line":43,"column":5},"end":{"line":43,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 256, - "end": 275, - "loc": { - "start": { - "line": 46, - "column": 2 - }, - "end": { - "line": 48, - "column": 7 - } - }, + "start":256,"end":275,"loc":{"start":{"line":46,"column":2},"end":{"line":48,"column":7}}, "static": false, "key": { "type": "Identifier", - "start": 262, - "end": 267, - "loc": { - "start": { - "line": 47, - "column": 2 - }, - "end": { - "line": 47, - "column": 7 - }, - "identifierName": "async" - }, + "start":262,"end":267,"loc":{"start":{"line":47,"column":2},"end":{"line":47,"column":7},"identifierName":"async"}, "name": "async" }, "computed": false, @@ -797,52 +313,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 273, - "end": 275, - "loc": { - "start": { - "line": 48, - "column": 5 - }, - "end": { - "line": 48, - "column": 7 - } - }, + "start":273,"end":275,"loc":{"start":{"line":48,"column":5},"end":{"line":48,"column":7}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 280, - "end": 309, - "loc": { - "start": { - "line": 51, - "column": 2 - }, - "end": { - "line": 54, - "column": 7 - } - }, + "start":280,"end":309,"loc":{"start":{"line":51,"column":2},"end":{"line":54,"column":7}}, "static": true, "key": { "type": "Identifier", - "start": 295, - "end": 301, - "loc": { - "start": { - "line": 53, - "column": 2 - }, - "end": { - "line": 53, - "column": 8 - }, - "identifierName": "static" - }, + "start":295,"end":301,"loc":{"start":{"line":53,"column":2},"end":{"line":53,"column":8},"identifierName":"static"}, "name": "static" }, "computed": false, @@ -853,18 +335,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 307, - "end": 309, - "loc": { - "start": { - "line": 54, - "column": 5 - }, - "end": { - "line": 54, - "column": 7 - } - }, + "start":307,"end":309,"loc":{"start":{"line":54,"column":5},"end":{"line":54,"column":7}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/class/division/output.json b/packages/babel-parser/test/fixtures/es2015/class/division/output.json index 0a4a21ad4d..76937cc4f1 100644 --- a/packages/babel-parser/test/fixtures/es2015/class/division/output.json +++ b/packages/babel-parser/test/fixtures/es2015/class/division/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 10 - } - }, + "start":0,"end":86,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 10 - } - }, + "start":0,"end":86,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":10}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "BinaryExpression", - "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}}, "left": { "type": "ClassExpression", - "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}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "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}}, "body": [] } }, "operator": "/", "right": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"foo"}, "name": "foo" } } @@ -145,272 +44,80 @@ }, { "type": "ExpressionStatement", - "start": 19, - "end": 86, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 9, - "column": 10 - } - }, + "start":19,"end":86,"loc":{"start":{"line":3,"column":0},"end":{"line":9,"column":10}}, "expression": { "type": "AssignmentExpression", - "start": 19, - "end": 86, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 9, - "column": 10 - } - }, + "start":19,"end":86,"loc":{"start":{"line":3,"column":0},"end":{"line":9,"column":10}}, "operator": "=", "left": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - }, - "identifierName": "x" - }, + "start":19,"end":20,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":1},"identifierName":"x"}, "name": "x" }, "right": { "type": "BinaryExpression", - "start": 23, - "end": 86, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 9, - "column": 10 - } - }, + "start":23,"end":86,"loc":{"start":{"line":3,"column":4},"end":{"line":9,"column":10}}, "left": { "type": "BinaryExpression", - "start": 23, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":23,"end":36,"loc":{"start":{"line":3,"column":4},"end":{"line":4,"column":5}}, "left": { "type": "ClassExpression", - "start": 23, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":23,"end":30,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":11}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":28,"end":30,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "body": [] } }, "operator": "/", "right": { "type": "Identifier", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "foo" - }, + "start":33,"end":36,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":5},"identifierName":"foo"}, "name": "foo" } }, "operator": "/", "right": { "type": "CallExpression", - "start": 39, - "end": 86, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 9, - "column": 10 - } - }, + "start":39,"end":86,"loc":{"start":{"line":4,"column":8},"end":{"line":9,"column":10}}, "callee": { "type": "CallExpression", - "start": 39, - "end": 61, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 6, - "column": 19 - } - }, + "start":39,"end":61,"loc":{"start":{"line":4,"column":8},"end":{"line":6,"column":19}}, "callee": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 9 - }, - "identifierName": "g" - }, + "start":39,"end":40,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":9},"identifierName":"g"}, "name": "g" }, "arguments": [ { "type": "AssignmentExpression", - "start": 43, - "end": 60, - "loc": { - "start": { - "line": 6, - "column": 1 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":43,"end":60,"loc":{"start":{"line":6,"column":1},"end":{"line":6,"column":18}}, "operator": "=", "left": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 6, - "column": 1 - }, - "end": { - "line": 6, - "column": 2 - }, - "identifierName": "x" - }, + "start":43,"end":44,"loc":{"start":{"line":6,"column":1},"end":{"line":6,"column":2},"identifierName":"x"}, "name": "x" }, "right": { "type": "BinaryExpression", - "start": 47, - "end": 60, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":47,"end":60,"loc":{"start":{"line":6,"column":5},"end":{"line":6,"column":18}}, "left": { "type": "ClassExpression", - "start": 47, - "end": 54, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 12 - } - }, + "start":47,"end":54,"loc":{"start":{"line":6,"column":5},"end":{"line":6,"column":12}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "start": 52, - "end": 54, - "loc": { - "start": { - "line": 6, - "column": 10 - }, - "end": { - "line": 6, - "column": 12 - } - }, + "start":52,"end":54,"loc":{"start":{"line":6,"column":10},"end":{"line":6,"column":12}}, "body": [] } }, "operator": "/", "right": { "type": "Identifier", - "start": 57, - "end": 60, - "loc": { - "start": { - "line": 6, - "column": 15 - }, - "end": { - "line": 6, - "column": 18 - }, - "identifierName": "foo" - }, + "start":57,"end":60,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":18},"identifierName":"foo"}, "name": "foo" } } @@ -420,132 +127,41 @@ "arguments": [ { "type": "AssignmentExpression", - "start": 64, - "end": 85, - "loc": { - "start": { - "line": 8, - "column": 1 - }, - "end": { - "line": 9, - "column": 9 - } - }, + "start":64,"end":85,"loc":{"start":{"line":8,"column":1},"end":{"line":9,"column":9}}, "operator": "=", "left": { "type": "Identifier", - "start": 64, - "end": 65, - "loc": { - "start": { - "line": 8, - "column": 1 - }, - "end": { - "line": 8, - "column": 2 - }, - "identifierName": "x" - }, + "start":64,"end":65,"loc":{"start":{"line":8,"column":1},"end":{"line":8,"column":2},"identifierName":"x"}, "name": "x" }, "right": { "type": "BinaryExpression", - "start": 68, - "end": 85, - "loc": { - "start": { - "line": 8, - "column": 5 - }, - "end": { - "line": 9, - "column": 9 - } - }, + "start":68,"end":85,"loc":{"start":{"line":8,"column":5},"end":{"line":9,"column":9}}, "left": { "type": "BinaryExpression", - "start": 68, - "end": 81, - "loc": { - "start": { - "line": 8, - "column": 5 - }, - "end": { - "line": 9, - "column": 5 - } - }, + "start":68,"end":81,"loc":{"start":{"line":8,"column":5},"end":{"line":9,"column":5}}, "left": { "type": "ClassExpression", - "start": 68, - "end": 75, - "loc": { - "start": { - "line": 8, - "column": 5 - }, - "end": { - "line": 8, - "column": 12 - } - }, + "start":68,"end":75,"loc":{"start":{"line":8,"column":5},"end":{"line":8,"column":12}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "start": 73, - "end": 75, - "loc": { - "start": { - "line": 8, - "column": 10 - }, - "end": { - "line": 8, - "column": 12 - } - }, + "start":73,"end":75,"loc":{"start":{"line":8,"column":10},"end":{"line":8,"column":12}}, "body": [] } }, "operator": "/", "right": { "type": "Identifier", - "start": 78, - "end": 81, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 5 - }, - "identifierName": "foo" - }, + "start":78,"end":81,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":5},"identifierName":"foo"}, "name": "foo" } }, "operator": "/", "right": { "type": "Identifier", - "start": 84, - "end": 85, - "loc": { - "start": { - "line": 9, - "column": 8 - }, - "end": { - "line": 9, - "column": 9 - }, - "identifierName": "g" - }, + "start":84,"end":85,"loc":{"start":{"line":9,"column":8},"end":{"line":9,"column":9},"identifierName":"g"}, "name": "g" } } 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 efd21a8e71..5b9c55e234 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 @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":7}}, "errors": [ "SyntaxError: 'with' in strict mode (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":7}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":7}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": { "type": "CallExpression", - "start": 17, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":17,"end":60,"loc":{"start":{"line":1,"column":17},"end":{"line":4,"column":3}}, "callee": { "type": "FunctionExpression", - "start": 17, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":17,"end":58,"loc":{"start":{"line":1,"column":17},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "B" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"B"}, "name": "B" }, "generator": false, @@ -113,94 +34,27 @@ "params": [], "body": { "type": "BlockStatement", - "start": 30, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":30,"end":58,"loc":{"start":{"line":1,"column":30},"end":{"line":4,"column":1}}, "body": [ { "type": "WithStatement", - "start": 34, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":34,"end":44,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "object": { "type": "ObjectExpression", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":40,"end":42,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":10}}, "properties": [] }, "body": { "type": "EmptyStatement", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - } - } + "start":43,"end":44,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12}} } }, { "type": "ReturnStatement", - "start": 47, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":47,"end":56,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":11}}, "argument": { "type": "Identifier", - "start": 54, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "B" - }, + "start":54,"end":55,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"B"}, "name": "B" } } @@ -216,18 +70,7 @@ }, "body": { "type": "ClassBody", - "start": 62, - "end": 64, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":62,"end":64,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":7}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/computed-properties/call-expression/output.json b/packages/babel-parser/test/fixtures/es2015/computed-properties/call-expression/output.json index 8f7759b25a..2e79028e28 100644 --- a/packages/babel-parser/test/fixtures/es2015/computed-properties/call-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2015/computed-properties/call-expression/output.json @@ -1,140 +1,39 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":1}}, "id": { "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" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "properties": [ { "type": "ObjectProperty", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "method": false, "computed": true, "key": { "type": "CallExpression", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":15,"end":20,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":8}}, "callee": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "bar" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"bar"}, "name": "bar" }, "arguments": [] @@ -142,18 +41,7 @@ "shorthand": false, "value": { "type": "StringLiteral", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "extra": { "rawValue": "", "raw": "\"\"" 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 7d830d5691..0c6596304a 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 @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Unexpected keyword 'this' (1:6)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ObjectPattern", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "this" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"this"}, "name": "this" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "this" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"this"}, "name": "this" }, "extra": { @@ -135,18 +45,7 @@ }, "init": { "type": "ObjectExpression", - "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}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-1/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-1/output.json index f82a656eae..0a076f1f94 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-1/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-1/output.json @@ -1,179 +1,54 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":1,"end":36,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":36}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 1, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":1,"end":31,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":31}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":3,"end":15,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":15}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" } }, { "type": "ObjectProperty", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "__proto__" - }, + "start":17,"end":26,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":26},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "y" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"y"}, "name": "y" } } @@ -181,18 +56,7 @@ }, "right": { "type": "ObjectExpression", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "properties": [] }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-2/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-2/output.json index 3646ce22df..7b4bfce9c8 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-2/output.json @@ -1,194 +1,58 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, "operator": "=", "left": { "type": "ArrayPattern", - "start": 1, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, "elements": [ { "type": "ObjectPattern", - "start": 2, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":2,"end":32,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":32}}, "properties": [ { "type": "ObjectProperty", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 4, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "__proto__" - }, + "start":4,"end":13,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":13},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "x" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"x"}, "name": "x" } }, { "type": "ObjectProperty", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "method": false, "key": { "type": "Identifier", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "__proto__" - }, + "start":18,"end":27,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":27},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "y" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"y"}, "name": "y" } } @@ -198,33 +62,11 @@ }, "right": { "type": "ArrayExpression", - "start": 36, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":36,"end":40,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":40}}, "elements": [ { "type": "ObjectExpression", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":37,"end":39,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":39}}, "properties": [] } ] diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-3/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-3/output.json index 27df8bb440..405f42004a 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-3/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-3/output.json @@ -1,182 +1,57 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 1, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":1,"end":31,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":31}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":3,"end":15,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":15}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" } }, { "type": "ObjectProperty", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "__proto__" - }, + "start":17,"end":26,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":26},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "y" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"y"}, "name": "y" } } @@ -185,18 +60,7 @@ ], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-4/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-4/output.json index 7b98cc79a7..ef78a8daa0 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-4/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/duplicate-proto-4/output.json @@ -1,234 +1,74 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 1, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":1,"end":45,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":45}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":3,"end":15,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":15}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" } }, { "type": "ObjectProperty", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "__proto__" - }, + "start":17,"end":26,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":26},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "y" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"y"}, "name": "y" } }, { "type": "ObjectProperty", - "start": 31, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":31,"end":43,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":43}}, "method": false, "key": { "type": "Identifier", - "start": 31, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "__proto__" - }, + "start":31,"end":40,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":40},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "z" - }, + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"z"}, "name": "z" } } @@ -237,18 +77,7 @@ ], "body": { "type": "BlockStatement", - "start": 50, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":50,"end":52,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":52}}, "body": [], "directives": [] } @@ -257,4 +86,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json index 5a29fd6b5f..9c735221c5 100644 --- a/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json +++ b/packages/babel-parser/test/fixtures/es2015/destructuring/error-operator-for-default/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Only '=' operator can be used for specifying default value. (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, "operator": "=", "left": { "type": "ArrayPattern", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "elements": [ { "type": "AssignmentPattern", - "start": 2, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":2,"end":8,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":8}}, "left": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "right": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" } } @@ -129,19 +39,7 @@ }, "right": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "a" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"a"}, "name": "a" }, "extra": { 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 16f7d7f8e5..f0bbee72ab 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 @@ -1,96 +1,29 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrayPattern", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "elements": [ { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" } ], @@ -101,18 +34,7 @@ }, "right": { "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/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json b/packages/babel-parser/test/fixtures/es2015/destructuring/parenthesized-lhs-object/output.json index b84a782694..2519d3595f 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 @@ -1,130 +1,40 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ObjectPattern", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "extra": { @@ -139,18 +49,7 @@ }, "right": { "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/fixtures/es2015/duplicate-proto/in-new-expression/output.json b/packages/babel-parser/test/fixtures/es2015/duplicate-proto/in-new-expression/output.json index 8b1e9a9a78..41eade104e 100644 --- a/packages/babel-parser/test/fixtures/es2015/duplicate-proto/in-new-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2015/duplicate-proto/in-new-expression/output.json @@ -1,195 +1,59 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ "SyntaxError: Redefinition of __proto__ property (1:24)" ], "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "expression": { "type": "NewExpression", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "callee": { "type": "MemberExpression", - "start": 4, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":4,"end":52,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":52}}, "object": { "type": "ObjectExpression", - "start": 4, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":4,"end":42,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":42}}, "properties": [ { "type": "ObjectProperty", - "start": 5, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":5,"end":22,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":22}}, "method": false, "key": { "type": "Identifier", - "start": 5, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "__proto__" - }, + "start":5,"end":14,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":14},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "Number" - }, + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22},"identifierName":"Number"}, "name": "Number" } }, { "type": "ObjectProperty", - "start": 24, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":24,"end":41,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":41}}, "method": false, "key": { "type": "Identifier", - "start": 24, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "__proto__" - }, + "start":24,"end":33,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":33},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "Number" - }, + "start":35,"end":41,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":41},"identifierName":"Number"}, "name": "Number" } } @@ -197,19 +61,7 @@ }, "property": { "type": "Identifier", - "start": 43, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 52 - }, - "identifierName": "__proto__" - }, + "start":43,"end":52,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":52},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/output.json index bde13b8bdb..838c1aea7f 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-in/bare-initializer/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "errors": [ "SyntaxError: Invalid left-hand side in for-loop (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": null @@ -85,63 +29,18 @@ }, { "type": "ForInStatement", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":7,"end":25,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "left": { "type": "AssignmentPattern", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":12,"end":17,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":10}}, "left": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "a" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"a"}, "name": "a" }, "right": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "extra": { "rawValue": 0, "raw": "0" @@ -151,34 +50,12 @@ }, "right": { "type": "ObjectExpression", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":21,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "properties": [] }, "body": { "type": "EmptyStatement", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - } - } + "start":24,"end":25,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18}} } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/output.json index b85f54f500..4e70874d27 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-in/const-initializer/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a" }, "init": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 0, "raw": "0" @@ -118,34 +40,12 @@ }, "right": { "type": "ObjectExpression", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "properties": [] }, "body": { "type": "EmptyStatement", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/output.json index d890ea49e1..c3c20c0a10 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-in/let-initializer/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":5,"end":14,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "init": { "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": 0, "raw": "0" @@ -118,34 +40,12 @@ }, "right": { "type": "ObjectExpression", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "properties": [] }, "body": { "type": "EmptyStatement", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}} } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/nonstrict-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/nonstrict-initializer/output.json index 155cc10f02..b97f056fd1 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-in/nonstrict-initializer/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-in/nonstrict-initializer/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 144, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":0,"end":144,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":3}}, "program": { "type": "Program", - "start": 0, - "end": 144, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":0,"end":144,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":3}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 2, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":2,"end":18,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, "id": { "type": "Identifier", - "start": 6, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "effects" - }, + "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13},"identifierName":"effects"}, "name": "effects" }, "init": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -101,64 +34,19 @@ }, { "type": "VariableDeclaration", - "start": 21, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":21,"end":40,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 25, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":25,"end":39,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":20}}, "id": { "type": "Identifier", - "start": 25, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "iterations" - }, + "start":25,"end":35,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":16},"identifierName":"iterations"}, "name": "iterations" }, "init": { "type": "NumericLiteral", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":38,"end":39,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20}}, "extra": { "rawValue": 0, "raw": "0" @@ -171,48 +59,14 @@ }, { "type": "VariableDeclaration", - "start": 43, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":43,"end":54,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, "declarations": [ { "type": "VariableDeclarator", - "start": 47, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":47,"end":53,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":12}}, "id": { "type": "Identifier", - "start": 47, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 12 - }, - "identifierName": "stored" - }, + "start":47,"end":53,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":12},"identifierName":"stored"}, "name": "stored" }, "init": null @@ -222,143 +76,42 @@ }, { "type": "ForInStatement", - "start": 57, - "end": 144, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":57,"end":144,"loc":{"start":{"line":4,"column":2},"end":{"line":6,"column":3}}, "left": { "type": "VariableDeclaration", - "start": 62, - "end": 85, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 30 - } - }, + "start":62,"end":85,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":30}}, "declarations": [ { "type": "VariableDeclarator", - "start": 66, - "end": 85, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 30 - } - }, + "start":66,"end":85,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":30}}, "id": { "type": "Identifier", - "start": 66, - "end": 67, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 12 - }, - "identifierName": "a" - }, + "start":66,"end":67,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":12},"identifierName":"a"}, "name": "a" }, "init": { "type": "SequenceExpression", - "start": 71, - "end": 84, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":71,"end":84,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":29}}, "expressions": [ { "type": "UpdateExpression", - "start": 71, - "end": 80, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":71,"end":80,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":25}}, "operator": "++", "prefix": true, "argument": { "type": "Identifier", - "start": 73, - "end": 80, - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 25 - }, - "identifierName": "effects" - }, + "start":73,"end":80,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":25},"identifierName":"effects"}, "name": "effects" } }, { "type": "UnaryExpression", - "start": 82, - "end": 84, - "loc": { - "start": { - "line": 4, - "column": 27 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":82,"end":84,"loc":{"start":{"line":4,"column":27},"end":{"line":4,"column":29}}, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 83, - "end": 84, - "loc": { - "start": { - "line": 4, - "column": 28 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":83,"end":84,"loc":{"start":{"line":4,"column":28},"end":{"line":4,"column":29}}, "extra": { "rawValue": 1, "raw": "1" @@ -378,132 +131,41 @@ }, "right": { "type": "SequenceExpression", - "start": 89, - "end": 119, - "loc": { - "start": { - "line": 4, - "column": 34 - }, - "end": { - "line": 4, - "column": 64 - } - }, + "start":89,"end":119,"loc":{"start":{"line":4,"column":34},"end":{"line":4,"column":64}}, "expressions": [ { "type": "AssignmentExpression", - "start": 89, - "end": 99, - "loc": { - "start": { - "line": 4, - "column": 34 - }, - "end": { - "line": 4, - "column": 44 - } - }, + "start":89,"end":99,"loc":{"start":{"line":4,"column":34},"end":{"line":4,"column":44}}, "operator": "=", "left": { "type": "Identifier", - "start": 89, - "end": 95, - "loc": { - "start": { - "line": 4, - "column": 34 - }, - "end": { - "line": 4, - "column": 40 - }, - "identifierName": "stored" - }, + "start":89,"end":95,"loc":{"start":{"line":4,"column":34},"end":{"line":4,"column":40},"identifierName":"stored"}, "name": "stored" }, "right": { "type": "Identifier", - "start": 98, - "end": 99, - "loc": { - "start": { - "line": 4, - "column": 43 - }, - "end": { - "line": 4, - "column": 44 - }, - "identifierName": "a" - }, + "start":98,"end":99,"loc":{"start":{"line":4,"column":43},"end":{"line":4,"column":44},"identifierName":"a"}, "name": "a" } }, { "type": "ObjectExpression", - "start": 101, - "end": 119, - "loc": { - "start": { - "line": 4, - "column": 46 - }, - "end": { - "line": 4, - "column": 64 - } - }, + "start":101,"end":119,"loc":{"start":{"line":4,"column":46},"end":{"line":4,"column":64}}, "properties": [ { "type": "ObjectProperty", - "start": 102, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 47 - }, - "end": { - "line": 4, - "column": 51 - } - }, + "start":102,"end":106,"loc":{"start":{"line":4,"column":47},"end":{"line":4,"column":51}}, "method": false, "key": { "type": "Identifier", - "start": 102, - "end": 103, - "loc": { - "start": { - "line": 4, - "column": 47 - }, - "end": { - "line": 4, - "column": 48 - }, - "identifierName": "a" - }, + "start":102,"end":103,"loc":{"start":{"line":4,"column":47},"end":{"line":4,"column":48},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 105, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 50 - }, - "end": { - "line": 4, - "column": 51 - } - }, + "start":105,"end":106,"loc":{"start":{"line":4,"column":50},"end":{"line":4,"column":51}}, "extra": { "rawValue": 0, "raw": "0" @@ -513,52 +175,18 @@ }, { "type": "ObjectProperty", - "start": 108, - "end": 112, - "loc": { - "start": { - "line": 4, - "column": 53 - }, - "end": { - "line": 4, - "column": 57 - } - }, + "start":108,"end":112,"loc":{"start":{"line":4,"column":53},"end":{"line":4,"column":57}}, "method": false, "key": { "type": "Identifier", - "start": 108, - "end": 109, - "loc": { - "start": { - "line": 4, - "column": 53 - }, - "end": { - "line": 4, - "column": 54 - }, - "identifierName": "b" - }, + "start":108,"end":109,"loc":{"start":{"line":4,"column":53},"end":{"line":4,"column":54},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 111, - "end": 112, - "loc": { - "start": { - "line": 4, - "column": 56 - }, - "end": { - "line": 4, - "column": 57 - } - }, + "start":111,"end":112,"loc":{"start":{"line":4,"column":56},"end":{"line":4,"column":57}}, "extra": { "rawValue": 1, "raw": "1" @@ -568,52 +196,18 @@ }, { "type": "ObjectProperty", - "start": 114, - "end": 118, - "loc": { - "start": { - "line": 4, - "column": 59 - }, - "end": { - "line": 4, - "column": 63 - } - }, + "start":114,"end":118,"loc":{"start":{"line":4,"column":59},"end":{"line":4,"column":63}}, "method": false, "key": { "type": "Identifier", - "start": 114, - "end": 115, - "loc": { - "start": { - "line": 4, - "column": 59 - }, - "end": { - "line": 4, - "column": 60 - }, - "identifierName": "c" - }, + "start":114,"end":115,"loc":{"start":{"line":4,"column":59},"end":{"line":4,"column":60},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 117, - "end": 118, - "loc": { - "start": { - "line": 4, - "column": 62 - }, - "end": { - "line": 4, - "column": 63 - } - }, + "start":117,"end":118,"loc":{"start":{"line":4,"column":62},"end":{"line":4,"column":63}}, "extra": { "rawValue": 2, "raw": "2" @@ -627,64 +221,19 @@ }, "body": { "type": "BlockStatement", - "start": 121, - "end": 144, - "loc": { - "start": { - "line": 4, - "column": 66 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":121,"end":144,"loc":{"start":{"line":4,"column":66},"end":{"line":6,"column":3}}, "body": [ { "type": "ExpressionStatement", - "start": 127, - "end": 140, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 17 - } - }, + "start":127,"end":140,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":17}}, "expression": { "type": "UpdateExpression", - "start": 127, - "end": 139, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 16 - } - }, + "start":127,"end":139,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":16}}, "operator": "++", "prefix": true, "argument": { "type": "Identifier", - "start": 129, - "end": 139, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 16 - }, - "identifierName": "iterations" - }, + "start":129,"end":139,"loc":{"start":{"line":5,"column":6},"end":{"line":5,"column":16},"identifierName":"iterations"}, "name": "iterations" } } 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 556eea4465..26b3ee9559 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 @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ "SyntaxError: for-in loop variable declaration may not have an initializer (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 14, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":14,"end":36,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, "left": { "type": "VariableDeclaration", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":19,"end":28,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":23,"end":28,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "a" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"a"}, "name": "a" }, "init": { "type": "NumericLiteral", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14}}, "extra": { "rawValue": 0, "raw": "0" @@ -118,66 +40,22 @@ }, "right": { "type": "ObjectExpression", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":32,"end":34,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}}, "properties": [] }, "body": { "type": "EmptyStatement", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - } - } + "start":35,"end":36,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22}} } } ], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/output.json index fbffb7c699..32755b31ea 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-in/var-arraybindingpattern-initializer/output.json @@ -1,128 +1,39 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, "id": { "type": "ArrayPattern", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "elements": [ { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" } ] }, "init": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 0, "raw": "0" @@ -135,34 +46,12 @@ }, "right": { "type": "ObjectExpression", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "properties": [] }, "body": { "type": "EmptyStatement", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} } } ], 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 0afdc7b4d2..9bde6c44ee 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 @@ -1,144 +1,43 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, "id": { "type": "ObjectPattern", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "extra": { @@ -149,18 +48,7 @@ }, "init": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 0, "raw": "0" @@ -173,34 +61,12 @@ }, "right": { "type": "ObjectExpression", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "properties": [] }, "body": { "type": "EmptyStatement", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json b/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json index 936a7b0183..40500649a6 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-of/bare-initializer/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "errors": [ "SyntaxError: Invalid left-hand side in for-loop (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": null @@ -85,64 +29,19 @@ }, { "type": "ForOfStatement", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":7,"end":25,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "await": false, "left": { "type": "AssignmentPattern", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":12,"end":17,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":10}}, "left": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "a" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"a"}, "name": "a" }, "right": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "extra": { "rawValue": 0, "raw": "0" @@ -152,34 +51,12 @@ }, "right": { "type": "ObjectExpression", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":21,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "properties": [] }, "body": { "type": "EmptyStatement", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - } - } + "start":24,"end":25,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18}} } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/for-of/brackets-const/output.json b/packages/babel-parser/test/fixtures/es2015/for-of/brackets-const/output.json index e6724bdbc9..5a6b9c5fb0 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-of/brackets-const/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-of/brackets-const/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "await": false, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":5,"end":14,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "id": { "type": "ObjectPattern", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "properties": [ { "type": "ObjectProperty", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "method": false, "key": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "a" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "a" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"a"}, "name": "a" }, "extra": { @@ -152,18 +51,7 @@ }, "right": { "type": "RegExpLiteral", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "extra": { "raw": "/b/" }, @@ -172,18 +60,7 @@ }, "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/for-of/brackets-let/output.json b/packages/babel-parser/test/fixtures/es2015/for-of/brackets-let/output.json index 6c74fa327a..553575d2fb 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-of/brackets-let/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-of/brackets-let/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "await": false, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "id": { "type": "ObjectPattern", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "extra": { @@ -152,18 +51,7 @@ }, "right": { "type": "RegExpLiteral", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}}, "extra": { "raw": "/b/" }, @@ -172,18 +60,7 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/for-of/brackets-var/output.json b/packages/babel-parser/test/fixtures/es2015/for-of/brackets-var/output.json index 507f3b6495..eff35b3046 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-of/brackets-var/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-of/brackets-var/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "await": false, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "id": { "type": "ObjectPattern", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "extra": { @@ -152,18 +51,7 @@ }, "right": { "type": "RegExpLiteral", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}}, "extra": { "raw": "/b/" }, @@ -172,18 +60,7 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/for-of/right-regex/output.json b/packages/babel-parser/test/fixtures/es2015/for-of/right-regex/output.json index e3f8d57824..c03c0eeb2c 100644 --- a/packages/babel-parser/test/fixtures/es2015/for-of/right-regex/output.json +++ b/packages/babel-parser/test/fixtures/es2015/for-of/right-regex/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 26 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 26 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "await": false, "left": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "init": null @@ -97,18 +30,7 @@ }, "right": { "type": "RegExpLiteral", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}}, "extra": { "raw": "/foo/g" }, @@ -117,160 +39,46 @@ }, "body": { "type": "EmptyStatement", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}} } }, { "type": "ForStatement", - "start": 24, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 26 - } - }, + "start":24,"end":50,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":26}}, "init": { "type": "VariableDeclaration", - "start": 29, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":29,"end":46,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 33, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":33,"end":46,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":22}}, "id": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "x" - }, + "start":33,"end":34,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"x"}, "name": "x" }, "init": { "type": "BinaryExpression", - "start": 37, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":37,"end":46,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":22}}, "left": { "type": "BinaryExpression", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":37,"end":44,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":20}}, "left": { "type": "Identifier", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "of" - }, + "start":37,"end":39,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15},"identifierName":"of"}, "name": "of" }, "operator": "/", "right": { "type": "Identifier", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 20 - }, - "identifierName": "foo" - }, + "start":41,"end":44,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":20},"identifierName":"foo"}, "name": "foo" } }, "operator": "/", "right": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 22 - }, - "identifierName": "g" - }, + "start":45,"end":46,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":22},"identifierName":"g"}, "name": "g" } } @@ -282,18 +90,7 @@ "update": null, "body": { "type": "EmptyStatement", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 25 - }, - "end": { - "line": 3, - "column": 26 - } - } + "start":49,"end":50,"loc":{"start":{"line":3,"column":25},"end":{"line":3,"column":26}} } } ], 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 6d1a2d6c3f..f6604179ce 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 @@ -1,113 +1,35 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:16)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":1,"end":29,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":29}}, "id": null, "generator": true, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":16,"end":27,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":27}}, "expression": { "type": "Identifier", - "start": 16, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "yield" - }, + "start":16,"end":26,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":26},"identifierName":"yield"}, "name": "yield" } } diff --git a/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/output.json b/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/output.json index 0059c885f4..27beba5b2e 100644 --- a/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/output.json +++ b/packages/babel-parser/test/fixtures/es2015/generators/invalid-hanging/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ "SyntaxError: Generators can only be declared at the top level or inside a block (1:16)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "test": { "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" @@ -68,33 +24,10 @@ }, "consequent": { "type": "FunctionDeclaration", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -102,18 +35,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/output.json index f5d632c23a..425fd47bc0 100644 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/output.json +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-const/output.json @@ -1,17 +1,6 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":17}}, "errors": [ "SyntaxError: Unexpected keyword 'const' (1:4)", "SyntaxError: Escape sequence in keyword const (1:4)", @@ -19,81 +8,25 @@ ], "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":17}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "const" - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14},"identifierName":"const"}, "name": "const" }, "init": { "type": "NumericLiteral", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "extra": { "rawValue": 123, "raw": "123" @@ -106,64 +39,19 @@ }, { "type": "VariableDeclaration", - "start": 23, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":23,"end":40,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":17}}, "declarations": [ { "type": "VariableDeclarator", - "start": 34, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":34,"end":39,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":16}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 12 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":12},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":38,"end":39,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":16}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/output.json index 236b7dc15a..9aa7fd43bb 100644 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/output.json +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-export/output.json @@ -1,17 +1,6 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":18}}, "errors": [ "SyntaxError: Unexpected keyword 'export' (1:4)", "SyntaxError: Escape sequence in keyword export (1:4)", @@ -19,81 +8,25 @@ ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":4,"end":21,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 4, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "export" - }, + "start":4,"end":15,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":15},"identifierName":"export"}, "name": "export" }, "init": { "type": "NumericLiteral", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "extra": { "rawValue": 123, "raw": "123" @@ -106,48 +39,14 @@ }, { "type": "VariableDeclaration", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":24,"end":30,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":6}}, "declarations": [ { "type": "VariableDeclarator", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":28,"end":29,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5}}, "id": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "x" - }, + "start":28,"end":29,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"x"}, "name": "x" }, "init": null @@ -157,65 +56,19 @@ }, { "type": "ExportNamedDeclaration", - "start": 31, - "end": 49, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":31,"end":49,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":18}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":45,"end":46,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":15}}, "local": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 15 - }, - "identifierName": "x" - }, + "start":45,"end":46,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":15},"identifierName":"x"}, "name": "x" }, "exported": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 15 - }, - "identifierName": "x" - }, + "start":45,"end":46,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":15},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/output.json index d95df678e8..a9fc063b1b 100644 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/output.json +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-if/output.json @@ -1,81 +1,26 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: Escape sequence in keyword if (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "test": { "type": "BooleanLiteral", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}}, "value": true }, "consequent": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/output.json index 8842ac412c..0533a2a4de 100644 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/output.json +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-import/output.json @@ -1,17 +1,6 @@ { "type": "File", - "start": 0, - "end": 90, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":0,"end":90,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":41}}, "errors": [ "SyntaxError: Unexpected keyword 'import' (1:4)", "SyntaxError: Escape sequence in keyword import (1:4)", @@ -19,81 +8,25 @@ ], "program": { "type": "Program", - "start": 0, - "end": 90, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":0,"end":90,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":41}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":4,"end":46,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":46}}, "id": { "type": "Identifier", - "start": 4, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "import" - }, + "start":4,"end":40,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":40},"identifierName":"import"}, "name": "import" }, "init": { "type": "NumericLiteral", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":43,"end":46,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":46}}, "extra": { "rawValue": 123, "raw": "123" @@ -106,33 +39,11 @@ }, { "type": "ImportDeclaration", - "start": 49, - "end": 90, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":49,"end":90,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":41}}, "specifiers": [], "source": { "type": "StringLiteral", - "start": 86, - "end": 89, - "loc": { - "start": { - "line": 3, - "column": 37 - }, - "end": { - "line": 3, - "column": 40 - } - }, + "start":86,"end":89,"loc":{"start":{"line":3,"column":37},"end":{"line":3,"column":40}}, "extra": { "rawValue": "x", "raw": "\"x\"" diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/output.json index 17c1ae0346..1205de6403 100644 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/output.json +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-null/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Escape sequence in keyword null (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NullLiteral", - "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}} } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/output.json b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/output.json index 609a782c23..13d4895854 100644 --- a/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/output.json +++ b/packages/babel-parser/test/fixtures/es2015/identifiers/invalid-escape-seq-true/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Escape sequence in keyword true (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BooleanLiteral", - "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}}, "value": true } } diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-1/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-1/output.json index d5896aa4d5..58f5ce51ab 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-1/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-1/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "let" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"let"}, "name": "let" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-2/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-2/output.json index dc261c3dcb..4b446a0ba9 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-2/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "let" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"let"}, "name": "let" }, "init": { "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" diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-3/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-3/output.json index b0f5399086..ac17d05359 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-3/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-3/output.json @@ -1,95 +1,27 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "left": { "type": "Identifier", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "let" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"let"}, "name": "let" }, "operator": "instanceof", "right": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "Foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"Foo"}, "name": "Foo" } } diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-4/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-4/output.json index 96851ba7aa..7b98d28e08 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-4/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-4/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "let" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"let"}, "name": "let" }, "operator": "in", "right": { "type": "ObjectExpression", - "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}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-5/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-5/output.json index ade78031a6..aa5c55bce7 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-5/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-5/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "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}}, "test": { "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" @@ -65,33 +21,10 @@ }, "consequent": { "type": "ExpressionStatement", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "expression": { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "let" - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"let"}, "name": "let" } }, @@ -99,18 +32,7 @@ }, { "type": "BlockStatement", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":11,"end":13,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-6/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-6/output.json index c51c3538f1..c1d3f4cf73 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-6/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-6/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":3}}, "program": { "type": "Program", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":3}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "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}}, "test": { "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": 0, "raw": "0" @@ -65,66 +21,20 @@ }, "body": { "type": "ExpressionStatement", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "expression": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "let" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"let"}, "name": "let" } } }, { "type": "ExpressionStatement", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "expression": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3},"identifierName":"foo"}, "name": "foo" } } diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-7/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-7/output.json index 721e29212e..bd3f171f61 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-7/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-as-identifier-7/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "test": { "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": 0, "raw": "0" @@ -65,65 +21,19 @@ }, "body": { "type": "ExpressionStatement", - "start": 10, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":10,"end":28,"loc":{"start":{"line":1,"column":10},"end":{"line":2,"column":14}}, "expression": { "type": "BinaryExpression", - "start": 10, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":10,"end":28,"loc":{"start":{"line":1,"column":10},"end":{"line":2,"column":14}}, "left": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "let" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"let"}, "name": "let" }, "operator": "instanceof", "right": { "type": "Identifier", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "Foo" - }, + "start":25,"end":28,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"Foo"}, "name": "Foo" } } 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 85fa32674b..c45edc3f95 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 @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "errors": [ "SyntaxError: Unexpected reserved word 'let' (2:0)" ], "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":14,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":7}}, "expression": { "type": "BinaryExpression", - "start": 14, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":14,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":7}}, "left": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "let" - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3},"identifierName":"let"}, "name": "let" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -104,32 +37,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/output.json index e6e2ced3bb..12a2c9548c 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-1/output.json @@ -1,130 +1,40 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": { "type": "ObjectPattern", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "let" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"let"}, "name": "let" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "let" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"let"}, "name": "let" }, "extra": { @@ -135,18 +45,7 @@ }, "init": { "type": "ObjectExpression", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/output.json index 2c3d3871ec..978664b057 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-2/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:8)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, "id": { "type": "ObjectPattern", - "start": 6, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "let" - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"let"}, "name": "let" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "let" - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"let"}, "name": "let" }, "extra": { @@ -135,18 +45,7 @@ }, "init": { "type": "ObjectExpression", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/output.json index 4354932c61..5b853db406 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-3/output.json @@ -1,114 +1,36 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "Identifier", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "let" - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"let"}, "name": "let" } ] }, "init": { "type": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/output.json index 720c37df7a..908c57bb93 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-4/output.json @@ -1,114 +1,36 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":6,"end":16,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":16}}, "id": { "type": "ArrayPattern", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "elements": [ { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "let" - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"let"}, "name": "let" } ] }, "init": { "type": "ArrayExpression", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/output.json index 93d70aa80f..b2f6cfd135 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-5/output.json @@ -1,81 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "let" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"let"}, "name": "let" }, "init": null diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/output.json index 77846750f6..1cd48f97ea 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-binding-list-fail-6/output.json @@ -1,97 +1,30 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "let" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"let"}, "name": "let" }, "init": { "type": "StringLiteral", - "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": "", "raw": "''" diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/output.json index ecd45f67f5..22e958dfc7 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-at-catch-block/output.json @@ -1,158 +1,46 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: 'let' is not allowed to be used as a name in 'let' or 'const' declarations. (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "block": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 7, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":7,"end":33,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, "param": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "err" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"err"}, "name": "err" }, "body": { "type": "BlockStatement", - "start": 19, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":19,"end":33,"loc":{"start":{"line":1,"column":19},"end":{"line":3,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 23, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":23,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":27,"end":30,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "let" - }, + "start":27,"end":30,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"let"}, "name": "let" }, "init": null diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-block-with-newline/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-block-with-newline/output.json index c2a68fccc8..d397149210 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-block-with-newline/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-block-with-newline/output.json @@ -1,193 +1,59 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "test": { "type": "BooleanLiteral", - "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}}, "value": false }, "consequent": { "type": "BlockStatement", - "start": 11, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":11,"end":39,"loc":{"start":{"line":1,"column":11},"end":{"line":4,"column":1}}, "body": [ { "type": "LabeledStatement", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":17,"end":23,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":10}}, "body": { "type": "ExpressionStatement", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":10}}, "expression": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "let" - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":10},"identifierName":"let"}, "name": "let" } }, "label": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "L" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"L"}, "name": "L" }, "trailingComments": [ { "type": "CommentLine", "value": " ASI", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 17 - } - } + "start":24,"end":30,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":17}} } ] }, { "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":35,"end":37,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":6}}, "body": [], "directives": [], "leadingComments": [ { "type": "CommentLine", "value": " ASI", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 17 - } - } + "start":24,"end":30,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":17}} } ] } @@ -203,18 +69,7 @@ { "type": "CommentLine", "value": " ASI", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 17 - } - } + "start":24,"end":30,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":17}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-arr-dstrk/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-arr-dstrk/output.json index f219584663..e6e46b3904 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-arr-dstrk/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-arr-dstrk/output.json @@ -1,126 +1,37 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":8,"end":17,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":13}}, "id": { "type": "ArrayPattern", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":8,"end":11,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}}, "elements": [ { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"a"}, "name": "a" } ] }, "init": { "type": "ArrayExpression", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13}}, "elements": [ { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-obj-dstrk/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-obj-dstrk/output.json index 3b6eb431c2..7b0cbae541 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-obj-dstrk/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak-obj-dstrk/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":8,"end":24,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":20}}, "id": { "type": "ObjectPattern", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":8,"end":13,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9}}, "properties": [ { "type": "ObjectProperty", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":10,"end":11,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"a"}, "name": "a" }, "extra": { @@ -132,67 +42,22 @@ }, "init": { "type": "ObjectExpression", - "start": 16, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":16,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":18,"end":22,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "a" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak/output.json b/packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak/output.json index 53f9ebb810..32383a0760 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/let-with-linebreak/output.json @@ -1,78 +1,22 @@ { "type": "File", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":8,"end":9,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}}, "id": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"}, "name": "a" }, "init": null diff --git a/packages/babel-parser/test/fixtures/es2015/let/try-catch-let/output.json b/packages/babel-parser/test/fixtures/es2015/let/try-catch-let/output.json index 3d714b032e..88d6a935b3 100644 --- a/packages/babel-parser/test/fixtures/es2015/let/try-catch-let/output.json +++ b/packages/babel-parser/test/fixtures/es2015/let/try-catch-let/output.json @@ -1,110 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "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}}, "block": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "param": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "let" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"let"}, "name": "let" }, "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/expression/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/expression/output.json index f5f3e41b51..07be4bef8b 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/expression/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/expression/output.json @@ -1,173 +1,49 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":6,"end":38,"loc":{"start":{"line":1,"column":6},"end":{"line":3,"column":1}}, "id": { "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" }, "init": { "type": "FunctionExpression", - "start": 10, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":38,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":21,"end":38,"loc":{"start":{"line":1,"column":21},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 25, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":25,"end":36,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "expression": { "type": "MetaProperty", - "start": 25, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":25,"end":35,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "meta": { "type": "Identifier", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "new" - }, + "start":25,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "target" - }, + "start":29,"end":35,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":12},"identifierName":"target"}, "name": "target" } } diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json index 64d4a8d357..eee1bada98 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/invalid-arrow-function/output.json @@ -1,176 +1,52 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: new.target can only be used in functions (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":6,"end":33,"loc":{"start":{"line":1,"column":6},"end":{"line":3,"column":1}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":33,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":33,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":20,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "expression": { "type": "MetaProperty", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":20,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "meta": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "new" - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "target" - }, + "start":24,"end":30,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":12},"identifierName":"target"}, "name": "target" } } diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/nested-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/nested-arrow-function/output.json index 447bc2741c..55524234b1 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/nested-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/nested-arrow-function/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "A" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"A"}, "name": "A" }, "generator": false, @@ -65,97 +20,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":13,"end":40,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":40}}, "body": [ { "type": "ReturnStatement", - "start": 15, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":15,"end":38,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":38}}, "argument": { "type": "ArrowFunctionExpression", - "start": 22, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":22,"end":38,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":38}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "MetaProperty", - "start": 28, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":28,"end":38,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":38}}, "meta": { "type": "Identifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "new" - }, + "start":28,"end":31,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":31},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "target" - }, + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38},"identifierName":"target"}, "name": "target" } } diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/output.json index 214b3e5417..525e9f0ba0 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-invalid-prop/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: The only valid meta property for new is new.target (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -68,79 +23,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":13,"end":27,"loc":{"start":{"line":1,"column":13},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 17, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":17,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10}}, "expression": { "type": "MetaProperty", - "start": 17, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":17,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10}}, "meta": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "new" - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 21, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "prop" - }, + "start":21,"end":25,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":10},"identifierName":"prop"}, "name": "prop" } } diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-inside-params/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-inside-params/output.json index 7fc8d24d38..bff0e74c85 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-inside-params/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-inside-params/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 41 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":41}}, "program": { "type": "Program", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 41 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":41}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "Foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"Foo"}, "name": "Foo" }, "generator": false, @@ -65,81 +20,23 @@ "params": [ { "type": "AssignmentPattern", - "start": 13, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":13,"end":27,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":27}}, "left": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"x"}, "name": "x" }, "right": { "type": "MetaProperty", - "start": 17, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":17,"end":27,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":27}}, "meta": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "new" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "target" - }, + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27},"identifierName":"target"}, "name": "target" } } @@ -147,51 +44,17 @@ ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } }, { "type": "FunctionDeclaration", - "start": 32, - "end": 73, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 41 - } - }, + "start":32,"end":73,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":41}}, "id": { "type": "Identifier", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "Bar" - }, + "start":41,"end":44,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"Bar"}, "name": "Bar" }, "generator": false, @@ -199,128 +62,37 @@ "params": [], "body": { "type": "BlockStatement", - "start": 47, - "end": 73, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 41 - } - }, + "start":47,"end":73,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":41}}, "body": [ { "type": "ExpressionStatement", - "start": 49, - "end": 71, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 39 - } - }, + "start":49,"end":71,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":39}}, "expression": { "type": "ArrowFunctionExpression", - "start": 49, - "end": 71, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 39 - } - }, + "start":49,"end":71,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":39}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 50, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":50,"end":64,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":32}}, "left": { "type": "Identifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "x" - }, + "start":50,"end":51,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19},"identifierName":"x"}, "name": "x" }, "right": { "type": "MetaProperty", - "start": 54, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":54,"end":64,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":32}}, "meta": { "type": "Identifier", - "start": 54, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "new" - }, + "start":54,"end":57,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 58, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 32 - }, - "identifierName": "target" - }, + "start":58,"end":64,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":32},"identifierName":"target"}, "name": "target" } } @@ -328,18 +100,7 @@ ], "body": { "type": "BlockStatement", - "start": 69, - "end": 71, - "loc": { - "start": { - "line": 2, - "column": 37 - }, - "end": { - "line": 2, - "column": 39 - } - }, + "start":69,"end":71,"loc":{"start":{"line":2,"column":37},"end":{"line":2,"column":39}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/output.json index 1394b19bdb..95fcf34a01 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-new/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ "SyntaxError: Escape sequence in keyword new (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -68,79 +23,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":13,"end":33,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":33}}, "body": [ { "type": "ExpressionStatement", - "start": 15, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":15,"end":31,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":31}}, "expression": { "type": "MetaProperty", - "start": 15, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":15,"end":30,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":30}}, "meta": { "type": "Identifier", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "new" - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "target" - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30},"identifierName":"target"}, "name": "target" } } diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/output.json index 2fa8e1dd55..6524f1e405 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid-escaped-target/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ "SyntaxError: The only valid meta property for new is new.target (1:19)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -68,79 +23,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":13,"end":33,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":33}}, "body": [ { "type": "ExpressionStatement", - "start": 15, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":15,"end":31,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":31}}, "expression": { "type": "MetaProperty", - "start": 15, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":15,"end":30,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":30}}, "meta": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "new" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 19, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "target" - }, + "start":19,"end":30,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":30},"identifierName":"target"}, "name": "target" } } diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json index 4283f53e7d..eac0709d91 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target-invalid/output.json @@ -1,97 +1,29 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: new.target can only be used in functions (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "MetaProperty", - "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}}, "meta": { "type": "Identifier", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "new" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "target" - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10},"identifierName":"target"}, "name": "target" } } diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target/output.json index 84732b39da..6e00a6fc7d 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/new-target/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,79 +20,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":15,"end":29,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":29}}, "body": [ { "type": "ExpressionStatement", - "start": 17, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":17,"end":27,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":27}}, "expression": { "type": "MetaProperty", - "start": 17, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":17,"end":27,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":27}}, "meta": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "new" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "target" - }, + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27},"identifierName":"target"}, "name": "target" } } diff --git a/packages/babel-parser/test/fixtures/es2015/meta-properties/statement/output.json b/packages/babel-parser/test/fixtures/es2015/meta-properties/statement/output.json index 80af5ec9a8..3cee11c8d0 100644 --- a/packages/babel-parser/test/fixtures/es2015/meta-properties/statement/output.json +++ b/packages/babel-parser/test/fixtures/es2015/meta-properties/statement/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "A" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"A"}, "name": "A" }, "generator": false, @@ -65,79 +20,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":13,"end":30,"loc":{"start":{"line":1,"column":13},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 17, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":17,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "expression": { "type": "MetaProperty", - "start": 17, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":17,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "meta": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "new" - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "target" - }, + "start":21,"end":27,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":12},"identifierName":"target"}, "name": "target" } } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/output.json index 019d83e37a..c2f48e1131 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default-and-export-as-default/output.json @@ -1,84 +1,29 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":26}}, "errors": [ "SyntaxError: Only one default export allowed per module. (2:9)", "SyntaxError: Export 'foo' is not defined (2:9)" ], "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "declaration": { "type": "FunctionDeclaration", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "body": [], "directives": [] } @@ -86,80 +31,23 @@ }, { "type": "EmptyStatement", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - } + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29}} }, { "type": "ExportNamedDeclaration", - "start": 30, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":30,"end":56,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":26}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 39, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":39,"end":53,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":23}}, "local": { "type": "Identifier", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "foo" - }, + "start":39,"end":42,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"foo"}, "name": "foo" }, "exported": { "type": "Identifier", - "start": 46, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "default" - }, + "start":46,"end":53,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":23},"identifierName":"default"}, "name": "default" } } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/output.json index d8e83bc56d..59fd6339b3 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-export-default/output.json @@ -1,114 +1,37 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":29}}, "errors": [ "SyntaxError: Only one default export allowed per module. (2:0)" ], "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":29}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "declaration": { "type": "ObjectExpression", - "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}}, "properties": [] } }, { "type": "ExportDefaultDeclaration", - "start": 19, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":19,"end":47,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, "declaration": { "type": "FunctionDeclaration", - "start": 34, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":34,"end":47,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":28}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 45, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":45,"end":47,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":28}}, "body": [], "directives": [] } @@ -116,18 +39,7 @@ }, { "type": "EmptyStatement", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 29 - } - } + "start":47,"end":48,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":29}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-builtin/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-builtin/output.json index 7d37c8dcb6..2b03656372 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-builtin/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-builtin/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":20}}, "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":20}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "toString" - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14},"identifierName":"toString"}, "name": "toString" }, "init": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 1, "raw": "1" @@ -101,65 +34,19 @@ }, { "type": "ExportNamedDeclaration", - "start": 21, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":21,"end":41,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":20}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 30, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":30,"end":38,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":17}}, "local": { "type": "Identifier", - "start": 30, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "toString" - }, + "start":30,"end":38,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":17},"identifierName":"toString"}, "name": "toString" }, "exported": { "type": "Identifier", - "start": 30, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "toString" - }, + "start":30,"end":38,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":17},"identifierName":"toString"}, "name": "toString" } } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/output.json index cf1a59d266..2c706885c5 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-class-declaration/output.json @@ -1,98 +1,30 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "errors": [ "SyntaxError: `Foo` has already been exported. Exported identifiers must be unique. (2:0)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "local": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "Foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"Foo"}, "name": "Foo" }, "exported": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "Foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"Foo"}, "name": "Foo" } } @@ -102,84 +34,28 @@ }, { "type": "ExportNamedDeclaration", - "start": 16, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":16,"end":35,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "specifiers": [], "source": null, "declaration": { "type": "ClassDeclaration", - "start": 23, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":23,"end":35,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":19}}, "id": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "Foo" - }, + "start":29,"end":32,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":33,"end":35,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":19}}, "body": [] } } }, { "type": "EmptyStatement", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - } - } + "start":35,"end":36,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/output.json index ae3e358fbe..254af5e596 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring-assignment/output.json @@ -1,98 +1,30 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":31}}, "errors": [ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:15)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "local": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "exported": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" } } @@ -102,143 +34,42 @@ }, { "type": "ExportNamedDeclaration", - "start": 16, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":16,"end":47,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 23, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":23,"end":47,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":31}}, "declarations": [ { "type": "VariableDeclarator", - "start": 29, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":29,"end":46,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":30}}, "id": { "type": "ObjectPattern", - "start": 29, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":29,"end":40,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":24}}, "properties": [ { "type": "ObjectProperty", - "start": 31, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":31,"end":38,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":22}}, "method": false, "key": { "type": "Identifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "foo" - }, + "start":31,"end":34,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 31, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":31,"end":38,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":22}}, "left": { "type": "Identifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "foo" - }, + "start":31,"end":34,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "NumericLiteral", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":37,"end":38,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22}}, "extra": { "rawValue": 1, "raw": "1" @@ -254,19 +85,7 @@ }, "init": { "type": "Identifier", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 30 - }, - "identifierName": "bar" - }, + "start":43,"end":46,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":30},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring/output.json index 87964bf525..bf1259afc4 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 522, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 12, - "column": 40 - } - }, + "start":0,"end":522,"loc":{"start":{"line":1,"column":0},"end":{"line":12,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 522, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 12, - "column": 40 - } - }, + "start":0,"end":522,"loc":{"start":{"line":1,"column":0},"end":{"line":12,"column":40}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":7,"end":27,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "id": { "type": "ObjectPattern", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" }, "extra": { @@ -148,19 +47,7 @@ }, "init": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "bar" - }, + "start":23,"end":26,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":26},"identifierName":"bar"}, "name": "bar" } } @@ -170,113 +57,34 @@ }, { "type": "ExportNamedDeclaration", - "start": 28, - "end": 61, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":28,"end":61,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":33}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 35, - "end": 61, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":35,"end":61,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":33}}, "declarations": [ { "type": "VariableDeclarator", - "start": 41, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":41,"end":60,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":32}}, "id": { "type": "ObjectPattern", - "start": 41, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":41,"end":54,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":26}}, "properties": [ { "type": "ObjectProperty", - "start": 43, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":43,"end":52,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":24}}, "method": false, "key": { "type": "Identifier", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "foo" - }, + "start":43,"end":46,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 48, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "foo2" - }, + "start":48,"end":52,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":24},"identifierName":"foo2"}, "name": "foo2" } } @@ -284,19 +92,7 @@ }, "init": { "type": "Identifier", - "start": 57, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 32 - }, - "identifierName": "bar" - }, + "start":57,"end":60,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":32},"identifierName":"bar"}, "name": "bar" } } @@ -306,162 +102,49 @@ }, { "type": "ExportNamedDeclaration", - "start": 62, - "end": 98, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":62,"end":98,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":36}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 69, - "end": 98, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":69,"end":98,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":36}}, "declarations": [ { "type": "VariableDeclarator", - "start": 75, - "end": 97, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":75,"end":97,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":35}}, "id": { "type": "ObjectPattern", - "start": 75, - "end": 91, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":75,"end":91,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":29}}, "properties": [ { "type": "ObjectProperty", - "start": 77, - "end": 89, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":77,"end":89,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":27}}, "method": false, "key": { "type": "Identifier", - "start": 77, - "end": 80, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 18 - }, - "identifierName": "foo" - }, + "start":77,"end":80,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 82, - "end": 89, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":82,"end":89,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":27}}, "properties": [ { "type": "ObjectProperty", - "start": 84, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":84,"end":87,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":25}}, "method": false, "key": { "type": "Identifier", - "start": 84, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 25 - }, - "identifierName": "baz" - }, + "start":84,"end":87,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":25},"identifierName":"baz"}, "name": "baz" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 84, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 25 - }, - "identifierName": "baz" - }, + "start":84,"end":87,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":25},"identifierName":"baz"}, "name": "baz" }, "extra": { @@ -475,19 +158,7 @@ }, "init": { "type": "Identifier", - "start": 94, - "end": 97, - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 35 - }, - "identifierName": "bar" - }, + "start":94,"end":97,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":35},"identifierName":"bar"}, "name": "bar" } } @@ -497,211 +168,64 @@ }, { "type": "ExportNamedDeclaration", - "start": 99, - "end": 145, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 46 - } - }, + "start":99,"end":145,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":46}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 106, - "end": 145, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 46 - } - }, + "start":106,"end":145,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":46}}, "declarations": [ { "type": "VariableDeclarator", - "start": 112, - "end": 144, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 45 - } - }, + "start":112,"end":144,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":45}}, "id": { "type": "ObjectPattern", - "start": 112, - "end": 138, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 39 - } - }, + "start":112,"end":138,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":39}}, "properties": [ { "type": "ObjectProperty", - "start": 114, - "end": 136, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 37 - } - }, + "start":114,"end":136,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":37}}, "method": false, "key": { "type": "Identifier", - "start": 114, - "end": 117, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 18 - }, - "identifierName": "foo" - }, + "start":114,"end":117,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 119, - "end": 136, - "loc": { - "start": { - "line": 4, - "column": 20 - }, - "end": { - "line": 4, - "column": 37 - } - }, + "start":119,"end":136,"loc":{"start":{"line":4,"column":20},"end":{"line":4,"column":37}}, "properties": [ { "type": "ObjectProperty", - "start": 121, - "end": 134, - "loc": { - "start": { - "line": 4, - "column": 22 - }, - "end": { - "line": 4, - "column": 35 - } - }, + "start":121,"end":134,"loc":{"start":{"line":4,"column":22},"end":{"line":4,"column":35}}, "method": false, "key": { "type": "Identifier", - "start": 121, - "end": 124, - "loc": { - "start": { - "line": 4, - "column": 22 - }, - "end": { - "line": 4, - "column": 25 - }, - "identifierName": "baz" - }, + "start":121,"end":124,"loc":{"start":{"line":4,"column":22},"end":{"line":4,"column":25},"identifierName":"baz"}, "name": "baz" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 127, - "end": 134, - "loc": { - "start": { - "line": 4, - "column": 28 - }, - "end": { - "line": 4, - "column": 35 - } - }, + "start":127,"end":134,"loc":{"start":{"line":4,"column":28},"end":{"line":4,"column":35}}, "properties": [ { "type": "ObjectProperty", - "start": 129, - "end": 132, - "loc": { - "start": { - "line": 4, - "column": 30 - }, - "end": { - "line": 4, - "column": 33 - } - }, + "start":129,"end":132,"loc":{"start":{"line":4,"column":30},"end":{"line":4,"column":33}}, "method": false, "key": { "type": "Identifier", - "start": 129, - "end": 132, - "loc": { - "start": { - "line": 4, - "column": 30 - }, - "end": { - "line": 4, - "column": 33 - }, - "identifierName": "qux" - }, + "start":129,"end":132,"loc":{"start":{"line":4,"column":30},"end":{"line":4,"column":33},"identifierName":"qux"}, "name": "qux" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 129, - "end": 132, - "loc": { - "start": { - "line": 4, - "column": 30 - }, - "end": { - "line": 4, - "column": 33 - }, - "identifierName": "qux" - }, + "start":129,"end":132,"loc":{"start":{"line":4,"column":30},"end":{"line":4,"column":33},"identifierName":"qux"}, "name": "qux" }, "extra": { @@ -718,19 +242,7 @@ }, "init": { "type": "Identifier", - "start": 141, - "end": 144, - "loc": { - "start": { - "line": 4, - "column": 42 - }, - "end": { - "line": 4, - "column": 45 - }, - "identifierName": "bar" - }, + "start":141,"end":144,"loc":{"start":{"line":4,"column":42},"end":{"line":4,"column":45},"identifierName":"bar"}, "name": "bar" } } @@ -740,211 +252,64 @@ }, { "type": "ExportNamedDeclaration", - "start": 146, - "end": 199, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 53 - } - }, + "start":146,"end":199,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":53}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 153, - "end": 199, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 53 - } - }, + "start":153,"end":199,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":53}}, "declarations": [ { "type": "VariableDeclarator", - "start": 159, - "end": 198, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 52 - } - }, + "start":159,"end":198,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":52}}, "id": { "type": "ObjectPattern", - "start": 159, - "end": 192, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 46 - } - }, + "start":159,"end":192,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":46}}, "properties": [ { "type": "ObjectProperty", - "start": 161, - "end": 184, - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 38 - } - }, + "start":161,"end":184,"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":38}}, "method": false, "key": { "type": "Identifier", - "start": 161, - "end": 164, - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 18 - }, - "identifierName": "foo" - }, + "start":161,"end":164,"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 166, - "end": 184, - "loc": { - "start": { - "line": 5, - "column": 20 - }, - "end": { - "line": 5, - "column": 38 - } - }, + "start":166,"end":184,"loc":{"start":{"line":5,"column":20},"end":{"line":5,"column":38}}, "properties": [ { "type": "ObjectProperty", - "start": 168, - "end": 182, - "loc": { - "start": { - "line": 5, - "column": 22 - }, - "end": { - "line": 5, - "column": 36 - } - }, + "start":168,"end":182,"loc":{"start":{"line":5,"column":22},"end":{"line":5,"column":36}}, "method": false, "key": { "type": "Identifier", - "start": 168, - "end": 171, - "loc": { - "start": { - "line": 5, - "column": 22 - }, - "end": { - "line": 5, - "column": 25 - }, - "identifierName": "baz" - }, + "start":168,"end":171,"loc":{"start":{"line":5,"column":22},"end":{"line":5,"column":25},"identifierName":"baz"}, "name": "baz" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 174, - "end": 182, - "loc": { - "start": { - "line": 5, - "column": 28 - }, - "end": { - "line": 5, - "column": 36 - } - }, + "start":174,"end":182,"loc":{"start":{"line":5,"column":28},"end":{"line":5,"column":36}}, "properties": [ { "type": "ObjectProperty", - "start": 176, - "end": 180, - "loc": { - "start": { - "line": 5, - "column": 30 - }, - "end": { - "line": 5, - "column": 34 - } - }, + "start":176,"end":180,"loc":{"start":{"line":5,"column":30},"end":{"line":5,"column":34}}, "method": false, "key": { "type": "Identifier", - "start": 176, - "end": 180, - "loc": { - "start": { - "line": 5, - "column": 30 - }, - "end": { - "line": 5, - "column": 34 - }, - "identifierName": "qux2" - }, + "start":176,"end":180,"loc":{"start":{"line":5,"column":30},"end":{"line":5,"column":34},"identifierName":"qux2"}, "name": "qux2" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 176, - "end": 180, - "loc": { - "start": { - "line": 5, - "column": 30 - }, - "end": { - "line": 5, - "column": 34 - }, - "identifierName": "qux2" - }, + "start":176,"end":180,"loc":{"start":{"line":5,"column":30},"end":{"line":5,"column":34},"identifierName":"qux2"}, "name": "qux2" }, "extra": { @@ -959,53 +324,18 @@ }, { "type": "ObjectProperty", - "start": 186, - "end": 190, - "loc": { - "start": { - "line": 5, - "column": 40 - }, - "end": { - "line": 5, - "column": 44 - } - }, + "start":186,"end":190,"loc":{"start":{"line":5,"column":40},"end":{"line":5,"column":44}}, "method": false, "key": { "type": "Identifier", - "start": 186, - "end": 190, - "loc": { - "start": { - "line": 5, - "column": 40 - }, - "end": { - "line": 5, - "column": 44 - }, - "identifierName": "foo3" - }, + "start":186,"end":190,"loc":{"start":{"line":5,"column":40},"end":{"line":5,"column":44},"identifierName":"foo3"}, "name": "foo3" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 186, - "end": 190, - "loc": { - "start": { - "line": 5, - "column": 40 - }, - "end": { - "line": 5, - "column": 44 - }, - "identifierName": "foo3" - }, + "start":186,"end":190,"loc":{"start":{"line":5,"column":40},"end":{"line":5,"column":44},"identifierName":"foo3"}, "name": "foo3" }, "extra": { @@ -1016,19 +346,7 @@ }, "init": { "type": "Identifier", - "start": 195, - "end": 198, - "loc": { - "start": { - "line": 5, - "column": 49 - }, - "end": { - "line": 5, - "column": 52 - }, - "identifierName": "bar" - }, + "start":195,"end":198,"loc":{"start":{"line":5,"column":49},"end":{"line":5,"column":52},"identifierName":"bar"}, "name": "bar" } } @@ -1038,98 +356,30 @@ }, { "type": "ExportNamedDeclaration", - "start": 200, - "end": 226, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 26 - } - }, + "start":200,"end":226,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":26}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 207, - "end": 226, - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 26 - } - }, + "start":207,"end":226,"loc":{"start":{"line":6,"column":7},"end":{"line":6,"column":26}}, "declarations": [ { "type": "VariableDeclarator", - "start": 213, - "end": 225, - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 6, - "column": 25 - } - }, + "start":213,"end":225,"loc":{"start":{"line":6,"column":13},"end":{"line":6,"column":25}}, "id": { "type": "ArrayPattern", - "start": 213, - "end": 219, - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 6, - "column": 19 - } - }, + "start":213,"end":219,"loc":{"start":{"line":6,"column":13},"end":{"line":6,"column":19}}, "elements": [ { "type": "Identifier", - "start": 214, - "end": 218, - "loc": { - "start": { - "line": 6, - "column": 14 - }, - "end": { - "line": 6, - "column": 18 - }, - "identifierName": "foo4" - }, + "start":214,"end":218,"loc":{"start":{"line":6,"column":14},"end":{"line":6,"column":18},"identifierName":"foo4"}, "name": "foo4" } ] }, "init": { "type": "Identifier", - "start": 222, - "end": 225, - "loc": { - "start": { - "line": 6, - "column": 22 - }, - "end": { - "line": 6, - "column": 25 - }, - "identifierName": "bar" - }, + "start":222,"end":225,"loc":{"start":{"line":6,"column":22},"end":{"line":6,"column":25},"identifierName":"bar"}, "name": "bar" } } @@ -1139,94 +389,27 @@ }, { "type": "ExportNamedDeclaration", - "start": 227, - "end": 255, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 28 - } - }, + "start":227,"end":255,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":28}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 234, - "end": 255, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 28 - } - }, + "start":234,"end":255,"loc":{"start":{"line":7,"column":7},"end":{"line":7,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 240, - "end": 254, - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 27 - } - }, + "start":240,"end":254,"loc":{"start":{"line":7,"column":13},"end":{"line":7,"column":27}}, "id": { "type": "ArrayPattern", - "start": 240, - "end": 248, - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 21 - } - }, + "start":240,"end":248,"loc":{"start":{"line":7,"column":13},"end":{"line":7,"column":21}}, "elements": [ { "type": "ArrayPattern", - "start": 241, - "end": 247, - "loc": { - "start": { - "line": 7, - "column": 14 - }, - "end": { - "line": 7, - "column": 20 - } - }, + "start":241,"end":247,"loc":{"start":{"line":7,"column":14},"end":{"line":7,"column":20}}, "elements": [ { "type": "Identifier", - "start": 242, - "end": 246, - "loc": { - "start": { - "line": 7, - "column": 15 - }, - "end": { - "line": 7, - "column": 19 - }, - "identifierName": "baz2" - }, + "start":242,"end":246,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":19},"identifierName":"baz2"}, "name": "baz2" } ] @@ -1235,19 +418,7 @@ }, "init": { "type": "Identifier", - "start": 251, - "end": 254, - "loc": { - "start": { - "line": 7, - "column": 24 - }, - "end": { - "line": 7, - "column": 27 - }, - "identifierName": "bar" - }, + "start":251,"end":254,"loc":{"start":{"line":7,"column":24},"end":{"line":7,"column":27},"identifierName":"bar"}, "name": "bar" } } @@ -1257,143 +428,42 @@ }, { "type": "ExportNamedDeclaration", - "start": 256, - "end": 311, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 55 - } - }, + "start":256,"end":311,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":55}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 263, - "end": 311, - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 55 - } - }, + "start":263,"end":311,"loc":{"start":{"line":8,"column":7},"end":{"line":8,"column":55}}, "declarations": [ { "type": "VariableDeclarator", - "start": 269, - "end": 310, - "loc": { - "start": { - "line": 8, - "column": 13 - }, - "end": { - "line": 8, - "column": 54 - } - }, + "start":269,"end":310,"loc":{"start":{"line":8,"column":13},"end":{"line":8,"column":54}}, "id": { "type": "ArrayPattern", - "start": 269, - "end": 304, - "loc": { - "start": { - "line": 8, - "column": 13 - }, - "end": { - "line": 8, - "column": 48 - } - }, + "start":269,"end":304,"loc":{"start":{"line":8,"column":13},"end":{"line":8,"column":48}}, "elements": [ { "type": "ObjectPattern", - "start": 270, - "end": 285, - "loc": { - "start": { - "line": 8, - "column": 14 - }, - "end": { - "line": 8, - "column": 29 - } - }, + "start":270,"end":285,"loc":{"start":{"line":8,"column":14},"end":{"line":8,"column":29}}, "properties": [ { "type": "ObjectProperty", - "start": 272, - "end": 283, - "loc": { - "start": { - "line": 8, - "column": 16 - }, - "end": { - "line": 8, - "column": 27 - } - }, + "start":272,"end":283,"loc":{"start":{"line":8,"column":16},"end":{"line":8,"column":27}}, "method": false, "key": { "type": "Identifier", - "start": 272, - "end": 275, - "loc": { - "start": { - "line": 8, - "column": 16 - }, - "end": { - "line": 8, - "column": 19 - }, - "identifierName": "foo" - }, + "start":272,"end":275,"loc":{"start":{"line":8,"column":16},"end":{"line":8,"column":19},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 277, - "end": 283, - "loc": { - "start": { - "line": 8, - "column": 21 - }, - "end": { - "line": 8, - "column": 27 - } - }, + "start":277,"end":283,"loc":{"start":{"line":8,"column":21},"end":{"line":8,"column":27}}, "elements": [ { "type": "Identifier", - "start": 278, - "end": 282, - "loc": { - "start": { - "line": 8, - "column": 22 - }, - "end": { - "line": 8, - "column": 26 - }, - "identifierName": "baz3" - }, + "start":278,"end":282,"loc":{"start":{"line":8,"column":22},"end":{"line":8,"column":26},"identifierName":"baz3"}, "name": "baz3" } ] @@ -1403,83 +473,26 @@ }, { "type": "ObjectPattern", - "start": 287, - "end": 303, - "loc": { - "start": { - "line": 8, - "column": 31 - }, - "end": { - "line": 8, - "column": 47 - } - }, + "start":287,"end":303,"loc":{"start":{"line":8,"column":31},"end":{"line":8,"column":47}}, "properties": [ { "type": "ObjectProperty", - "start": 289, - "end": 301, - "loc": { - "start": { - "line": 8, - "column": 33 - }, - "end": { - "line": 8, - "column": 45 - } - }, + "start":289,"end":301,"loc":{"start":{"line":8,"column":33},"end":{"line":8,"column":45}}, "method": false, "key": { "type": "Identifier", - "start": 289, - "end": 293, - "loc": { - "start": { - "line": 8, - "column": 33 - }, - "end": { - "line": 8, - "column": 37 - }, - "identifierName": "foo2" - }, + "start":289,"end":293,"loc":{"start":{"line":8,"column":33},"end":{"line":8,"column":37},"identifierName":"foo2"}, "name": "foo2" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 295, - "end": 301, - "loc": { - "start": { - "line": 8, - "column": 39 - }, - "end": { - "line": 8, - "column": 45 - } - }, + "start":295,"end":301,"loc":{"start":{"line":8,"column":39},"end":{"line":8,"column":45}}, "elements": [ { "type": "Identifier", - "start": 296, - "end": 300, - "loc": { - "start": { - "line": 8, - "column": 40 - }, - "end": { - "line": 8, - "column": 44 - }, - "identifierName": "baz4" - }, + "start":296,"end":300,"loc":{"start":{"line":8,"column":40},"end":{"line":8,"column":44},"identifierName":"baz4"}, "name": "baz4" } ] @@ -1491,19 +504,7 @@ }, "init": { "type": "Identifier", - "start": 307, - "end": 310, - "loc": { - "start": { - "line": 8, - "column": 51 - }, - "end": { - "line": 8, - "column": 54 - }, - "identifierName": "bar" - }, + "start":307,"end":310,"loc":{"start":{"line":8,"column":51},"end":{"line":8,"column":54},"identifierName":"bar"}, "name": "bar" } } @@ -1513,211 +514,64 @@ }, { "type": "ExportNamedDeclaration", - "start": 312, - "end": 381, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 69 - } - }, + "start":312,"end":381,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":69}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 319, - "end": 381, - "loc": { - "start": { - "line": 9, - "column": 7 - }, - "end": { - "line": 9, - "column": 69 - } - }, + "start":319,"end":381,"loc":{"start":{"line":9,"column":7},"end":{"line":9,"column":69}}, "declarations": [ { "type": "VariableDeclarator", - "start": 325, - "end": 380, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 68 - } - }, + "start":325,"end":380,"loc":{"start":{"line":9,"column":13},"end":{"line":9,"column":68}}, "id": { "type": "ObjectPattern", - "start": 325, - "end": 374, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 62 - } - }, + "start":325,"end":374,"loc":{"start":{"line":9,"column":13},"end":{"line":9,"column":62}}, "properties": [ { "type": "ObjectProperty", - "start": 327, - "end": 349, - "loc": { - "start": { - "line": 9, - "column": 15 - }, - "end": { - "line": 9, - "column": 37 - } - }, + "start":327,"end":349,"loc":{"start":{"line":9,"column":15},"end":{"line":9,"column":37}}, "method": false, "key": { "type": "Identifier", - "start": 327, - "end": 330, - "loc": { - "start": { - "line": 9, - "column": 15 - }, - "end": { - "line": 9, - "column": 18 - }, - "identifierName": "foo" - }, + "start":327,"end":330,"loc":{"start":{"line":9,"column":15},"end":{"line":9,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 332, - "end": 349, - "loc": { - "start": { - "line": 9, - "column": 20 - }, - "end": { - "line": 9, - "column": 37 - } - }, + "start":332,"end":349,"loc":{"start":{"line":9,"column":20},"end":{"line":9,"column":37}}, "properties": [ { "type": "ObjectProperty", - "start": 334, - "end": 347, - "loc": { - "start": { - "line": 9, - "column": 22 - }, - "end": { - "line": 9, - "column": 35 - } - }, + "start":334,"end":347,"loc":{"start":{"line":9,"column":22},"end":{"line":9,"column":35}}, "method": false, "key": { "type": "Identifier", - "start": 334, - "end": 337, - "loc": { - "start": { - "line": 9, - "column": 22 - }, - "end": { - "line": 9, - "column": 25 - }, - "identifierName": "baz" - }, + "start":334,"end":337,"loc":{"start":{"line":9,"column":22},"end":{"line":9,"column":25},"identifierName":"baz"}, "name": "baz" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 339, - "end": 347, - "loc": { - "start": { - "line": 9, - "column": 27 - }, - "end": { - "line": 9, - "column": 35 - } - }, + "start":339,"end":347,"loc":{"start":{"line":9,"column":27},"end":{"line":9,"column":35}}, "properties": [ { "type": "ObjectProperty", - "start": 341, - "end": 345, - "loc": { - "start": { - "line": 9, - "column": 29 - }, - "end": { - "line": 9, - "column": 33 - } - }, + "start":341,"end":345,"loc":{"start":{"line":9,"column":29},"end":{"line":9,"column":33}}, "method": false, "key": { "type": "Identifier", - "start": 341, - "end": 345, - "loc": { - "start": { - "line": 9, - "column": 29 - }, - "end": { - "line": 9, - "column": 33 - }, - "identifierName": "qux3" - }, + "start":341,"end":345,"loc":{"start":{"line":9,"column":29},"end":{"line":9,"column":33},"identifierName":"qux3"}, "name": "qux3" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 341, - "end": 345, - "loc": { - "start": { - "line": 9, - "column": 29 - }, - "end": { - "line": 9, - "column": 33 - }, - "identifierName": "qux3" - }, + "start":341,"end":345,"loc":{"start":{"line":9,"column":29},"end":{"line":9,"column":33},"identifierName":"qux3"}, "name": "qux3" }, "extra": { @@ -1732,117 +586,37 @@ }, { "type": "ObjectProperty", - "start": 351, - "end": 372, - "loc": { - "start": { - "line": 9, - "column": 39 - }, - "end": { - "line": 9, - "column": 60 - } - }, + "start":351,"end":372,"loc":{"start":{"line":9,"column":39},"end":{"line":9,"column":60}}, "method": false, "key": { "type": "Identifier", - "start": 351, - "end": 355, - "loc": { - "start": { - "line": 9, - "column": 39 - }, - "end": { - "line": 9, - "column": 43 - }, - "identifierName": "foo2" - }, + "start":351,"end":355,"loc":{"start":{"line":9,"column":39},"end":{"line":9,"column":43},"identifierName":"foo2"}, "name": "foo2" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 357, - "end": 372, - "loc": { - "start": { - "line": 9, - "column": 45 - }, - "end": { - "line": 9, - "column": 60 - } - }, + "start":357,"end":372,"loc":{"start":{"line":9,"column":45},"end":{"line":9,"column":60}}, "properties": [ { "type": "ObjectProperty", - "start": 359, - "end": 371, - "loc": { - "start": { - "line": 9, - "column": 47 - }, - "end": { - "line": 9, - "column": 59 - } - }, + "start":359,"end":371,"loc":{"start":{"line":9,"column":47},"end":{"line":9,"column":59}}, "method": false, "key": { "type": "Identifier", - "start": 359, - "end": 363, - "loc": { - "start": { - "line": 9, - "column": 47 - }, - "end": { - "line": 9, - "column": 51 - }, - "identifierName": "baz2" - }, + "start":359,"end":363,"loc":{"start":{"line":9,"column":47},"end":{"line":9,"column":51},"identifierName":"baz2"}, "name": "baz2" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 365, - "end": 371, - "loc": { - "start": { - "line": 9, - "column": 53 - }, - "end": { - "line": 9, - "column": 59 - } - }, + "start":365,"end":371,"loc":{"start":{"line":9,"column":53},"end":{"line":9,"column":59}}, "elements": [ { "type": "Identifier", - "start": 366, - "end": 370, - "loc": { - "start": { - "line": 9, - "column": 54 - }, - "end": { - "line": 9, - "column": 58 - }, - "identifierName": "qux4" - }, + "start":366,"end":370,"loc":{"start":{"line":9,"column":54},"end":{"line":9,"column":58},"identifierName":"qux4"}, "name": "qux4" } ] @@ -1855,19 +629,7 @@ }, "init": { "type": "Identifier", - "start": 377, - "end": 380, - "loc": { - "start": { - "line": 9, - "column": 65 - }, - "end": { - "line": 9, - "column": 68 - }, - "identifierName": "bar" - }, + "start":377,"end":380,"loc":{"start":{"line":9,"column":65},"end":{"line":9,"column":68},"identifierName":"bar"}, "name": "bar" } } @@ -1877,211 +639,64 @@ }, { "type": "ExportNamedDeclaration", - "start": 382, - "end": 453, - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 10, - "column": 71 - } - }, + "start":382,"end":453,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":71}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 389, - "end": 453, - "loc": { - "start": { - "line": 10, - "column": 7 - }, - "end": { - "line": 10, - "column": 71 - } - }, + "start":389,"end":453,"loc":{"start":{"line":10,"column":7},"end":{"line":10,"column":71}}, "declarations": [ { "type": "VariableDeclarator", - "start": 395, - "end": 452, - "loc": { - "start": { - "line": 10, - "column": 13 - }, - "end": { - "line": 10, - "column": 70 - } - }, + "start":395,"end":452,"loc":{"start":{"line":10,"column":13},"end":{"line":10,"column":70}}, "id": { "type": "ObjectPattern", - "start": 395, - "end": 446, - "loc": { - "start": { - "line": 10, - "column": 13 - }, - "end": { - "line": 10, - "column": 64 - } - }, + "start":395,"end":446,"loc":{"start":{"line":10,"column":13},"end":{"line":10,"column":64}}, "properties": [ { "type": "ObjectProperty", - "start": 397, - "end": 419, - "loc": { - "start": { - "line": 10, - "column": 15 - }, - "end": { - "line": 10, - "column": 37 - } - }, + "start":397,"end":419,"loc":{"start":{"line":10,"column":15},"end":{"line":10,"column":37}}, "method": false, "key": { "type": "Identifier", - "start": 397, - "end": 400, - "loc": { - "start": { - "line": 10, - "column": 15 - }, - "end": { - "line": 10, - "column": 18 - }, - "identifierName": "foo" - }, + "start":397,"end":400,"loc":{"start":{"line":10,"column":15},"end":{"line":10,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 402, - "end": 419, - "loc": { - "start": { - "line": 10, - "column": 20 - }, - "end": { - "line": 10, - "column": 37 - } - }, + "start":402,"end":419,"loc":{"start":{"line":10,"column":20},"end":{"line":10,"column":37}}, "properties": [ { "type": "ObjectProperty", - "start": 404, - "end": 417, - "loc": { - "start": { - "line": 10, - "column": 22 - }, - "end": { - "line": 10, - "column": 35 - } - }, + "start":404,"end":417,"loc":{"start":{"line":10,"column":22},"end":{"line":10,"column":35}}, "method": false, "key": { "type": "Identifier", - "start": 404, - "end": 407, - "loc": { - "start": { - "line": 10, - "column": 22 - }, - "end": { - "line": 10, - "column": 25 - }, - "identifierName": "baz" - }, + "start":404,"end":407,"loc":{"start":{"line":10,"column":22},"end":{"line":10,"column":25},"identifierName":"baz"}, "name": "baz" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 409, - "end": 417, - "loc": { - "start": { - "line": 10, - "column": 27 - }, - "end": { - "line": 10, - "column": 35 - } - }, + "start":409,"end":417,"loc":{"start":{"line":10,"column":27},"end":{"line":10,"column":35}}, "properties": [ { "type": "ObjectProperty", - "start": 411, - "end": 415, - "loc": { - "start": { - "line": 10, - "column": 29 - }, - "end": { - "line": 10, - "column": 33 - } - }, + "start":411,"end":415,"loc":{"start":{"line":10,"column":29},"end":{"line":10,"column":33}}, "method": false, "key": { "type": "Identifier", - "start": 411, - "end": 415, - "loc": { - "start": { - "line": 10, - "column": 29 - }, - "end": { - "line": 10, - "column": 33 - }, - "identifierName": "qux5" - }, + "start":411,"end":415,"loc":{"start":{"line":10,"column":29},"end":{"line":10,"column":33},"identifierName":"qux5"}, "name": "qux5" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 411, - "end": 415, - "loc": { - "start": { - "line": 10, - "column": 29 - }, - "end": { - "line": 10, - "column": 33 - }, - "identifierName": "qux5" - }, + "start":411,"end":415,"loc":{"start":{"line":10,"column":29},"end":{"line":10,"column":33},"identifierName":"qux5"}, "name": "qux5" }, "extra": { @@ -2096,166 +711,52 @@ }, { "type": "ObjectProperty", - "start": 421, - "end": 444, - "loc": { - "start": { - "line": 10, - "column": 39 - }, - "end": { - "line": 10, - "column": 62 - } - }, + "start":421,"end":444,"loc":{"start":{"line":10,"column":39},"end":{"line":10,"column":62}}, "method": false, "key": { "type": "Identifier", - "start": 421, - "end": 425, - "loc": { - "start": { - "line": 10, - "column": 39 - }, - "end": { - "line": 10, - "column": 43 - }, - "identifierName": "foo2" - }, + "start":421,"end":425,"loc":{"start":{"line":10,"column":39},"end":{"line":10,"column":43},"identifierName":"foo2"}, "name": "foo2" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 427, - "end": 444, - "loc": { - "start": { - "line": 10, - "column": 45 - }, - "end": { - "line": 10, - "column": 62 - } - }, + "start":427,"end":444,"loc":{"start":{"line":10,"column":45},"end":{"line":10,"column":62}}, "properties": [ { "type": "ObjectProperty", - "start": 429, - "end": 443, - "loc": { - "start": { - "line": 10, - "column": 47 - }, - "end": { - "line": 10, - "column": 61 - } - }, + "start":429,"end":443,"loc":{"start":{"line":10,"column":47},"end":{"line":10,"column":61}}, "method": false, "key": { "type": "Identifier", - "start": 429, - "end": 433, - "loc": { - "start": { - "line": 10, - "column": 47 - }, - "end": { - "line": 10, - "column": 51 - }, - "identifierName": "baz2" - }, + "start":429,"end":433,"loc":{"start":{"line":10,"column":47},"end":{"line":10,"column":51},"identifierName":"baz2"}, "name": "baz2" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 435, - "end": 443, - "loc": { - "start": { - "line": 10, - "column": 53 - }, - "end": { - "line": 10, - "column": 61 - } - }, + "start":435,"end":443,"loc":{"start":{"line":10,"column":53},"end":{"line":10,"column":61}}, "elements": [ { "type": "ObjectPattern", - "start": 436, - "end": 442, - "loc": { - "start": { - "line": 10, - "column": 54 - }, - "end": { - "line": 10, - "column": 60 - } - }, + "start":436,"end":442,"loc":{"start":{"line":10,"column":54},"end":{"line":10,"column":60}}, "properties": [ { "type": "ObjectProperty", - "start": 437, - "end": 441, - "loc": { - "start": { - "line": 10, - "column": 55 - }, - "end": { - "line": 10, - "column": 59 - } - }, + "start":437,"end":441,"loc":{"start":{"line":10,"column":55},"end":{"line":10,"column":59}}, "method": false, "key": { "type": "Identifier", - "start": 437, - "end": 441, - "loc": { - "start": { - "line": 10, - "column": 55 - }, - "end": { - "line": 10, - "column": 59 - }, - "identifierName": "qux6" - }, + "start":437,"end":441,"loc":{"start":{"line":10,"column":55},"end":{"line":10,"column":59},"identifierName":"qux6"}, "name": "qux6" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 437, - "end": 441, - "loc": { - "start": { - "line": 10, - "column": 55 - }, - "end": { - "line": 10, - "column": 59 - }, - "identifierName": "qux6" - }, + "start":437,"end":441,"loc":{"start":{"line":10,"column":55},"end":{"line":10,"column":59},"identifierName":"qux6"}, "name": "qux6" }, "extra": { @@ -2274,19 +775,7 @@ }, "init": { "type": "Identifier", - "start": 449, - "end": 452, - "loc": { - "start": { - "line": 10, - "column": 67 - }, - "end": { - "line": 10, - "column": 70 - }, - "identifierName": "bar" - }, + "start":449,"end":452,"loc":{"start":{"line":10,"column":67},"end":{"line":10,"column":70},"identifierName":"bar"}, "name": "bar" } } @@ -2296,113 +785,34 @@ }, { "type": "ExportNamedDeclaration", - "start": 454, - "end": 481, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 27 - } - }, + "start":454,"end":481,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":27}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 461, - "end": 481, - "loc": { - "start": { - "line": 11, - "column": 7 - }, - "end": { - "line": 11, - "column": 27 - } - }, + "start":461,"end":481,"loc":{"start":{"line":11,"column":7},"end":{"line":11,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 467, - "end": 480, - "loc": { - "start": { - "line": 11, - "column": 13 - }, - "end": { - "line": 11, - "column": 26 - } - }, + "start":467,"end":480,"loc":{"start":{"line":11,"column":13},"end":{"line":11,"column":26}}, "id": { "type": "ObjectPattern", - "start": 467, - "end": 474, - "loc": { - "start": { - "line": 11, - "column": 13 - }, - "end": { - "line": 11, - "column": 20 - } - }, + "start":467,"end":474,"loc":{"start":{"line":11,"column":13},"end":{"line":11,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 469, - "end": 472, - "loc": { - "start": { - "line": 11, - "column": 15 - }, - "end": { - "line": 11, - "column": 18 - } - }, + "start":469,"end":472,"loc":{"start":{"line":11,"column":15},"end":{"line":11,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 469, - "end": 472, - "loc": { - "start": { - "line": 11, - "column": 15 - }, - "end": { - "line": 11, - "column": 18 - }, - "identifierName": "Foo" - }, + "start":469,"end":472,"loc":{"start":{"line":11,"column":15},"end":{"line":11,"column":18},"identifierName":"Foo"}, "name": "Foo" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 469, - "end": 472, - "loc": { - "start": { - "line": 11, - "column": 15 - }, - "end": { - "line": 11, - "column": 18 - }, - "identifierName": "Foo" - }, + "start":469,"end":472,"loc":{"start":{"line":11,"column":15},"end":{"line":11,"column":18},"identifierName":"Foo"}, "name": "Foo" }, "extra": { @@ -2413,19 +823,7 @@ }, "init": { "type": "Identifier", - "start": 477, - "end": 480, - "loc": { - "start": { - "line": 11, - "column": 23 - }, - "end": { - "line": 11, - "column": 26 - }, - "identifierName": "bar" - }, + "start":477,"end":480,"loc":{"start":{"line":11,"column":23},"end":{"line":11,"column":26},"identifierName":"bar"}, "name": "bar" } } @@ -2435,130 +833,40 @@ }, { "type": "ExportNamedDeclaration", - "start": 482, - "end": 522, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 40 - } - }, + "start":482,"end":522,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":40}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 489, - "end": 522, - "loc": { - "start": { - "line": 12, - "column": 7 - }, - "end": { - "line": 12, - "column": 40 - } - }, + "start":489,"end":522,"loc":{"start":{"line":12,"column":7},"end":{"line":12,"column":40}}, "declarations": [ { "type": "VariableDeclarator", - "start": 495, - "end": 521, - "loc": { - "start": { - "line": 12, - "column": 13 - }, - "end": { - "line": 12, - "column": 39 - } - }, + "start":495,"end":521,"loc":{"start":{"line":12,"column":13},"end":{"line":12,"column":39}}, "id": { "type": "ObjectPattern", - "start": 495, - "end": 515, - "loc": { - "start": { - "line": 12, - "column": 13 - }, - "end": { - "line": 12, - "column": 33 - } - }, + "start":495,"end":515,"loc":{"start":{"line":12,"column":13},"end":{"line":12,"column":33}}, "properties": [ { "type": "ObjectProperty", - "start": 497, - "end": 513, - "loc": { - "start": { - "line": 12, - "column": 15 - }, - "end": { - "line": 12, - "column": 31 - } - }, + "start":497,"end":513,"loc":{"start":{"line":12,"column":15},"end":{"line":12,"column":31}}, "method": false, "key": { "type": "Identifier", - "start": 497, - "end": 500, - "loc": { - "start": { - "line": 12, - "column": 15 - }, - "end": { - "line": 12, - "column": 18 - }, - "identifierName": "foo" - }, + "start":497,"end":500,"loc":{"start":{"line":12,"column":15},"end":{"line":12,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 502, - "end": 513, - "loc": { - "start": { - "line": 12, - "column": 20 - }, - "end": { - "line": 12, - "column": 31 - } - }, + "start":502,"end":513,"loc":{"start":{"line":12,"column":20},"end":{"line":12,"column":31}}, "elements": [ null, null, { "type": "Identifier", - "start": 507, - "end": 511, - "loc": { - "start": { - "line": 12, - "column": 25 - }, - "end": { - "line": 12, - "column": 29 - }, - "identifierName": "qux7" - }, + "start":507,"end":511,"loc":{"start":{"line":12,"column":25},"end":{"line":12,"column":29},"identifierName":"qux7"}, "name": "qux7" } ] @@ -2568,19 +876,7 @@ }, "init": { "type": "Identifier", - "start": 518, - "end": 521, - "loc": { - "start": { - "line": 12, - "column": 36 - }, - "end": { - "line": 12, - "column": 39 - }, - "identifierName": "bar" - }, + "start":518,"end":521,"loc":{"start":{"line":12,"column":36},"end":{"line":12,"column":39},"identifierName":"bar"}, "name": "bar" } } 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 ba018d66df..119ea1be6c 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 @@ -1,83 +1,27 @@ { "type": "File", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":34}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:20)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:20)" ], "program": { "type": "Program", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 7, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "foo" - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -85,18 +29,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } @@ -104,192 +37,57 @@ }, { "type": "EmptyStatement", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}} }, { "type": "ExportNamedDeclaration", - "start": 26, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":26,"end":60,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 33, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":33,"end":60,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 39, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":39,"end":59,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":33}}, "id": { "type": "ObjectPattern", - "start": 39, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":39,"end":53,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":27}}, "properties": [ { "type": "ObjectProperty", - "start": 41, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":41,"end":51,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":25}}, "method": false, "key": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "a" - }, + "start":41,"end":42,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 44, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":44,"end":51,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":25}}, "elements": [ { "type": "ObjectPattern", - "start": 45, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":45,"end":50,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":24}}, "properties": [ { "type": "ObjectProperty", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":46,"end":49,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23}}, "method": false, "key": { "type": "Identifier", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "foo" - }, + "start":46,"end":49,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "foo" - }, + "start":46,"end":49,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23},"identifierName":"foo"}, "name": "foo" }, "extra": { @@ -305,19 +103,7 @@ }, "init": { "type": "Identifier", - "start": 56, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 33 - }, - "identifierName": "bar" - }, + "start":56,"end":59,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":33},"identifierName":"bar"}, "name": "bar" } } 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 853a210536..933af6bc6d 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 @@ -1,83 +1,27 @@ { "type": "File", - "start": 0, - "end": 96, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 69 - } - }, + "start":0,"end":96,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":69}}, "errors": [ "SyntaxError: Identifier 'foo4' has already been declared (2:50)", "SyntaxError: `foo4` has already been exported. Exported identifiers must be unique. (2:50)" ], "program": { "type": "Program", - "start": 0, - "end": 96, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 69 - } - }, + "start":0,"end":96,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":69}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "foo4" - }, + "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"foo4"}, "name": "foo4" }, "generator": false, @@ -85,18 +29,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } @@ -104,207 +37,61 @@ }, { "type": "EmptyStatement", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - } + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}} }, { "type": "ExportNamedDeclaration", - "start": 27, - "end": 96, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 69 - } - }, + "start":27,"end":96,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":69}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 34, - "end": 96, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 69 - } - }, + "start":34,"end":96,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":69}}, "declarations": [ { "type": "VariableDeclarator", - "start": 40, - "end": 95, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 68 - } - }, + "start":40,"end":95,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":68}}, "id": { "type": "ArrayPattern", - "start": 40, - "end": 89, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 62 - } - }, + "start":40,"end":89,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":62}}, "elements": [ { "type": "ObjectPattern", - "start": 41, - "end": 88, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 61 - } - }, + "start":41,"end":88,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":61}}, "properties": [ { "type": "ObjectProperty", - "start": 43, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":43,"end":55,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":28}}, "method": false, "key": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "a" - }, + "start":43,"end":44,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 46, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":46,"end":55,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":28}}, "elements": [ { "type": "ObjectPattern", - "start": 47, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":47,"end":54,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":27}}, "properties": [ { "type": "ObjectProperty", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":49,"end":52,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25}}, "method": false, "key": { "type": "Identifier", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "foo" - }, + "start":49,"end":52,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "foo" - }, + "start":49,"end":52,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"foo"}, "name": "foo" }, "extra": { @@ -318,166 +105,52 @@ }, { "type": "ObjectProperty", - "start": 57, - "end": 86, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 59 - } - }, + "start":57,"end":86,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":59}}, "method": false, "key": { "type": "Identifier", - "start": 57, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 31 - }, - "identifierName": "b" - }, + "start":57,"end":58,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":31},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 60, - "end": 86, - "loc": { - "start": { - "line": 2, - "column": 33 - }, - "end": { - "line": 2, - "column": 59 - } - }, + "start":60,"end":86,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":59}}, "properties": [ { "type": "ObjectProperty", - "start": 62, - "end": 84, - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 57 - } - }, + "start":62,"end":84,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":57}}, "method": false, "key": { "type": "Identifier", - "start": 62, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 39 - }, - "identifierName": "foo2" - }, + "start":62,"end":66,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":39},"identifierName":"foo2"}, "name": "foo2" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 68, - "end": 84, - "loc": { - "start": { - "line": 2, - "column": 41 - }, - "end": { - "line": 2, - "column": 57 - } - }, + "start":68,"end":84,"loc":{"start":{"line":2,"column":41},"end":{"line":2,"column":57}}, "elements": [ { "type": "ObjectPattern", - "start": 69, - "end": 83, - "loc": { - "start": { - "line": 2, - "column": 42 - }, - "end": { - "line": 2, - "column": 56 - } - }, + "start":69,"end":83,"loc":{"start":{"line":2,"column":42},"end":{"line":2,"column":56}}, "properties": [ { "type": "ObjectProperty", - "start": 71, - "end": 81, - "loc": { - "start": { - "line": 2, - "column": 44 - }, - "end": { - "line": 2, - "column": 54 - } - }, + "start":71,"end":81,"loc":{"start":{"line":2,"column":44},"end":{"line":2,"column":54}}, "method": false, "key": { "type": "Identifier", - "start": 71, - "end": 75, - "loc": { - "start": { - "line": 2, - "column": 44 - }, - "end": { - "line": 2, - "column": 48 - }, - "identifierName": "foo3" - }, + "start":71,"end":75,"loc":{"start":{"line":2,"column":44},"end":{"line":2,"column":48},"identifierName":"foo3"}, "name": "foo3" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 77, - "end": 81, - "loc": { - "start": { - "line": 2, - "column": 50 - }, - "end": { - "line": 2, - "column": 54 - }, - "identifierName": "foo4" - }, + "start":77,"end":81,"loc":{"start":{"line":2,"column":50},"end":{"line":2,"column":54},"identifierName":"foo4"}, "name": "foo4" } } @@ -495,19 +168,7 @@ }, "init": { "type": "Identifier", - "start": 92, - "end": 95, - "loc": { - "start": { - "line": 2, - "column": 65 - }, - "end": { - "line": 2, - "column": 68 - }, - "identifierName": "bar" - }, + "start":92,"end":95,"loc":{"start":{"line":2,"column":65},"end":{"line":2,"column":68},"identifierName":"bar"}, "name": "bar" } } 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 9100976f57..c5c74319fb 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 @@ -1,83 +1,27 @@ { "type": "File", - "start": 0, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 67 - } - }, + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":67}}, "errors": [ "SyntaxError: Identifier 'foo4' has already been declared (2:49)", "SyntaxError: `foo4` has already been exported. Exported identifiers must be unique. (2:49)" ], "program": { "type": "Program", - "start": 0, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 67 - } - }, + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":67}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "foo4" - }, + "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"foo4"}, "name": "foo4" }, "generator": false, @@ -85,18 +29,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } @@ -104,192 +37,57 @@ }, { "type": "EmptyStatement", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - } + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}} }, { "type": "ExportNamedDeclaration", - "start": 27, - "end": 94, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 67 - } - }, + "start":27,"end":94,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":67}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 34, - "end": 94, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 67 - } - }, + "start":34,"end":94,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":67}}, "declarations": [ { "type": "VariableDeclarator", - "start": 40, - "end": 93, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 66 - } - }, + "start":40,"end":93,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":66}}, "id": { "type": "ObjectPattern", - "start": 40, - "end": 87, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 60 - } - }, + "start":40,"end":87,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":60}}, "properties": [ { "type": "ObjectProperty", - "start": 42, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":42,"end":54,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":27}}, "method": false, "key": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "a" - }, + "start":42,"end":43,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 45, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":45,"end":54,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":27}}, "elements": [ { "type": "ObjectPattern", - "start": 46, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":46,"end":53,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":26}}, "properties": [ { "type": "ObjectProperty", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":48,"end":51,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24}}, "method": false, "key": { "type": "Identifier", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "foo" - }, + "start":48,"end":51,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "foo" - }, + "start":48,"end":51,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24},"identifierName":"foo"}, "name": "foo" }, "extra": { @@ -303,166 +101,52 @@ }, { "type": "ObjectProperty", - "start": 56, - "end": 85, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 58 - } - }, + "start":56,"end":85,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":58}}, "method": false, "key": { "type": "Identifier", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 30 - }, - "identifierName": "b" - }, + "start":56,"end":57,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":30},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 59, - "end": 85, - "loc": { - "start": { - "line": 2, - "column": 32 - }, - "end": { - "line": 2, - "column": 58 - } - }, + "start":59,"end":85,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":58}}, "properties": [ { "type": "ObjectProperty", - "start": 61, - "end": 83, - "loc": { - "start": { - "line": 2, - "column": 34 - }, - "end": { - "line": 2, - "column": 56 - } - }, + "start":61,"end":83,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":56}}, "method": false, "key": { "type": "Identifier", - "start": 61, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 34 - }, - "end": { - "line": 2, - "column": 38 - }, - "identifierName": "foo2" - }, + "start":61,"end":65,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":38},"identifierName":"foo2"}, "name": "foo2" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 67, - "end": 83, - "loc": { - "start": { - "line": 2, - "column": 40 - }, - "end": { - "line": 2, - "column": 56 - } - }, + "start":67,"end":83,"loc":{"start":{"line":2,"column":40},"end":{"line":2,"column":56}}, "elements": [ { "type": "ObjectPattern", - "start": 68, - "end": 82, - "loc": { - "start": { - "line": 2, - "column": 41 - }, - "end": { - "line": 2, - "column": 55 - } - }, + "start":68,"end":82,"loc":{"start":{"line":2,"column":41},"end":{"line":2,"column":55}}, "properties": [ { "type": "ObjectProperty", - "start": 70, - "end": 80, - "loc": { - "start": { - "line": 2, - "column": 43 - }, - "end": { - "line": 2, - "column": 53 - } - }, + "start":70,"end":80,"loc":{"start":{"line":2,"column":43},"end":{"line":2,"column":53}}, "method": false, "key": { "type": "Identifier", - "start": 70, - "end": 74, - "loc": { - "start": { - "line": 2, - "column": 43 - }, - "end": { - "line": 2, - "column": 47 - }, - "identifierName": "foo3" - }, + "start":70,"end":74,"loc":{"start":{"line":2,"column":43},"end":{"line":2,"column":47},"identifierName":"foo3"}, "name": "foo3" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 76, - "end": 80, - "loc": { - "start": { - "line": 2, - "column": 49 - }, - "end": { - "line": 2, - "column": 53 - }, - "identifierName": "foo4" - }, + "start":76,"end":80,"loc":{"start":{"line":2,"column":49},"end":{"line":2,"column":53},"identifierName":"foo4"}, "name": "foo4" } } @@ -478,19 +162,7 @@ }, "init": { "type": "Identifier", - "start": 90, - "end": 93, - "loc": { - "start": { - "line": 2, - "column": 63 - }, - "end": { - "line": 2, - "column": 66 - }, - "identifierName": "bar" - }, + "start":90,"end":93,"loc":{"start":{"line":2,"column":63},"end":{"line":2,"column":66},"identifierName":"bar"}, "name": "bar" } } 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 63e32c4886..2e17d443f6 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 @@ -1,83 +1,27 @@ { "type": "File", - "start": 0, - "end": 103, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 76 - } - }, + "start":0,"end":103,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":76}}, "errors": [ "SyntaxError: Identifier 'foo4' has already been declared (2:58)", "SyntaxError: `foo4` has already been exported. Exported identifiers must be unique. (2:58)" ], "program": { "type": "Program", - "start": 0, - "end": 103, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 76 - } - }, + "start":0,"end":103,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":76}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "foo4" - }, + "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"foo4"}, "name": "foo4" }, "generator": false, @@ -85,18 +29,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } @@ -104,192 +37,57 @@ }, { "type": "EmptyStatement", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - } + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}} }, { "type": "ExportNamedDeclaration", - "start": 27, - "end": 103, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 76 - } - }, + "start":27,"end":103,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":76}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 34, - "end": 103, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 76 - } - }, + "start":34,"end":103,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":76}}, "declarations": [ { "type": "VariableDeclarator", - "start": 40, - "end": 102, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 75 - } - }, + "start":40,"end":102,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":75}}, "id": { "type": "ObjectPattern", - "start": 40, - "end": 96, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 69 - } - }, + "start":40,"end":96,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":69}}, "properties": [ { "type": "ObjectProperty", - "start": 42, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":42,"end":60,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":33}}, "method": false, "key": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "a" - }, + "start":42,"end":43,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 45, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":45,"end":60,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":33}}, "elements": [ { "type": "ObjectPattern", - "start": 46, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":46,"end":59,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":32}}, "properties": [ { "type": "ObjectProperty", - "start": 48, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":48,"end":57,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":30}}, "method": false, "key": { "type": "Identifier", - "start": 48, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "foo4" - }, + "start":48,"end":52,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":25},"identifierName":"foo4"}, "name": "foo4" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 54, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 30 - }, - "identifierName": "foo" - }, + "start":54,"end":57,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":30},"identifierName":"foo"}, "name": "foo" } } @@ -300,53 +98,18 @@ }, { "type": "ObjectProperty", - "start": 62, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":62,"end":63,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":36}}, "method": false, "key": { "type": "Identifier", - "start": 62, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 36 - }, - "identifierName": "b" - }, + "start":62,"end":63,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":36},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 62, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 36 - }, - "identifierName": "b" - }, + "start":62,"end":63,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":36},"identifierName":"b"}, "name": "b" }, "extra": { @@ -355,166 +118,52 @@ }, { "type": "ObjectProperty", - "start": 65, - "end": 94, - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 2, - "column": 67 - } - }, + "start":65,"end":94,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":67}}, "method": false, "key": { "type": "Identifier", - "start": 65, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 2, - "column": 39 - }, - "identifierName": "c" - }, + "start":65,"end":66,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":39},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 68, - "end": 94, - "loc": { - "start": { - "line": 2, - "column": 41 - }, - "end": { - "line": 2, - "column": 67 - } - }, + "start":68,"end":94,"loc":{"start":{"line":2,"column":41},"end":{"line":2,"column":67}}, "properties": [ { "type": "ObjectProperty", - "start": 70, - "end": 92, - "loc": { - "start": { - "line": 2, - "column": 43 - }, - "end": { - "line": 2, - "column": 65 - } - }, + "start":70,"end":92,"loc":{"start":{"line":2,"column":43},"end":{"line":2,"column":65}}, "method": false, "key": { "type": "Identifier", - "start": 70, - "end": 74, - "loc": { - "start": { - "line": 2, - "column": 43 - }, - "end": { - "line": 2, - "column": 47 - }, - "identifierName": "foo2" - }, + "start":70,"end":74,"loc":{"start":{"line":2,"column":43},"end":{"line":2,"column":47},"identifierName":"foo2"}, "name": "foo2" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 76, - "end": 92, - "loc": { - "start": { - "line": 2, - "column": 49 - }, - "end": { - "line": 2, - "column": 65 - } - }, + "start":76,"end":92,"loc":{"start":{"line":2,"column":49},"end":{"line":2,"column":65}}, "elements": [ { "type": "ObjectPattern", - "start": 77, - "end": 91, - "loc": { - "start": { - "line": 2, - "column": 50 - }, - "end": { - "line": 2, - "column": 64 - } - }, + "start":77,"end":91,"loc":{"start":{"line":2,"column":50},"end":{"line":2,"column":64}}, "properties": [ { "type": "ObjectProperty", - "start": 79, - "end": 89, - "loc": { - "start": { - "line": 2, - "column": 52 - }, - "end": { - "line": 2, - "column": 62 - } - }, + "start":79,"end":89,"loc":{"start":{"line":2,"column":52},"end":{"line":2,"column":62}}, "method": false, "key": { "type": "Identifier", - "start": 79, - "end": 83, - "loc": { - "start": { - "line": 2, - "column": 52 - }, - "end": { - "line": 2, - "column": 56 - }, - "identifierName": "foo3" - }, + "start":79,"end":83,"loc":{"start":{"line":2,"column":52},"end":{"line":2,"column":56},"identifierName":"foo3"}, "name": "foo3" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 85, - "end": 89, - "loc": { - "start": { - "line": 2, - "column": 58 - }, - "end": { - "line": 2, - "column": 62 - }, - "identifierName": "foo4" - }, + "start":85,"end":89,"loc":{"start":{"line":2,"column":58},"end":{"line":2,"column":62},"identifierName":"foo4"}, "name": "foo4" } } @@ -530,19 +179,7 @@ }, "init": { "type": "Identifier", - "start": 99, - "end": 102, - "loc": { - "start": { - "line": 2, - "column": 72 - }, - "end": { - "line": 2, - "column": 75 - }, - "identifierName": "bar" - }, + "start":99,"end":102,"loc":{"start":{"line":2,"column":72},"end":{"line":2,"column":75},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json index 1d699b5813..c0baf34cf9 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring14/output.json @@ -1,114 +1,36 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":33}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:21)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:21)" ], "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" @@ -122,113 +44,34 @@ }, { "type": "ExportNamedDeclaration", - "start": 22, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":22,"end":55,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":33}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 29, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":29,"end":55,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":33}}, "declarations": [ { "type": "VariableDeclarator", - "start": 35, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":35,"end":54,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":32}}, "id": { "type": "ObjectPattern", - "start": 35, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":35,"end":48,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":26}}, "properties": [ { "type": "ObjectProperty", - "start": 37, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":37,"end":46,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":24}}, "method": false, "key": { "type": "Identifier", - "start": 37, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "foo2" - }, + "start":37,"end":41,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":19},"identifierName":"foo2"}, "name": "foo2" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "foo" - }, + "start":43,"end":46,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24},"identifierName":"foo"}, "name": "foo" } } @@ -236,19 +79,7 @@ }, "init": { "type": "Identifier", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 32 - }, - "identifierName": "bar" - }, + "start":51,"end":54,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":32},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/output.json index 140798f03a..3d24d48320 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring15/output.json @@ -1,147 +1,46 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ "SyntaxError: Identifier 'foo2' has already been declared (2:13)", "SyntaxError: `foo2` has already been exported. Exported identifiers must be unique. (2:13)" ], "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":7,"end":33,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":33}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":13,"end":32,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":32}}, "id": { "type": "ObjectPattern", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "properties": [ { "type": "ObjectProperty", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 20, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "foo2" - }, + "start":20,"end":24,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":24},"identifierName":"foo2"}, "name": "foo2" } } @@ -149,19 +48,7 @@ }, "init": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "bar" - }, + "start":29,"end":32,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":32},"identifierName":"bar"}, "name": "bar" } } @@ -171,80 +58,24 @@ }, { "type": "ExportNamedDeclaration", - "start": 34, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":34,"end":56,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 41, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":41,"end":56,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 47, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":47,"end":55,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":21}}, "id": { "type": "Identifier", - "start": 47, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "foo2" - }, + "start":47,"end":51,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":17},"identifierName":"foo2"}, "name": "foo2" }, "init": { "type": "NumericLiteral", - "start": 54, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":54,"end":55,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":21}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/output.json index d51c3a34e3..02547f2eee 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring16/output.json @@ -1,114 +1,36 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":33}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:22)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:22)" ], "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" @@ -122,110 +44,31 @@ }, { "type": "ExportNamedDeclaration", - "start": 22, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":22,"end":55,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":33}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 29, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":29,"end":55,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":33}}, "declarations": [ { "type": "VariableDeclarator", - "start": 35, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":35,"end":54,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":32}}, "id": { "type": "ArrayPattern", - "start": 35, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":35,"end":48,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":26}}, "elements": [ { "type": "Identifier", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "bar" - }, + "start":36,"end":39,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17},"identifierName":"bar"}, "name": "bar" }, { "type": "RestElement", - "start": 41, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":41,"end":47,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":25}}, "argument": { "type": "Identifier", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "foo" - }, + "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"foo"}, "name": "foo" } } @@ -233,19 +76,7 @@ }, "init": { "type": "Identifier", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 32 - }, - "identifierName": "baz" - }, + "start":51,"end":54,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":32},"identifierName":"baz"}, "name": "baz" } } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/output.json index 5d56b3c37e..df81eb4ac1 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring17/output.json @@ -1,144 +1,43 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "errors": [ "SyntaxError: Identifier 'bar' has already been declared (2:13)", "SyntaxError: `bar` has already been exported. Exported identifiers must be unique. (2:13)" ], "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":7,"end":33,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":33}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":13,"end":32,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":32}}, "id": { "type": "ArrayPattern", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "elements": [ { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"foo"}, "name": "foo" }, { "type": "RestElement", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}}, "argument": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "bar" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"bar"}, "name": "bar" } } @@ -146,19 +45,7 @@ }, "init": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "baz" - }, + "start":29,"end":32,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":32},"identifierName":"baz"}, "name": "baz" } } @@ -168,80 +55,24 @@ }, { "type": "ExportNamedDeclaration", - "start": 34, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":34,"end":55,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":21}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 41, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":41,"end":55,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 47, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":47,"end":54,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":20}}, "id": { "type": "Identifier", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "bar" - }, + "start":47,"end":50,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16},"identifierName":"bar"}, "name": "bar" }, "init": { "type": "NumericLiteral", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":53,"end":54,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/output.json index 0378d078ec..23ff7e9f44 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring18/output.json @@ -1,114 +1,36 @@ { "type": "File", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":40}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:28)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:28)" ], "program": { "type": "Program", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":40}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" @@ -122,142 +44,40 @@ }, { "type": "ExportNamedDeclaration", - "start": 22, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":22,"end":62,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":40}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 29, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":29,"end":62,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":40}}, "declarations": [ { "type": "VariableDeclarator", - "start": 35, - "end": 61, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 39 - } - }, + "start":35,"end":61,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":39}}, "id": { "type": "ArrayPattern", - "start": 35, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":35,"end":55,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":33}}, "elements": [ { "type": "Identifier", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "bar" - }, + "start":36,"end":39,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17},"identifierName":"bar"}, "name": "bar" }, { "type": "ArrayPattern", - "start": 41, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":41,"end":54,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":32}}, "elements": [ { "type": "Identifier", - "start": 42, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "baz" - }, + "start":42,"end":45,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23},"identifierName":"baz"}, "name": "baz" }, { "type": "RestElement", - "start": 47, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":47,"end":53,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":31}}, "argument": { "type": "Identifier", - "start": 50, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 31 - }, - "identifierName": "foo" - }, + "start":50,"end":53,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":31},"identifierName":"foo"}, "name": "foo" } } @@ -267,19 +87,7 @@ }, "init": { "type": "Identifier", - "start": 58, - "end": 61, - "loc": { - "start": { - "line": 2, - "column": 36 - }, - "end": { - "line": 2, - "column": 39 - }, - "identifierName": "qux" - }, + "start":58,"end":61,"loc":{"start":{"line":2,"column":36},"end":{"line":2,"column":39},"identifierName":"qux"}, "name": "qux" } } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/output.json index e185b7f418..2c99a1b1d6 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring19/output.json @@ -1,114 +1,36 @@ { "type": "File", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 42 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":42}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:29)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:29)" ], "program": { "type": "Program", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 42 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":42}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" @@ -122,159 +44,46 @@ }, { "type": "ExportNamedDeclaration", - "start": 22, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 42 - } - }, + "start":22,"end":64,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 29, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 42 - } - }, + "start":29,"end":64,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":42}}, "declarations": [ { "type": "VariableDeclarator", - "start": 35, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 41 - } - }, + "start":35,"end":63,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":41}}, "id": { "type": "ObjectPattern", - "start": 35, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":35,"end":57,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":35}}, "properties": [ { "type": "ObjectProperty", - "start": 37, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":37,"end":55,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":33}}, "method": false, "key": { "type": "Identifier", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "bar" - }, + "start":37,"end":40,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"bar"}, "name": "bar" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 42, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":42,"end":55,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":33}}, "elements": [ { "type": "Identifier", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "baz" - }, + "start":43,"end":46,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24},"identifierName":"baz"}, "name": "baz" }, { "type": "RestElement", - "start": 48, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":48,"end":54,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":32}}, "argument": { "type": "Identifier", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 32 - }, - "identifierName": "foo" - }, + "start":51,"end":54,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":32},"identifierName":"foo"}, "name": "foo" } } @@ -285,19 +94,7 @@ }, "init": { "type": "Identifier", - "start": 60, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 2, - "column": 41 - }, - "identifierName": "qux" - }, + "start":60,"end":63,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":41},"identifierName":"qux"}, "name": "qux" } } 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 8e8c195325..4673f33372 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 @@ -1,83 +1,27 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:15)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:15)" ], "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 7, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "foo" - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -85,18 +29,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } @@ -104,128 +37,38 @@ }, { "type": "EmptyStatement", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}} }, { "type": "ExportNamedDeclaration", - "start": 26, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":26,"end":53,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 33, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":33,"end":53,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 39, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":39,"end":52,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":26}}, "id": { "type": "ObjectPattern", - "start": 39, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":39,"end":46,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "foo" - }, + "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "foo" - }, + "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" }, "extra": { @@ -236,19 +79,7 @@ }, "init": { "type": "Identifier", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 26 - }, - "identifierName": "bar" - }, + "start":49,"end":52,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":26},"identifierName":"bar"}, "name": "bar" } } 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 f862a6a420..300af91efc 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 @@ -1,147 +1,46 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:16)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:0)" ], "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":7,"end":27,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "id": { "type": "ObjectPattern", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" }, "extra": { @@ -152,19 +51,7 @@ }, "init": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "bar" - }, + "start":23,"end":26,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":26},"identifierName":"bar"}, "name": "bar" } } @@ -174,49 +61,15 @@ }, { "type": "ExportNamedDeclaration", - "start": 28, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":28,"end":52,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":24}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 35, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":35,"end":52,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":24}}, "id": { "type": "Identifier", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "foo" - }, + "start":44,"end":47,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":19},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -224,18 +77,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 50, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":50,"end":52,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":24}}, "body": [], "directives": [] } @@ -243,18 +85,7 @@ }, { "type": "EmptyStatement", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - } - } + "start":52,"end":53,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":25}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json index 401baa93a8..54ca454dbe 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring4/output.json @@ -1,83 +1,27 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:14)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:14)" ], "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 7, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "foo" - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -85,18 +29,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } @@ -104,113 +37,34 @@ }, { "type": "EmptyStatement", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}} }, { "type": "ExportNamedDeclaration", - "start": 26, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":26,"end":51,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":25}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 33, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":33,"end":51,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 39, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":39,"end":50,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":24}}, "id": { "type": "ArrayPattern", - "start": 39, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":39,"end":44,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18}}, "elements": [ { "type": "Identifier", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "foo" - }, + "start":40,"end":43,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17},"identifierName":"foo"}, "name": "foo" } ] }, "init": { "type": "Identifier", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "bar" - }, + "start":47,"end":50,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/output.json index 39b035aada..f8265d2b77 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring5/output.json @@ -1,132 +1,42 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:16)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:0)" ], "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24}}, "id": { "type": "ArrayPattern", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18}}, "elements": [ { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"foo"}, "name": "foo" } ] }, "init": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "bar" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"bar"}, "name": "bar" } } @@ -136,49 +46,15 @@ }, { "type": "ExportNamedDeclaration", - "start": 26, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":26,"end":50,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":24}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 33, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":33,"end":50,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":24}}, "id": { "type": "Identifier", - "start": 42, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "foo" - }, + "start":42,"end":45,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":19},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -186,18 +62,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 48, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":48,"end":50,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":24}}, "body": [], "directives": [] } @@ -205,18 +70,7 @@ }, { "type": "EmptyStatement", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - } - } + "start":50,"end":51,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":25}} } ], "directives": [] 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 d4856c9023..74dc3d4b6e 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 @@ -1,147 +1,46 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":26}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:14)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:14)" ], "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":7,"end":27,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "id": { "type": "ObjectPattern", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" }, "extra": { @@ -152,19 +51,7 @@ }, "init": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "bar" - }, + "start":23,"end":26,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":26},"identifierName":"bar"}, "name": "bar" } } @@ -174,98 +61,30 @@ }, { "type": "ExportNamedDeclaration", - "start": 28, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":28,"end":54,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":26}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 35, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":35,"end":54,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":26}}, "declarations": [ { "type": "VariableDeclarator", - "start": 41, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":41,"end":53,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":25}}, "id": { "type": "ArrayPattern", - "start": 41, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":41,"end":46,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18}}, "elements": [ { "type": "Identifier", - "start": 42, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "foo" - }, + "start":42,"end":45,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17},"identifierName":"foo"}, "name": "foo" } ] }, "init": { "type": "Identifier", - "start": 49, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "bar2" - }, + "start":49,"end":53,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":25},"identifierName":"bar2"}, "name": "bar2" } } 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 3bfd361f52..90a9d8e8df 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 @@ -1,132 +1,42 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":28}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:15)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:15)" ], "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24}}, "id": { "type": "ArrayPattern", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18}}, "elements": [ { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"foo"}, "name": "foo" } ] }, "init": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "bar" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"bar"}, "name": "bar" } } @@ -136,113 +46,34 @@ }, { "type": "ExportNamedDeclaration", - "start": 26, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":26,"end":54,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 33, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":33,"end":54,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 39, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":39,"end":53,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":27}}, "id": { "type": "ObjectPattern", - "start": 39, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":39,"end":46,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "foo" - }, + "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "foo" - }, + "start":41,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" }, "extra": { @@ -253,19 +84,7 @@ }, "init": { "type": "Identifier", - "start": 49, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "bar2" - }, + "start":49,"end":53,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":27},"identifierName":"bar2"}, "name": "bar2" } } 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 5826aac519..b09cb52efb 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 @@ -1,228 +1,71 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "errors": [ "SyntaxError: Identifier 'Foo' has already been declared (2:15)", "SyntaxError: `Foo` has already been exported. Exported identifiers must be unique. (2:15)" ], "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "specifiers": [], "source": null, "declaration": { "type": "ClassDeclaration", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "Foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [] } } }, { "type": "EmptyStatement", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}} }, { "type": "ExportNamedDeclaration", - "start": 21, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":21,"end":48,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 28, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":28,"end":48,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 34, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":34,"end":47,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":26}}, "id": { "type": "ObjectPattern", - "start": 34, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":34,"end":41,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":36,"end":39,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "Foo" - }, + "start":36,"end":39,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"Foo"}, "name": "Foo" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "Foo" - }, + "start":36,"end":39,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"Foo"}, "name": "Foo" }, "extra": { @@ -233,19 +76,7 @@ }, "init": { "type": "Identifier", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 26 - }, - "identifierName": "bar" - }, + "start":44,"end":47,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":26},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json index 4ee921df35..db65b77d4d 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-destructuring9/output.json @@ -1,213 +1,67 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ "SyntaxError: Identifier 'Foo' has already been declared (2:14)", "SyntaxError: `Foo` has already been exported. Exported identifiers must be unique. (2:14)" ], "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "specifiers": [], "source": null, "declaration": { "type": "ClassDeclaration", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "Foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [] } } }, { "type": "EmptyStatement", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}} }, { "type": "ExportNamedDeclaration", - "start": 21, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":21,"end":46,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":25}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 28, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":28,"end":46,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 34, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":34,"end":45,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":24}}, "id": { "type": "ArrayPattern", - "start": 34, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":34,"end":39,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18}}, "elements": [ { "type": "Identifier", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "Foo" - }, + "start":35,"end":38,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17},"identifierName":"Foo"}, "name": "Foo" } ] }, "init": { "type": "Identifier", - "start": 42, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "bar" - }, + "start":42,"end":45,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/output.json index ac8f210f8b..411c0c758d 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-function-declaration/output.json @@ -1,98 +1,30 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:0)" ], "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "local": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "exported": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" } } @@ -102,49 +34,15 @@ }, { "type": "ExportNamedDeclaration", - "start": 16, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":16,"end":40,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":24}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 23, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":23,"end":40,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":24}}, "id": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "foo" - }, + "start":32,"end":35,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":19},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -152,18 +50,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":38,"end":40,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":24}}, "body": [], "directives": [] } @@ -171,18 +58,7 @@ }, { "type": "EmptyStatement", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - } - } + "start":40,"end":41,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":25}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/output.json index 981050ec61..65c91019ea 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export-variable-declaration/output.json @@ -1,98 +1,30 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":23}}, "errors": [ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:13)" ], "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "local": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "exported": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" } } @@ -102,81 +34,24 @@ }, { "type": "ExportNamedDeclaration", - "start": 16, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":16,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 23, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":23,"end":39,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 29, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":29,"end":38,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":22}}, "id": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "foo" - }, + "start":29,"end":32,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "Identifier", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "bar" - }, + "start":35,"end":38,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":22},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/output.json b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/output.json index b6476d6203..86c07bcfa5 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/duplicate-named-export/output.json @@ -1,17 +1,6 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:9)", "SyntaxError: Export 'foo' is not defined (1:9)", @@ -19,82 +8,25 @@ ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "local": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "exported": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" } } @@ -104,65 +36,19 @@ }, { "type": "ExportNamedDeclaration", - "start": 16, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":16,"end":38,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 25, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":25,"end":35,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":19}}, "local": { "type": "Identifier", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "bar" - }, + "start":25,"end":28,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"bar"}, "name": "bar" }, "exported": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "foo" - }, + "start":32,"end":35,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":19},"identifierName":"foo"}, "name": "foo" } } 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 a663fd513d..bbffebd77d 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 @@ -1,181 +1,58 @@ { "type": "File", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 24 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 24 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 24 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":24}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":21,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15}}, "local": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "Foo" - }, + "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" - }, + "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 - } - } + "start":11,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} } ], "trailingComments": [ { "type": "CommentBlock", "value": " Two ", - "start": 27, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 11 - } - } + "start":27,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":11}} }, { "type": "CommentBlock", "value": " Three ", - "start": 40, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 13 - } - } + "start":40,"end":51,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":13}} }, { "type": "CommentBlock", "value": " Four ", - "start": 54, - "end": 64, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 12 - } - } + "start":54,"end":64,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":12}} } ] } ], "source": { "type": "StringLiteral", - "start": 70, - "end": 75, - "loc": { - "start": { - "line": 5, - "column": 18 - }, - "end": { - "line": 5, - "column": 23 - } - }, + "start":70,"end":75,"loc":{"start":{"line":5,"column":18},"end":{"line":5,"column":23}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -191,66 +68,22 @@ { "type": "CommentBlock", "value": " One ", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 11 - } - } + "start":11,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} }, { "type": "CommentBlock", "value": " Two ", - "start": 27, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 11 - } - } + "start":27,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":11}} }, { "type": "CommentBlock", "value": " Three ", - "start": 40, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 13 - } - } + "start":40,"end":51,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":13}} }, { "type": "CommentBlock", "value": " Four ", - "start": 54, - "end": 64, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 12 - } - } + "start":54,"end":64,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":12}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/export-default-class-declaration/output.json b/packages/babel-parser/test/fixtures/es2015/modules/export-default-class-declaration/output.json index 72680f1b3a..d10c09f162 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/export-default-class-declaration/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/export-default-class-declaration/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "declaration": { "type": "ClassDeclaration", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "Foo" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/export-default-class-expression/output.json b/packages/babel-parser/test/fixtures/es2015/modules/export-default-class-expression/output.json index 8302a22fd1..dd3e6ac4aa 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/export-default-class-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/export-default-class-expression/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "declaration": { "type": "ClassExpression", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "Foo" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "body": [] }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2015/modules/export-default-function-declaration-expression-disambiguation/output.json b/packages/babel-parser/test/fixtures/es2015/modules/export-default-function-declaration-expression-disambiguation/output.json index ac69f354fd..87fa5a3be3 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/export-default-function-declaration-expression-disambiguation/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/export-default-function-declaration-expression-disambiguation/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "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}}, "declaration": { "type": "FunctionDeclaration", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":15,"end":29,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":29}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } @@ -82,33 +27,10 @@ }, { "type": "ExpressionStatement", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":30,"end":36,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "foo" - }, + "start":31,"end":34,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":4},"identifierName":"foo"}, "name": "foo", "extra": { "parenthesized": true, diff --git a/packages/babel-parser/test/fixtures/es2015/modules/export-default-function-declaration/output.json b/packages/babel-parser/test/fixtures/es2015/modules/export-default-function-declaration/output.json index bc8661b66b..60073329ef 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/export-default-function-declaration/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/export-default-function-declaration/output.json @@ -1,77 +1,21 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "declaration": { "type": "FunctionDeclaration", - "start": 15, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":15,"end":30,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "a" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -79,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/export-default-function-expression/output.json b/packages/babel-parser/test/fixtures/es2015/modules/export-default-function-expression/output.json index 57681450d5..fed40d5b6a 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/export-default-function-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/export-default-function-expression/output.json @@ -1,77 +1,21 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "declaration": { "type": "FunctionExpression", - "start": 16, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":16,"end":31,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "a" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -79,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/es2015/modules/export-from-valid-reserved-word/output.json b/packages/babel-parser/test/fixtures/es2015/modules/export-from-valid-reserved-word/output.json index 5455a52879..bc477ba5e0 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/export-from-valid-reserved-word/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/export-from-valid-reserved-word/output.json @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "specifiers": [ { "type": "ExportSpecifier", - "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}}, "local": { "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" }, "exported": { "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" } } ], "source": { "type": "StringLiteral", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "extra": { "rawValue": "foo", "raw": "'foo'" 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 a5ebc224c9..a968e0267d 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 @@ -1,181 +1,58 @@ { "type": "File", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 24 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 24 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 24 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":24}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":21,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15}}, "imported": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "Foo" - }, + "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" - }, + "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 - } - } + "start":11,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} } ], "trailingComments": [ { "type": "CommentBlock", "value": " Two ", - "start": 27, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 11 - } - } + "start":27,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":11}} }, { "type": "CommentBlock", "value": " Three ", - "start": 40, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 13 - } - } + "start":40,"end":51,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":13}} }, { "type": "CommentBlock", "value": " Four ", - "start": 54, - "end": 64, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 12 - } - } + "start":54,"end":64,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":12}} } ] } ], "source": { "type": "StringLiteral", - "start": 70, - "end": 75, - "loc": { - "start": { - "line": 5, - "column": 18 - }, - "end": { - "line": 5, - "column": 23 - } - }, + "start":70,"end":75,"loc":{"start":{"line":5,"column":18},"end":{"line":5,"column":23}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -190,66 +67,22 @@ { "type": "CommentBlock", "value": " One ", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 11 - } - } + "start":11,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}} }, { "type": "CommentBlock", "value": " Two ", - "start": 27, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 11 - } - } + "start":27,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":11}} }, { "type": "CommentBlock", "value": " Three ", - "start": 40, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 13 - } - } + "start":40,"end":51,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":13}} }, { "type": "CommentBlock", "value": " Four ", - "start": 54, - "end": 64, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 12 - } - } + "start":54,"end":64,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":12}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/output.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/output.json index d1f169eb76..ab2ca96011 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-flow/output.json @@ -1,99 +1,31 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ "SyntaxError: Unexpected keyword 'default' (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, "imported": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "default" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"default"}, "name": "default" }, "importKind": null, "local": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "default" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"default"}, "name": "default" } } @@ -101,18 +33,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/output.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/output.json index 62e2b40362..d4df45baef 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof-flow/output.json @@ -1,99 +1,31 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'typeof' (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "imported": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "typeof" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"typeof"}, "name": "typeof" }, "importKind": null, "local": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "typeof" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"typeof"}, "name": "typeof" } } @@ -101,18 +33,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/output.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/output.json index cd60a3c49f..95070d9dab 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword-typeof/output.json @@ -1,116 +1,37 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'typeof' (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "imported": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "typeof" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"typeof"}, "name": "typeof" }, "local": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "typeof" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"typeof"}, "name": "typeof" } } ], "source": { "type": "StringLiteral", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/output.json b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/output.json index 40242124c0..a627dce5e7 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/import-invalid-keyword/output.json @@ -1,116 +1,37 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "errors": [ "SyntaxError: Unexpected keyword 'debugger' (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "imported": { "type": "Identifier", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "debugger" - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"debugger"}, "name": "debugger" }, "local": { "type": "Identifier", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "debugger" - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"debugger"}, "name": "debugger" } } ], "source": { "type": "StringLiteral", - "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}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/es2015/modules/xml-comment-in-module/output.json b/packages/babel-parser/test/fixtures/es2015/modules/xml-comment-in-module/output.json index fa8998be64..3211da07b6 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/xml-comment-in-module/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/xml-comment-in-module/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "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" }, "operator": "<", "right": { "type": "UnaryExpression", - "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}}, "operator": "!", "prefix": true, "argument": { "type": "UpdateExpression", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "operator": "--", "prefix": true, "argument": { "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" } } diff --git a/packages/babel-parser/test/fixtures/es2015/modules/xml-comment-in-script/output.json b/packages/babel-parser/test/fixtures/es2015/modules/xml-comment-in-script/output.json index f9ebe10899..8f86ccd96e 100644 --- a/packages/babel-parser/test/fixtures/es2015/modules/xml-comment-in-script/output.json +++ b/packages/babel-parser/test/fixtures/es2015/modules/xml-comment-in-script/output.json @@ -1,81 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "trailingComments": [ { "type": "CommentLine", "value": "bar", - "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}} } ] } @@ -86,18 +30,7 @@ { "type": "CommentLine", "value": "bar", - "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}} } ] } \ No newline at end of file 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 b9fa1b56ec..2d66299daa 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 @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ "SyntaxError: Argument name clash (2:11)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":1,"end":21,"loc":{"start":{"line":1,"column":1},"end":{"line":3,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":7,"end":19,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}}, "method": true, "key": { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "bar" - }, + "start":7,"end":10,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -101,53 +34,18 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "a" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"a"}, "name": "a" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":17,"end":19,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/output.json b/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/output.json index 86ec306e13..3974236950 100644 --- a/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/output.json +++ b/packages/babel-parser/test/fixtures/es2015/regex/duplicate-flags/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Duplicate regular expression flag (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "RegExpLiteral", - "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}}, "extra": { "raw": "/./gii" }, diff --git a/packages/babel-parser/test/fixtures/es2015/regression/186/output.json b/packages/babel-parser/test/fixtures/es2015/regression/186/output.json index 5589443444..ca80235e39 100644 --- a/packages/babel-parser/test/fixtures/es2015/regression/186/output.json +++ b/packages/babel-parser/test/fixtures/es2015/regression/186/output.json @@ -1,144 +1,42 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":6,"end":22,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":10,"end":22,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectProperty", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "async" - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"async"}, "name": "async" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "async" - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"async"}, "name": "async" }, "extra": { @@ -147,53 +45,18 @@ }, { "type": "ObjectProperty", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "method": false, "key": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "bar" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"bar"}, "name": "bar" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "bar" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"bar"}, "name": "bar" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2015/regression/6864/output.json b/packages/babel-parser/test/fixtures/es2015/regression/6864/output.json index b9f3397438..6bd7cb71dd 100644 --- a/packages/babel-parser/test/fixtures/es2015/regression/6864/output.json +++ b/packages/babel-parser/test/fixtures/es2015/regression/6864/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":85,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":85,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":85,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "f" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"f"}, "name": "f" }, "generator": true, @@ -65,99 +20,31 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":14,"end":85,"loc":{"start":{"line":1,"column":14},"end":{"line":5,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":18,"end":33,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}}, "expression": { "type": "YieldExpression", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":19,"end":31,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":15}}, "delegate": false, "argument": { "type": "ArrowFunctionExpression", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":25,"end":31,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "a" - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"a"}, "name": "a" } ], "body": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "a" - }, + "start":30,"end":31,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"a"}, "name": "a" } }, @@ -169,84 +56,27 @@ }, { "type": "ExpressionStatement", - "start": 36, - "end": 57, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":36,"end":57,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":23}}, "expression": { "type": "YieldExpression", - "start": 37, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":37,"end":55,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":21}}, "delegate": false, "argument": { "type": "ArrowFunctionExpression", - "start": 43, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":43,"end":55,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":21}}, "id": null, "generator": false, "async": true, "params": [ { "type": "Identifier", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 16 - }, - "identifierName": "a" - }, + "start":49,"end":50,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":16},"identifierName":"a"}, "name": "a" } ], "body": { "type": "Identifier", - "start": 54, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 21 - }, - "identifierName": "a" - }, + "start":54,"end":55,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":21},"identifierName":"a"}, "name": "a" } }, @@ -258,84 +88,27 @@ }, { "type": "ExpressionStatement", - "start": 60, - "end": 83, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":60,"end":83,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":25}}, "expression": { "type": "YieldExpression", - "start": 61, - "end": 81, - "loc": { - "start": { - "line": 4, - "column": 3 - }, - "end": { - "line": 4, - "column": 23 - } - }, + "start":61,"end":81,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":23}}, "delegate": false, "argument": { "type": "ArrowFunctionExpression", - "start": 67, - "end": 81, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 23 - } - }, + "start":67,"end":81,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":23}}, "id": null, "generator": false, "async": true, "params": [ { "type": "Identifier", - "start": 74, - "end": 75, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 17 - }, - "identifierName": "a" - }, + "start":74,"end":75,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":17},"identifierName":"a"}, "name": "a" } ], "body": { "type": "Identifier", - "start": 80, - "end": 81, - "loc": { - "start": { - "line": 4, - "column": 22 - }, - "end": { - "line": 4, - "column": 23 - }, - "identifierName": "a" - }, + "start":80,"end":81,"loc":{"start":{"line":4,"column":22},"end":{"line":4,"column":23},"identifierName":"a"}, "name": "a" } }, diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/1/output.json b/packages/babel-parser/test/fixtures/es2015/shorthand/1/output.json index 712caaafe1..7514d1429f 100644 --- a/packages/babel-parser/test/fixtures/es2015/shorthand/1/output.json +++ b/packages/babel-parser/test/fixtures/es2015/shorthand/1/output.json @@ -1,147 +1,45 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'const' (1:11)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "ObjectExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "properties": [ { "type": "ObjectProperty", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "const" - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"const"}, "name": "const" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "const" - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"const"}, "name": "const" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2015/shorthand/2/output.json b/packages/babel-parser/test/fixtures/es2015/shorthand/2/output.json index c91daf2f66..4ca2311d88 100644 --- a/packages/babel-parser/test/fixtures/es2015/shorthand/2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/shorthand/2/output.json @@ -1,116 +1,37 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'this' (1:8)", "SyntaxError: Unexpected keyword 'if' (1:14)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":1,"end":18,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":18}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":3,"end":6,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":6}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "get" - }, + "start":3,"end":6,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":6},"identifierName":"get"}, "name": "get" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 3, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "get" - }, + "start":3,"end":6,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":6},"identifierName":"get"}, "name": "get" }, "extra": { @@ -119,53 +40,18 @@ }, { "type": "ObjectProperty", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "this" - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"this"}, "name": "this" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "this" - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"this"}, "name": "this" }, "extra": { @@ -174,53 +60,18 @@ }, { "type": "ObjectProperty", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "if" - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16},"identifierName":"if"}, "name": "if" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "if" - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16},"identifierName":"if"}, "name": "if" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json index b0dd4fe9c6..4c65f3b113 100644 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-const/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: Lexical declaration cannot appear in a single-statement context (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "body": { "type": "VariableDeclaration", - "start": 5, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":5,"end":22,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21}}, "id": { "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" }, "init": { "type": "NullLiteral", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21}} } } ], @@ -113,19 +35,7 @@ }, "label": { "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" } } diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/output.json index 31af7aa06c..4ceffd86de 100644 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/output.json +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-async/output.json @@ -1,80 +1,24 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ "SyntaxError: Async functions can only be declared at the top level or inside a block (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "body": { "type": "FunctionDeclaration", - "start": 5, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":5,"end":28,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "bar" - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23},"identifierName":"bar"}, "name": "bar" }, "generator": false, @@ -82,37 +26,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "body": [], "directives": [] } }, "label": { "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" } } diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/output.json index 5dd39402a9..f71d506d00 100644 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-invalid-func-generator/output.json @@ -1,80 +1,24 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ "SyntaxError: Generators can only be declared at the top level or inside a block (1:13)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "body": { "type": "FunctionDeclaration", - "start": 5, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":5,"end":23,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "bar" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"bar"}, "name": "bar" }, "generator": true, @@ -82,37 +26,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [], "directives": [] } }, "label": { "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" } } 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 782989ece4..47915b8c2b 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ "SyntaxError: In strict mode code, functions can only be declared at top level or inside a block (1:35)" ], "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -68,62 +23,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":15,"end":53,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":53}}, "body": [ { "type": "LabeledStatement", - "start": 30, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":30,"end":52,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":52}}, "body": { "type": "FunctionDeclaration", - "start": 35, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":35,"end":52,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":52}}, "id": { "type": "Identifier", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "baz" - }, + "start":44,"end":47,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":47},"identifierName":"baz"}, "name": "baz" }, "generator": false, @@ -131,37 +41,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 50, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":50,"end":52,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":52}}, "body": [], "directives": [] } }, "label": { "type": "Identifier", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "bar" - }, + "start":30,"end":33,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":33},"identifierName":"bar"}, "name": "bar" } } @@ -169,32 +56,10 @@ "directives": [ { "type": "Directive", - "start": 16, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":16,"end":29,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":29}}, "value": { "type": "DirectiveLiteral", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-valid-func-non-strict/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-valid-func-non-strict/output.json index faacd49298..9495944b51 100644 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-valid-func-non-strict/output.json +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-valid-func-non-strict/output.json @@ -1,77 +1,21 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "body": { "type": "FunctionDeclaration", - "start": 5, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":5,"end":22,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "bar" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"bar"}, "name": "bar" }, "generator": false, @@ -79,37 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } }, "label": { "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" } } diff --git a/packages/babel-parser/test/fixtures/es2015/statements/label-valid-var/output.json b/packages/babel-parser/test/fixtures/es2015/statements/label-valid-var/output.json index 65b268ccfc..309f477ad7 100644 --- a/packages/babel-parser/test/fixtures/es2015/statements/label-valid-var/output.json +++ b/packages/babel-parser/test/fixtures/es2015/statements/label-valid-var/output.json @@ -1,92 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "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}}, "body": { "type": "VariableDeclaration", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "bar" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"bar"}, "name": "bar" }, "init": null @@ -96,19 +29,7 @@ }, "label": { "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" } } 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 f3a6cff403..024e4088a0 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/1/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/1/output.json @@ -1,63 +1,19 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "value": { "type": "DirectiveLiteral", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "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}\"", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/10/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/10/output.json index 3ea62bea3f..234aaa5416 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/10/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/10/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 2, "raw": "0O2" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/105/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/105/output.json index ea40f2c7cc..676cf6fc08 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/105/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/105/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "t" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"t"}, "name": "t" }, "generator": true, @@ -65,18 +20,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/107/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/107/output.json index 6b99a2c67e..4f612f1705 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/107/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/107/output.json @@ -1,144 +1,41 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "await": false, "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "right": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "list" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 15, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":15,"end":26,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":26}}, "expression": { "type": "CallExpression", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":15,"end":25,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":25}}, "callee": { "type": "Identifier", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "process" - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/108/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/108/output.json index 737dba8a6e..487ebb8d25 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/108/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/108/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "await": false, "left": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "init": null @@ -97,82 +30,24 @@ }, "right": { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "list" - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "expression": { "type": "CallExpression", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "callee": { "type": "Identifier", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "process" - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "x" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json index 1bc3030963..a3d47c9c21 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/109/output.json @@ -1,112 +1,34 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: for-of loop variable declaration may not have an initializer (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "await": false, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":5,"end":15,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":15}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "extra": { "rawValue": 42, "raw": "42" @@ -119,82 +41,24 @@ }, "right": { "type": "Identifier", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "list" - }, + "start":19,"end":23,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":23},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 25, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":25,"end":36,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":36}}, "expression": { "type": "CallExpression", - "start": 25, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":25,"end":35,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":35}}, "callee": { "type": "Identifier", - "start": 25, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "process" - }, + "start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "x" - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/11/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/11/output.json index ab48cf7c9e..374e200bf6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/11/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/11/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 10, "raw": "0O12" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/110/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/110/output.json index 651a5c2d4e..b0a940cae6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/110/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/110/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "await": false, "left": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "init": null @@ -97,82 +30,24 @@ }, "right": { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "list" - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "expression": { "type": "CallExpression", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "callee": { "type": "Identifier", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "process" - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "x" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/111/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/111/output.json index dcd4ea525f..d4676622f8 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/111/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/111/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":4,"end":26,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":26}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "A" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"A"}, "name": "A" }, "init": { "type": "ClassExpression", - "start": 8, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":8,"end":26,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":26}}, "id": null, "superClass": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "B" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"B"}, "name": "B" }, "body": { "type": "ClassBody", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/112/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/112/output.json index b8e2a44c53..d535de3665 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/112/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/112/output.json @@ -1,144 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": { "type": "ClassExpression", - "start": 16, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":16,"end":36,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "B" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"B"}, "name": "B" }, "superClass": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "C" - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"C"}, "name": "C" }, "body": { "type": "ClassBody", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "body": [] } }, "body": { "type": "ClassBody", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":37,"end":39,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":39}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/113/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/113/output.json index 305d2691fc..76746368ca 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/113/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/113/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":8,"end":18,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":18}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "static": false, "key": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "get" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"get"}, "name": "get" }, "computed": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/114/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/114/output.json index 0c66d3d9d4..9b7fc3e24f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/114/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/114/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":8,"end":26,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":26}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":10,"end":25,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":25}}, "static": true, "key": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "get" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"get"}, "name": "get" }, "computed": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/115/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/115/output.json index 42b7e94f56..d714cbf30a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/115/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/115/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"B"}, "name": "B" }, "body": { "type": "ClassBody", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "body": [ { "type": "ClassMethod", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "static": false, "key": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "foo" - }, + "start":23,"end":26,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":26},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -132,18 +41,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/116/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/116/output.json index 50381b6fe9..de6fccf775 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/116/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/116/output.json @@ -1,127 +1,36 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"B"}, "name": "B" }, "body": { "type": "ClassBody", - "start": 18, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":18,"end":40,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":40}}, "body": [ { "type": "ClassMethod", - "start": 20, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":20,"end":39,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":39}}, "static": true, "key": { "type": "Identifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "foo" - }, + "start":31,"end":34,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":34},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -132,18 +41,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":37,"end":39,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":39}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/117/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/117/output.json index 9b82de2a14..981f70fabb 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/117/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/117/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":8,"end":21,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":21}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":9,"end":20,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":20}}, "static": false, "key": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -116,36 +37,13 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "v" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"v"}, "name": "v" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/118/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/118/output.json index 0fbb2f9cf4..e19c02232b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/118/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/118/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":8,"end":29,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":29}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":10,"end":28,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":28}}, "static": true, "key": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "a" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -116,36 +37,13 @@ "params": [ { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "v" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"v"}, "name": "v" } ], "body": { "type": "BlockStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/119/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/119/output.json index b05ad1e2e5..e86ffdd1b9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/119/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/119/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":8,"end":20,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":20}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "static": false, "key": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "set" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"set"}, "name": "set" }, "computed": false, @@ -116,36 +37,13 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "v" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"v"}, "name": "v" } ], "body": { "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/12/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/12/output.json index c252371102..3190f75a5f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/12/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/12/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0b0" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/120/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/120/output.json index ef265edfea..9ce643512b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/120/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/120/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":8,"end":28,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":28}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":10,"end":26,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":26}}, "static": true, "key": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "set" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"set"}, "name": "set" }, "computed": false, @@ -116,36 +37,13 @@ "params": [ { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "v" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"v"}, "name": "v" } ], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/121/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/121/output.json index 00ffd82596..ed60c0b1ec 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/121/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/121/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":8,"end":30,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":30}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":9,"end":29,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":29}}, "static": false, "kind": "method", "key": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "gen" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"gen"}, "name": "gen" }, "computed": false, @@ -116,81 +37,24 @@ "params": [ { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "v" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"v"}, "name": "v" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "expression": { "type": "YieldExpression", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}}, "delegate": false, "argument": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "v" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"v"}, "name": "v" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/122/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/122/output.json index 478423b1ad..0ee4c5a36b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/122/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/122/output.json @@ -1,112 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":8,"end":38,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":38}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":10,"end":37,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":37}}, "static": true, "kind": "method", "key": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "gen" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"gen"}, "name": "gen" }, "computed": false, @@ -116,81 +37,24 @@ "params": [ { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "v" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"v"}, "name": "v" } ], "body": { "type": "BlockStatement", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":25,"end":37,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":37}}, "body": [ { "type": "ExpressionStatement", - "start": 27, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":27,"end":35,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":35}}, "expression": { "type": "YieldExpression", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34}}, "delegate": false, "argument": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "v" - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"v"}, "name": "v" } } 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 fcaa1ad317..9bf15e6a3a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/123/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "errors": [ "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (1:40)" ], "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":14,"end":51,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":51}}, "expression": { "type": "ClassExpression", - "start": 15, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":15,"end":50,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":50}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "A" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 23, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":23,"end":50,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":50}}, "body": [ { "type": "ClassMethod", - "start": 24, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":24,"end":49,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":49}}, "static": false, "key": { "type": "Identifier", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "constructor" - }, + "start":24,"end":35,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":35},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -133,61 +43,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 38, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":38,"end":49,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":49}}, "body": [ { "type": "ExpressionStatement", - "start": 40, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":40,"end":47,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":47}}, "expression": { "type": "CallExpression", - "start": 40, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":40,"end":47,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":47}}, "callee": { "type": "Super", - "start": 40, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 45 - } - } + "start":40,"end":45,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":45}} }, "arguments": [] } @@ -208,32 +74,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/124/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/124/output.json index 8a4bd53524..edecd60c93 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/124/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/124/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":8,"end":28,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":28}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":9,"end":27,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":27}}, "static": false, "key": { "type": "StringLiteral", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "extra": { "rawValue": "constructor", "raw": "'constructor'" @@ -119,18 +41,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json index d4cca9c08a..2d6cbfab11 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/125/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ "SyntaxError: Duplicate constructor in the same class (1:27)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":8,"end":47,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":47}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":10,"end":26,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":26}}, "static": false, "key": { "type": "Identifier", - "start": 10, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "constructor" - }, + "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -119,51 +40,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 27, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":27,"end":45,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":45}}, "static": false, "key": { "type": "StringLiteral", - "start": 27, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":27,"end":40,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":40}}, "extra": { "rawValue": "constructor", "raw": "'constructor'" @@ -178,18 +66,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 43, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":43,"end":45,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":45}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json index 7a8ca4a874..ccd3aa3f3e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/126/output.json @@ -1,114 +1,35 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Class constructor may not be an accessor (1:14)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":8,"end":32,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":32}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":10,"end":30,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":30}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "constructor" - }, + "start":14,"end":25,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":25},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -119,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json index 8eb2f5bd2f..8650fd6a5d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/127/output.json @@ -1,115 +1,36 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Constructor can't be a generator (1:11)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":8,"end":29,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":29}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":27}}, "static": false, "kind": "method", "key": { "type": "Identifier", - "start": 11, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "constructor" - }, + "start":11,"end":22,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":22},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -119,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/128/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/128/output.json index b186e4ed4d..b203be1a09 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/128/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/128/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":8,"end":25,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":25}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}}, "static": true, "key": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "foo" - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/129/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/129/output.json index 2bd265802f..e6f1a12cab 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/129/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/129/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":8,"end":34,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":34}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "static": false, "key": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 18, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":18,"end":33,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":33}}, "static": true, "key": { "type": "Identifier", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "bar" - }, + "start":25,"end":28,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":28},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -172,18 +59,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/13/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/13/output.json index 4cf5cc60df..ce6d2c2cf9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/13/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/13/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 1, "raw": "0b1" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/131/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/131/output.json index 4a75920789..8710090194 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/131/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/131/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":8,"end":28,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":28}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":10,"end":18,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":18}}, "static": false, "key": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "static": false, "key": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "bar" - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -172,18 +59,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/132/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/132/output.json index fe2ecee740..9ff0fad861 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/132/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/132/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":8,"end":37,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":37}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":10,"end":22,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":22}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 23, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":23,"end":36,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":36}}, "static": false, "key": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "foo" - }, + "start":27,"end":30,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":30},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -172,36 +59,13 @@ "params": [ { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "v" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"v"}, "name": "v" } ], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/133/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/133/output.json index a100660798..fdc9d9a42d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/133/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/133/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":8,"end":43,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":43}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":10,"end":29,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":29}}, "static": true, "key": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "foo" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 30, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":30,"end":42,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":42}}, "static": false, "key": { "type": "Identifier", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "foo" - }, + "start":34,"end":37,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":37},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -172,18 +59,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":40,"end":42,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":42}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/134/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/134/output.json index c052ee5949..4dc864ad64 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/134/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/134/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":8,"end":51,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":51}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":10,"end":29,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":29}}, "static": true, "key": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "foo" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 30, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":30,"end":49,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":49}}, "static": true, "key": { "type": "Identifier", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "bar" - }, + "start":41,"end":44,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":44},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -172,18 +59,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 47, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":47,"end":49,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":49}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/135/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/135/output.json index 41cd92a652..5162de5b21 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/135/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/135/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 78 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":78}}, "program": { "type": "Program", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 78 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":78}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 78 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":78}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 78 - } - }, + "start":8,"end":78,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":78}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":10,"end":29,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":29}}, "static": true, "key": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "foo" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 30, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":30,"end":50,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":50}}, "static": true, "key": { "type": "Identifier", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "foo" - }, + "start":41,"end":44,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":44},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -172,70 +59,24 @@ "params": [ { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "v" - }, + "start":45,"end":46,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":46},"identifierName":"v"}, "name": "v" } ], "body": { "type": "BlockStatement", - "start": 48, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":48,"end":50,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":50}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 51, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":51,"end":63,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":63}}, "static": false, "key": { "type": "Identifier", - "start": 55, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 58 - }, - "identifierName": "foo" - }, + "start":55,"end":58,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":58},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -246,52 +87,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 61, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 61 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":61,"end":63,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":63}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 64, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 64 - }, - "end": { - "line": 1, - "column": 77 - } - }, + "start":64,"end":77,"loc":{"start":{"line":1,"column":64},"end":{"line":1,"column":77}}, "static": false, "key": { "type": "Identifier", - "start": 68, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 68 - }, - "end": { - "line": 1, - "column": 71 - }, - "identifierName": "foo" - }, + "start":68,"end":71,"loc":{"start":{"line":1,"column":68},"end":{"line":1,"column":71},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -302,36 +109,13 @@ "params": [ { "type": "Identifier", - "start": 72, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 72 - }, - "end": { - "line": 1, - "column": 73 - }, - "identifierName": "v" - }, + "start":72,"end":73,"loc":{"start":{"line":1,"column":72},"end":{"line":1,"column":73},"identifierName":"v"}, "name": "v" } ], "body": { "type": "BlockStatement", - "start": 75, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 75 - }, - "end": { - "line": 1, - "column": 77 - } - }, + "start":75,"end":77,"loc":{"start":{"line":1,"column":75},"end":{"line":1,"column":77}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/136/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/136/output.json index 8863ca591f..619d1cf63a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/136/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/136/output.json @@ -1,112 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":8,"end":29,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":29}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":27}}, "static": true, "computed": true, "key": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "foo" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"foo"}, "name": "foo" }, "kind": "method", @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/137/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/137/output.json index 4dccee7ed9..305175032f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/137/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/137/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":8,"end":33,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":33}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":10,"end":31,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":31}}, "static": true, "key": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"foo"}, "name": "foo" }, "computed": true, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/138/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/138/output.json index 0b980b14e0..1b2c1116b0 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/138/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/138/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":8,"end":38,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":38}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":10,"end":23,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":23}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -116,70 +37,24 @@ "params": [ { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "v" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"v"}, "name": "v" } ], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 24, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":24,"end":36,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":36}}, "static": false, "key": { "type": "Identifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "foo" - }, + "start":28,"end":31,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":31},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -190,18 +65,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/139/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/139/output.json index d81c5e5c95..4aefcee20c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/139/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/139/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":8,"end":33,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":33}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":10,"end":18,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":18}}, "static": false, "key": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "static": false, "key": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "foo" - }, + "start":23,"end":26,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":26},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -172,18 +59,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/14/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/14/output.json index 9a7364a78a..2b17ce385b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/14/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/14/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 2, "raw": "0b10" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/140/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/140/output.json index f32fb5ab8d..2e31b3da90 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/140/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/140/output.json @@ -1,80 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "Semicolon" - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15},"identifierName":"Semicolon"}, "name": "Semicolon" }, "superClass": null, "body": { "type": "ClassBody", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/141/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/141/output.json index 11e3e3f5c2..49f4e9d40f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/141/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/141/output.json @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "computed": true, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "x" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"x"}, "name": "x" }, "shorthand": false, "value": { "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": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/142/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/142/output.json index a85e52a061..ebd88cbcd6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/142/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/142/output.json @@ -1,107 +1,30 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":1,"end":18,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":18}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":2,"end":17,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":17}}, "method": false, "computed": true, "key": { "type": "BinaryExpression", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12}}, "left": { "type": "StringLiteral", - "start": 3, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":3,"end":6,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":6}}, "extra": { "rawValue": "x", "raw": "\"x\"" @@ -111,18 +34,7 @@ "operator": "+", "right": { "type": "StringLiteral", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "extra": { "rawValue": "y", "raw": "\"y\"" @@ -133,18 +45,7 @@ "shorthand": false, "value": { "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": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/143/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/143/output.json index d52f3bfa4c..a524c0e593 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/143/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/143/output.json @@ -1,129 +1,40 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":1,"end":21,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":21}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":2,"end":20,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":20}}, "method": false, "computed": true, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "x" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"x"}, "name": "x" }, "shorthand": false, "value": { "type": "FunctionExpression", - "start": 7, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":7,"end":20,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":20}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/144/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/144/output.json index 1d76139cb9..1806c83539 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/144/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/144/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":1,"end":17,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":17}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "computed": true, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "x" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"x"}, "name": "x" }, "shorthand": false, "value": { "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": 10, "raw": "10" @@ -115,52 +37,18 @@ }, { "type": "ObjectProperty", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "y" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "extra": { "rawValue": 20, "raw": "20" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/145/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/145/output.json index df29772846..6c28b86b54 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/145/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/145/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":1,"end":30,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":30}}, "properties": [ { "type": "ObjectMethod", - "start": 2, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":2,"end":14,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":14}}, "method": false, "key": { "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" }, "computed": true, @@ -98,52 +31,18 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } }, { "type": "ObjectMethod", - "start": 16, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":16,"end":29,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"x"}, "name": "x" }, "computed": true, @@ -154,36 +53,13 @@ "params": [ { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "v" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"v"}, "name": "v" } ], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/146/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/146/output.json index 7b3e26462d..ee51fe8a02 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/146/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/146/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, "properties": [ { "type": "ObjectMethod", - "start": 2, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":2,"end":10,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":10}}, "method": true, "computed": true, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "x" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"x"}, "name": "x" }, "kind": "method", @@ -98,18 +31,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/147/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/147/output.json index 7a5ceef8c8..5fce016d67 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/147/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/147/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":4,"end":18,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":18}}, "id": { "type": "ObjectPattern", - "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}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "computed": true, "key": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "shorthand": false, "value": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "y" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"y"}, "name": "y" } } @@ -129,68 +39,22 @@ }, "init": { "type": "ObjectExpression", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "properties": [ { "type": "ObjectProperty", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "method": false, "key": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "y" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "y" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"y"}, "name": "y" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/148/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/148/output.json index 59be505f04..6f72333a54 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/148/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/148/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,68 +20,22 @@ "params": [ { "type": "ObjectPattern", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19}}, "properties": [ { "type": "ObjectProperty", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}}, "method": false, "computed": true, "key": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"x"}, "name": "x" }, "shorthand": false, "value": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "y" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"y"}, "name": "y" } } @@ -135,18 +44,7 @@ ], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/149/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/149/output.json index b54c65ada2..6db491d5ac 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/149/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/149/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":4,"end":33,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "ObjectExpression", - "start": 8, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":8,"end":33,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":33}}, "properties": [ { "type": "ObjectMethod", - "start": 9, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":9,"end":32,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":32}}, "method": true, "computed": true, "key": { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "test" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"test"}, "name": "test" }, "kind": "method", @@ -130,63 +40,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "body": [ { "type": "ExpressionStatement", - "start": 21, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":21,"end":30,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":30}}, "expression": { "type": "YieldExpression", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "delegate": true, "argument": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "v" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"v"}, "name": "v" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/15/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/15/output.json index 33bb1b2a0a..c0f3390f5c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/15/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/15/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0B0" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/150/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/150/output.json index d7a927cede..58d5bb9a8b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/150/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/150/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":8,"end":18,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":18}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "static": false, "computed": true, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" }, "kind": "method", @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/152/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/152/output.json index 96cf9360b2..9466f0d309 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/152/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/152/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,81 +20,25 @@ "params": [ { "type": "AssignmentPattern", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20}}, "left": { "type": "ArrayPattern", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "elements": [ { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" } ] }, "right": { "type": "ArrayExpression", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "elements": [ { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 1, "raw": "1" @@ -152,18 +51,7 @@ ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/153/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/153/output.json index 60c6b34a66..9bf1d8cfb2 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/153/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/153/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,82 +20,25 @@ "params": [ { "type": "AssignmentPattern", - "start": 11, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":11,"end":24,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":24}}, "left": { "type": "ObjectPattern", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "properties": [ { "type": "ObjectProperty", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "method": false, "key": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" }, "extra": { @@ -151,67 +49,22 @@ }, "right": { "type": "ObjectExpression", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}}, "properties": [ { "type": "ObjectProperty", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "method": false, "key": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "extra": { "rawValue": 10, "raw": "10" @@ -225,18 +78,7 @@ ], "body": { "type": "BlockStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/154/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/154/output.json index c7da2eed48..a640ee0536 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/154/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/154/output.json @@ -1,176 +1,52 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "right": { "type": "FunctionExpression", - "start": 4, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":4,"end":30,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":30}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "left": { "type": "ObjectPattern", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" }, "extra": { @@ -181,67 +57,22 @@ }, "right": { "type": "ObjectExpression", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}}, "properties": [ { "type": "ObjectProperty", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25}}, "method": false, "key": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "extra": { "rawValue": 10, "raw": "10" @@ -255,18 +86,7 @@ ], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/155/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/155/output.json index 2154870b9e..cf8edbb06d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/155/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/155/output.json @@ -1,193 +1,58 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":1,"end":32,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":32}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":2,"end":31,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":31}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "f" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"f"}, "name": "f" }, "computed": false, "shorthand": false, "value": { "type": "FunctionExpression", - "start": 5, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":5,"end":31,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":31}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":14,"end":27,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":27}}, "left": { "type": "ObjectPattern", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "properties": [ { "type": "ObjectProperty", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "x" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "x" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"x"}, "name": "x" }, "extra": { @@ -198,67 +63,22 @@ }, "right": { "type": "ObjectExpression", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27}}, "properties": [ { "type": "ObjectProperty", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26}}, "method": false, "key": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "extra": { "rawValue": 10, "raw": "10" @@ -272,18 +92,7 @@ ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/156/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/156/output.json index 57250abd10..292d5f06f2 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/156/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/156/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":1,"end":22,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectMethod", - "start": 2, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":2,"end":21,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":21}}, "method": true, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "f" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"f"}, "name": "f" }, "computed": false, @@ -98,82 +31,25 @@ "params": [ { "type": "AssignmentPattern", - "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}}, "left": { "type": "ObjectPattern", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "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" }, "extra": { @@ -184,67 +60,22 @@ }, "right": { "type": "ObjectExpression", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "properties": [ { "type": "ObjectProperty", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "extra": { "rawValue": 10, "raw": "10" @@ -258,18 +89,7 @@ ], "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/157/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/157/output.json index 4754470968..ce79c1d30a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/157/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/157/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ClassExpression", - "start": 1, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":1,"end":28,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":28}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "start": 7, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":7,"end":28,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":28}}, "body": [ { "type": "ClassMethod", - "start": 8, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":8,"end":27,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":27}}, "static": false, "key": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "f" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"f"}, "name": "f" }, "computed": false, @@ -114,82 +36,25 @@ "params": [ { "type": "AssignmentPattern", - "start": 10, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":10,"end":23,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":23}}, "left": { "type": "ObjectPattern", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "properties": [ { "type": "ObjectProperty", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "extra": { @@ -200,67 +65,22 @@ }, "right": { "type": "ObjectExpression", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":16,"end":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23}}, "properties": [ { "type": "ObjectProperty", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "method": false, "key": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "extra": { "rawValue": 10, "raw": "10" @@ -274,18 +94,7 @@ ], "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/158/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/158/output.json index 60d196d478..38adf70772 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/158/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/158/output.json @@ -1,144 +1,43 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "ArrowFunctionExpression", - "start": 1, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":1,"end":22,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":22}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 2, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":2,"end":15,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":15}}, "left": { "type": "ObjectPattern", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "x" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "x" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"x"}, "name": "x" }, "extra": { @@ -149,67 +48,22 @@ }, "right": { "type": "ObjectExpression", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15}}, "properties": [ { "type": "ObjectProperty", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "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": 10, "raw": "10" @@ -223,18 +77,7 @@ ], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/159/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/159/output.json index 14f737f82b..9f560c227f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/159/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/159/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "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": "FunctionExpression", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18}}, "left": { "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" }, "right": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 1, "raw": "1" @@ -148,18 +47,7 @@ ], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/16/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/16/output.json index 39761f3e94..cba05164a5 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/16/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/16/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 1, "raw": "0B1" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/160/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/160/output.json index bd6597aab1..4e22aa2182 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/160/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/160/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,49 +20,15 @@ "params": [ { "type": "AssignmentPattern", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "left": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a" }, "right": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 1, "raw": "1" @@ -118,18 +39,7 @@ ], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/161/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/161/output.json index 9f5973150f..ecbb4f3faf 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/161/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/161/output.json @@ -1,192 +1,57 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "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": "ObjectExpression", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":6,"end":25,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":25}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "f" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"f"}, "name": "f" }, "computed": false, "shorthand": false, "value": { "type": "FunctionExpression", - "start": 9, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":9,"end":25,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":25}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "left": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "a" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"a"}, "name": "a" }, "right": { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "extra": { "rawValue": 1, "raw": "1" @@ -197,18 +62,7 @@ ], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/162/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/162/output.json index 7c18539ce4..f761e901a6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/162/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/162/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "method": true, "key": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "f" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"f"}, "name": "f" }, "computed": false, @@ -130,49 +40,15 @@ "params": [ { "type": "AssignmentPattern", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "left": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"a"}, "name": "a" }, "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": 1, "raw": "1" @@ -183,18 +59,7 @@ ], "body": { "type": "BlockStatement", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/163/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/163/output.json index 6d5be94768..572ab04a24 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/163/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/163/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,68 +20,22 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}}, "argument": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "b" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"b"}, "name": "b" } } ], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/164/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/164/output.json index b53938a9d7..e598fc11e1 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/164/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/164/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -65,51 +20,16 @@ "params": [ { "type": "ArrayPattern", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19}}, "elements": [ { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "b" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"b"}, "name": "b" } ] @@ -117,18 +37,7 @@ ], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/165/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/165/output.json index 8e80298537..b6aadc9694 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/165/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/165/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -65,68 +20,22 @@ "params": [ { "type": "ObjectPattern", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a" }, "extra": { @@ -135,53 +44,18 @@ }, { "type": "ObjectProperty", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "method": false, "key": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "b" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "b" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"b"}, "name": "b" }, "extra": { @@ -193,18 +67,7 @@ ], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } 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 62466668ed..e1a64571a1 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/166/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: Argument name clash (1:16)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -68,85 +23,27 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a" }, { "type": "ObjectPattern", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "properties": [ { "type": "ObjectProperty", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "method": false, "key": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a" }, "extra": { @@ -158,18 +55,7 @@ ], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/167/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/167/output.json index 593610a398..3432decb8b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/167/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/167/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -65,65 +20,19 @@ "params": [ { "type": "RestElement", - "start": 11, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":11,"end":22,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":22}}, "argument": { "type": "ArrayPattern", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":14,"end":22,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":22}}, "elements": [ { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "b" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"b"}, "name": "b" } ] @@ -132,18 +41,7 @@ ], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/168/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/168/output.json index fe88d43c2a..7e2ba23e76 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/168/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/168/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -65,117 +20,37 @@ "params": [ { "type": "ObjectPattern", - "start": 11, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":11,"end":37,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":37}}, "properties": [ { "type": "ObjectProperty", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24}}, "method": false, "key": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 16, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":16,"end":24,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":24}}, "properties": [ { "type": "ObjectProperty", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "method": false, "key": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "w" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"w"}, "name": "w" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "w" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"w"}, "name": "w" }, "extra": { @@ -184,53 +59,18 @@ }, { "type": "ObjectProperty", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}}, "method": false, "key": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"x"}, "name": "x" }, "extra": { @@ -242,85 +82,27 @@ }, { "type": "ObjectProperty", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":26,"end":35,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":35}}, "method": false, "key": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "b" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":29,"end":35,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":35}}, "elements": [ { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "y" - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"y"}, "name": "y" }, { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "z" - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"z"}, "name": "z" } ] @@ -330,82 +112,24 @@ }, { "type": "RestElement", - "start": 39, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":39,"end":51,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":51}}, "argument": { "type": "ArrayPattern", - "start": 42, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":42,"end":51,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":51}}, "elements": [ { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "a" - }, + "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "b" - }, + "start":46,"end":47,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":47},"identifierName":"b"}, "name": "b" }, { "type": "Identifier", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 50 - }, - "identifierName": "c" - }, + "start":49,"end":50,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":50},"identifierName":"c"}, "name": "c" } ] @@ -414,18 +138,7 @@ ], "body": { "type": "BlockStatement", - "start": 52, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":52,"end":54,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":54}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/169/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/169/output.json index c7d49e9dc5..23d5c77699 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/169/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/169/output.json @@ -1,77 +1,21 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":1,"end":23,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -79,51 +23,16 @@ "params": [ { "type": "ArrayPattern", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "elements": [ { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "a" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "b" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"b"}, "name": "b" } ] @@ -131,18 +40,7 @@ ], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/17/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/17/output.json index ea337678ef..db98ac55e2 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/17/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/17/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 2, "raw": "0B10" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/170/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/170/output.json index 55a821f842..4f05528597 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/170/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/170/output.json @@ -1,77 +1,21 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":1,"end":23,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -79,68 +23,22 @@ "params": [ { "type": "ObjectPattern", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "a" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "a" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"a"}, "name": "a" }, "extra": { @@ -149,53 +47,18 @@ }, { "type": "ObjectProperty", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "b" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "b" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"b"}, "name": "b" }, "extra": { @@ -207,18 +70,7 @@ ], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/171/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/171/output.json index 223612d502..bc538e5896 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/171/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/171/output.json @@ -1,77 +1,21 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":1,"end":26,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -79,65 +23,19 @@ "params": [ { "type": "RestElement", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":12,"end":23,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":23}}, "argument": { "type": "ArrayPattern", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "elements": [ { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "a" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "b" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"b"}, "name": "b" } ] @@ -146,18 +44,7 @@ ], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/172/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/172/output.json index ba67fbfd01..4c2b384fa3 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/172/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/172/output.json @@ -1,77 +1,21 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":1,"end":55,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":55}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -79,117 +23,37 @@ "params": [ { "type": "ObjectPattern", - "start": 12, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":12,"end":38,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":38}}, "properties": [ { "type": "ObjectProperty", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":14,"end":25,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":25}}, "method": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "a" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 17, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":17,"end":25,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":25}}, "properties": [ { "type": "ObjectProperty", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "w" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"w"}, "name": "w" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "w" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"w"}, "name": "w" }, "extra": { @@ -198,53 +62,18 @@ }, { "type": "ObjectProperty", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, "method": false, "key": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "x" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "x" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"x"}, "name": "x" }, "extra": { @@ -256,85 +85,27 @@ }, { "type": "ObjectProperty", - "start": 27, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":27,"end":36,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":36}}, "method": false, "key": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "b" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}}, "elements": [ { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "y" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"y"}, "name": "y" }, { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "z" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"z"}, "name": "z" } ] @@ -344,82 +115,24 @@ }, { "type": "RestElement", - "start": 40, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":40,"end":52,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":52}}, "argument": { "type": "ArrayPattern", - "start": 43, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":43,"end":52,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":52}}, "elements": [ { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "a" - }, + "start":44,"end":45,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":45},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "b" - }, + "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48},"identifierName":"b"}, "name": "b" }, { "type": "Identifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "c" - }, + "start":50,"end":51,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":51},"identifierName":"c"}, "name": "c" } ] @@ -428,18 +141,7 @@ ], "body": { "type": "BlockStatement", - "start": 53, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":53,"end":55,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":55}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/173/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/173/output.json index 27064ddfca..4dd0a32eff 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/173/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/173/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":1,"end":18,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":18}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":3,"end":16,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":16}}, "method": true, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "x" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -98,51 +31,16 @@ "params": [ { "type": "ArrayPattern", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}}, "elements": [ { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "b" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"b"}, "name": "b" } ] @@ -150,18 +48,7 @@ ], "body": { "type": "BlockStatement", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/174/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/174/output.json index 43133cf25b..e81ab2766a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/174/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/174/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":1,"end":21,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":21}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":3,"end":19,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":19}}, "method": true, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "x" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -98,65 +31,19 @@ "params": [ { "type": "RestElement", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}}, "argument": { "type": "ArrayPattern", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "elements": [ { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "b" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"b"}, "name": "b" } ] @@ -165,18 +52,7 @@ ], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/175/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/175/output.json index f88209a1ad..d9d68b9d01 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/175/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/175/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":1,"end":50,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":50}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":3,"end":48,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":48}}, "method": true, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "x" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -98,117 +31,37 @@ "params": [ { "type": "ObjectPattern", - "start": 5, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":5,"end":31,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":31}}, "properties": [ { "type": "ObjectProperty", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":10,"end":18,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":18}}, "properties": [ { "type": "ObjectProperty", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "method": false, "key": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "w" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"w"}, "name": "w" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "w" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"w"}, "name": "w" }, "extra": { @@ -217,53 +70,18 @@ }, { "type": "ObjectProperty", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "x" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "x" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"x"}, "name": "x" }, "extra": { @@ -275,85 +93,27 @@ }, { "type": "ObjectProperty", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":20,"end":29,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "b" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":23,"end":29,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":29}}, "elements": [ { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "y" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"y"}, "name": "y" }, { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "z" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"z"}, "name": "z" } ] @@ -363,82 +123,24 @@ }, { "type": "RestElement", - "start": 33, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":33,"end":45,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":45}}, "argument": { "type": "ArrayPattern", - "start": 36, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":36,"end":45,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":45}}, "elements": [ { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "a" - }, + "start":37,"end":38,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":38},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "b" - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"b"}, "name": "b" }, { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "c" - }, + "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44},"identifierName":"c"}, "name": "c" } ] @@ -447,18 +149,7 @@ ], "body": { "type": "BlockStatement", - "start": 46, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":46,"end":48,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":48}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/176/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/176/output.json index 348cddf040..4cfa553fc2 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/176/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/176/output.json @@ -1,113 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "RestElement", - "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}}, "argument": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" } } ], "body": { "type": "BlockStatement", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/177/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/177/output.json index 1a388a201f..9225b9f7ca 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/177/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/177/output.json @@ -1,130 +1,40 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "argument": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "b" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" } } ], "body": { "type": "BlockStatement", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/178/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/178/output.json index 6163701c23..925f80444d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/178/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/178/output.json @@ -1,130 +1,40 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "a" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "a" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, "name": "a" }, "extra": { @@ -136,18 +46,7 @@ ], "body": { "type": "BlockStatement", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/179/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/179/output.json index a2d079fcb4..c3abc460e5 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/179/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/179/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "a" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "a" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, "name": "a" }, "extra": { @@ -135,51 +45,17 @@ }, { "type": "RestElement", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "argument": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "b" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"b"}, "name": "b" } } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/18/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/18/output.json index 1709e7f7be..29c7dc50af 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/18/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/18/output.json @@ -1,78 +1,23 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "value": { "raw": "42", "cooked": "42" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/180/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/180/output.json index 990ec4b163..9a07655203 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/180/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/180/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "RestElement", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, "argument": { "type": "ArrayPattern", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "elements": [ { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "b" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"b"}, "name": "b" } ] @@ -130,18 +40,7 @@ ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/181/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/181/output.json index 1836eebfe4..9c2a505e9a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/181/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/181/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "argument": { "type": "ArrayPattern", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "elements": [ { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "b" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"b"}, "name": "b" } ] @@ -130,18 +40,7 @@ ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/182/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/182/output.json index 95c3a50ee4..d8d3880a87 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/182/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/182/output.json @@ -1,162 +1,49 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 1, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":1,"end":14,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":14}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "a" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "elements": [ { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "b" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"b"}, "name": "b" } ] @@ -166,51 +53,17 @@ }, { "type": "RestElement", - "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}}, "argument": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "c" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"c"}, "name": "c" } } ], "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/183/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/183/output.json index 0edcc63a30..3a98d3e003 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/183/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/183/output.json @@ -1,182 +1,57 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 1, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":3,"end":7,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":7}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "a" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "b" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"b"}, "name": "b" } }, { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "c" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "c" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"c"}, "name": "c" }, "extra": { @@ -187,102 +62,33 @@ }, { "type": "ArrayPattern", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}}, "elements": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "d" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"d"}, "name": "d" }, { "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" } ] }, { "type": "RestElement", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":22,"end":26,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":26}}, "argument": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "f" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"f"}, "name": "f" } } ], "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/184/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/184/output.json index c1d861aac7..6f95d14f2e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/184/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/184/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "RestElement", - "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}}, "argument": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" } } @@ -109,19 +31,7 @@ }, "right": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "b" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"b"}, "name": "b" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/185/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/185/output.json index 8f828764a3..7bc14d3a64 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/185/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/185/output.json @@ -1,124 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "argument": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "b" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" } } @@ -126,19 +36,7 @@ }, "right": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "c" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"c"}, "name": "c" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/186/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/186/output.json index 2165bb6ae2..13b1c5aa3a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/186/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/186/output.json @@ -1,142 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "ObjectPattern", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "a" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "a" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, "name": "a" }, "extra": { @@ -145,53 +44,18 @@ }, { "type": "ObjectProperty", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "b" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "b" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"b"}, "name": "b" }, "extra": { @@ -202,33 +66,10 @@ }, { "type": "RestElement", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15}}, "argument": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "c" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"c"}, "name": "c" } } @@ -236,19 +77,7 @@ }, "right": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "d" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"d"}, "name": "d" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/187/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/187/output.json index 26fa067202..b92de7b87d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/187/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/187/output.json @@ -1,156 +1,43 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "operator": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "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}}, "argument": { "type": "ArrayPattern", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "elements": [ { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "b" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"b"}, "name": "b" }, { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "c" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"c"}, "name": "c" } ] @@ -160,19 +47,7 @@ }, "right": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "d" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"d"}, "name": "d" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/188/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/188/output.json index af971d4820..76262d6071 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/188/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/188/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "ArrayPattern", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "elements": [ { "type": "RestElement", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "argument": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"a"}, "name": "a" } } @@ -109,19 +31,7 @@ }, "init": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "b" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"b"}, "name": "b" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/189/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/189/output.json index 1d8b8c0836..f7d82279e8 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/189/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/189/output.json @@ -1,124 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "argument": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "b" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"b"}, "name": "b" } } @@ -126,19 +36,7 @@ }, "init": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "c" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"c"}, "name": "c" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/19/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/19/output.json index 9ea44c8e0c..afff23398c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/19/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/19/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "raw" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"raw"}, "name": "raw" }, "quasi": { "type": "TemplateLiteral", - "start": 3, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":3,"end":7,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":7}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "42", "cooked": "42" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/190/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/190/output.json index 51ab81d965..99fd55d344 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/190/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/190/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24}}, "id": { "type": "ArrayPattern", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20}}, "elements": [ { "type": "ObjectPattern", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, "extra": { @@ -145,53 +44,18 @@ }, { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "b" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "b" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"b"}, "name": "b" }, "extra": { @@ -202,33 +66,10 @@ }, { "type": "RestElement", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19}}, "argument": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "c" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"c"}, "name": "c" } } @@ -236,19 +77,7 @@ }, "init": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "d" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"d"}, "name": "d" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/192/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/192/output.json index d0824afb0c..48f8c8c021 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/192/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/192/output.json @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "func" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"func"}, "name": "func" }, "arguments": [ { "type": "SpreadElement", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "argument": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"a"}, "name": "a" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/193/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/193/output.json index aad9532c57..fb33ef71f8 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/193/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/193/output.json @@ -1,126 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "func" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"func"}, "name": "func" }, "arguments": [ { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, { "type": "SpreadElement", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "argument": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "b" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"b"}, "name": "b" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/194/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/194/output.json index baffe722f9..a126e05e6c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/194/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/194/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "func" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"func"}, "name": "func" }, "arguments": [ { "type": "SpreadElement", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "argument": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"a"}, "name": "a" } }, { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "b" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"b"}, "name": "b" } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/195/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/195/output.json index 367d87eb14..3ecd5ce679 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/195/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/195/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "RegExpLiteral", - "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}}, "extra": { "raw": "/[a-z]/u" }, diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/196/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/196/output.json index 2c839b2044..5a84a2b4e0 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/196/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/196/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "expression": { "type": "RegExpLiteral", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "extra": { "raw": "/[\\uD834\\uDF06-\\uD834\\uDF08a-z]/u" }, diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/197/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/197/output.json index cc0833f45c..4d24a6690e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/197/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/197/output.json @@ -1,125 +1,36 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "DoWhileStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "body": { "type": "BlockStatement", - "start": 3, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":3,"end":5,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":5}}, "body": [], "directives": [] }, "test": { "type": "BooleanLiteral", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18}}, "value": false } }, { "type": "ExpressionStatement", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26}}, "expression": { "type": "CallExpression", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25}}, "callee": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json index 12a024fb2c..a880531bce 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/198/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 8 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": null, "raw": "0o" 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 609d518854..ba8837d8ed 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/2/output.json @@ -1,63 +1,19 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "value": { "type": "DirectiveLiteral", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "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}\"", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/20/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/20/output.json index a036ba998f..d54c1eadf6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/20/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/20/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "tag": { "type": "Identifier", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "raw" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"raw"}, "name": "raw" }, "quasi": { "type": "TemplateLiteral", - "start": 3, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":3,"end":18,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":18}}, "expressions": [ { "type": "Identifier", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "name" - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16},"identifierName":"name"}, "name": "name" } ], "quasis": [ { "type": "TemplateElement", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "value": { "raw": "hello ", "cooked": "hello " @@ -130,18 +40,7 @@ }, { "type": "TemplateElement", - "start": 17, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":17,"end":17,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":17}}, "value": { "raw": "", "cooked": "" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json index 4b91f320f9..42696d4924 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/200/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 8 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0o9" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json index 9978c5342e..9ed93409bc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/201/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Expected number in radix 8 (1:3)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 8, "raw": "0o18" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json index 5d2ed2d913..91dec1a230 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/202/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 8 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": null, "raw": "0O" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json index af4105738e..2fbc3ece31 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/204/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 8 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0O9" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json index 617cc13b66..4978bcf4e5 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/205/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Expected number in radix 8 (1:3)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 8, "raw": "0O18" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json index 0688a297c6..bd3bd49916 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/206/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": null, "raw": "0b" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json index 7281fb745a..fabbead514 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/208/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0b9" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json index 25d711669b..c90afe1734 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/209/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:3)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 2, "raw": "0b18" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/21/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/21/output.json index 4e9b217cb0..9b2b86cb1b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/21/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/21/output.json @@ -1,78 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "$", "cooked": "$" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json index 379e9db894..2b8e4f22be 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/210/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:3)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 2, "raw": "0b12" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json index c87719ade9..6cfde9edb3 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/211/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": null, "raw": "0B" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json index e82ab6ace6..6e3728ace3 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/213/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0B9" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json index 3726afdc10..d5ba308d59 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/214/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:3)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 2, "raw": "0B18" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json index 402fcffc9e..af38f05f89 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/215/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:3)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 2, "raw": "0B12" 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 6052cbe571..8169a28310 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/217/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Bad character escape sequence (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\u{}", "extra": { "raw": "\"\\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 781e807d0c..a5b7bb95f3 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/218/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Bad character escape sequence (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\u{FFFF", "extra": { "raw": "\"\\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 fcf4254c7a..5c0123d27a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/219/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Bad character escape sequence (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\u{FFZ}", "extra": { "raw": "\"\\u{FFZ}\"", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/22/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/22/output.json index 0dff1ff533..af22fdb927 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/22/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/22/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":1,"end":21,"loc":{"start":{"line":1,"column":1},"end":{"line":3,"column":4}}, "value": { - "raw": "\\n\\r\\b\\v\\t\\f\\\n\\\n\\\u2028\\\u2029", + "raw": "\\n\\r\\b\\v\\t\\f\\\n\\\n\\
\\
", "cooked": "\n\r\b\u000b\t\f" }, "tail": true @@ -85,4 +30,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json index 51d6338029..146edec02c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/220/output.json @@ -1,115 +1,36 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "+=", "left": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "v" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"v"}, "name": "v" } ] }, "right": { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "ary" - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"ary"}, "name": "ary" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json index 58fa4ffd7f..6e2bf85797 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/221/output.json @@ -1,95 +1,29 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in array destructuring pattern (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrayPattern", - "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}}, "elements": [ { "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": 2, "raw": "2" @@ -100,18 +34,7 @@ }, "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/fixtures/es2015/uncategorised/222/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json index e758dffee7..c220984197 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/222/output.json @@ -1,129 +1,40 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in object destructuring pattern (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":1,"end":16,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":16}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 1, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":3,"end":9,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":9}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "obj" - }, + "start":3,"end":6,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":6},"identifierName":"obj"}, "name": "obj" }, "computed": false, "shorthand": false, "value": { "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": 20, "raw": "20" @@ -135,18 +46,7 @@ }, "right": { "type": "NumericLiteral", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "extra": { "rawValue": 42, "raw": "42" 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 d5fe95dd82..475564c668 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/223/output.json @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Object pattern can't contain getter or setter (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":1,"end":19,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":19}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 1, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":1,"end":15,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":15}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":3,"end":13,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":13}}, "method": false, "key": { "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" }, "computed": false, @@ -116,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "body": [], "directives": [] } @@ -136,18 +47,7 @@ }, "right": { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json index c725f1875b..dfaa426ceb 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/226/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'default' (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "default" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"default"}, "name": "default" }, "generator": false, @@ -68,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } 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 2a794ddc88..ddf1b38b6a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/227/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:44)" ], "program": { "type": "Program", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,96 +23,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":17,"end":59,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":59}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":32,"end":57,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":57}}, "expression": { "type": "ObjectExpression", - "start": 33, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":33,"end":55,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":55}}, "properties": [ { "type": "ObjectProperty", - "start": 35, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":35,"end":40,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":40}}, "method": false, "key": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "i" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"i"}, "name": "i" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":38,"end":40,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":40}}, "extra": { "rawValue": 10, "raw": "10" @@ -167,34 +55,11 @@ }, { "type": "ObjectMethod", - "start": 42, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":42,"end":53,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":53}}, "method": true, "key": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "s" - }, + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"s"}, "name": "s" }, "computed": false, @@ -205,36 +70,13 @@ "params": [ { "type": "Identifier", - "start": 44, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "eval" - }, + "start":44,"end":48,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":48},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 50, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":50,"end":53,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":53}}, "body": [], "directives": [] } @@ -250,32 +92,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 73e7c59a8b..54c4857321 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/228/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ "SyntaxError: Argument name clash (1:37)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,78 +23,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":13,"end":49,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":49}}, "body": [ { "type": "ExpressionStatement", - "start": 29, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":29,"end":47,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":47}}, "expression": { "type": "ObjectExpression", - "start": 30, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":30,"end":45,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":45}}, "properties": [ { "type": "ObjectMethod", - "start": 32, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":32,"end":43,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":43}}, "method": true, "key": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "b" - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"b"}, "name": "b" }, "computed": false, @@ -150,53 +49,18 @@ "params": [ { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "t" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"t"}, "name": "t" }, { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "t" - }, + "start":37,"end":38,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":38},"identifierName":"t"}, "name": "t" } ], "body": { "type": "BlockStatement", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":40,"end":43,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":43}}, "body": [], "directives": [] } @@ -212,32 +76,10 @@ "directives": [ { "type": "Directive", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "value": { "type": "DirectiveLiteral", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json index c129c3fce1..d30f2d17c2 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/229/output.json @@ -1,81 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'super' (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "super" - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9},"identifierName":"super"}, "name": "super" }, "init": null diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/23/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/23/output.json index df40feaba7..29d1067d3f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/23/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/23/output.json @@ -1,78 +1,23 @@ { "type": "File", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 4, - "column": 0 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":4,"column":0}}, "value": { "raw": "\n\n\n", "cooked": "\n\n\n" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json index e901e11e94..1a676c59c0 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/230/output.json @@ -1,81 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'default' (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "default" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"default"}, "name": "default" }, "init": null diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json index 635346ad81..0e0111a35a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/231/output.json @@ -1,81 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'default' (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "default" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"default"}, "name": "default" }, "init": null diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json index 760cb15ffd..154ac5251e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/232/output.json @@ -1,97 +1,30 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'default' (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, "id": { "type": "Identifier", - "start": 6, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "default" - }, + "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13},"identifierName":"default"}, "name": "default" }, "init": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 2, "raw": "2" 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 bd58e38aa1..115652eea1 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/233/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ "SyntaxError: Assigning to 'eval' in strict mode (1:20)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":14,"end":33,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":33}}, "expression": { "type": "AssignmentExpression", - "start": 15, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":15,"end":32,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":32}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 15, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":15,"end":26,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":26}}, "properties": [ { "type": "ObjectProperty", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}}, "method": false, "key": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "v" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"v"}, "name": "v" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 20, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "eval" - }, + "start":20,"end":24,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":24},"identifierName":"eval"}, "name": "eval" } } @@ -132,19 +42,7 @@ }, "right": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "obj" - }, + "start":29,"end":32,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":32},"identifierName":"obj"}, "name": "obj" }, "extra": { @@ -157,32 +55,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 60d3496c86..5521e0e9a3 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/234/output.json @@ -1,130 +1,40 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'arguments' in strict mode (1:20)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":14,"end":38,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":38}}, "expression": { "type": "AssignmentExpression", - "start": 15, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":15,"end":37,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":37}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 15, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":15,"end":31,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":31}}, "properties": [ { "type": "ObjectProperty", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "v" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"v"}, "name": "v" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "arguments" - }, + "start":20,"end":29,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":29},"identifierName":"arguments"}, "name": "arguments" } } @@ -132,19 +42,7 @@ }, "right": { "type": "Identifier", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "obj" - }, + "start":34,"end":37,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":37},"identifierName":"obj"}, "name": "obj" }, "extra": { @@ -157,32 +55,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json index f42607bf08..ae24a82b74 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/235/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":5,"end":15,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":15}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "extra": { "rawValue": 42, "raw": "42" @@ -118,82 +40,24 @@ }, "right": { "type": "Identifier", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "list" - }, + "start":19,"end":23,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":23},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 25, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":25,"end":36,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":36}}, "expression": { "type": "CallExpression", - "start": 25, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":25,"end":35,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":35}}, "callee": { "type": "Identifier", - "start": 25, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "process" - }, + "start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "x" - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json index 1679566d43..70e5c2df0d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/236/output.json @@ -1,112 +1,34 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: for-of loop variable declaration may not have an initializer (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "await": false, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":5,"end":15,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":15}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "extra": { "rawValue": 42, "raw": "42" @@ -119,82 +41,24 @@ }, "right": { "type": "Identifier", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "list" - }, + "start":19,"end":23,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":23},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 25, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":25,"end":36,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":36}}, "expression": { "type": "CallExpression", - "start": 25, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":25,"end":35,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":35}}, "callee": { "type": "Identifier", - "start": 25, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "process" - }, + "start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "x" - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/24/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/24/output.json index 47aff076cf..5a206c9a3c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/24/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/24/output.json @@ -1,78 +1,23 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":1,"end":25,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":25}}, "value": { "raw": "\\u{000042}\\u0042\\x42u0\\A", "cooked": "BBBu0A" 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 3731ec6d7b..cca401d0d1 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/242/output.json @@ -1,115 +1,37 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "errors": [ "SyntaxError: Assigning to 'eval' in strict mode (1:15)", "SyntaxError: Binding 'eval' in strict mode (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":14,"end":31,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":31}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":14,"end":31,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":31}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24}}, "left": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "eval" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"eval"}, "name": "eval" }, "right": { "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": 10, "raw": "10" @@ -120,18 +42,7 @@ ], "body": { "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": 42, "raw": "42" @@ -144,32 +55,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 dbffe6547a..8e8d8419af 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/243/output.json @@ -1,101 +1,34 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:14)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":14,"end":24,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":24}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":14,"end":24,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":24}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "eval" - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"eval"}, "name": "eval" } ], "body": { "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": 42, "raw": "42" @@ -108,32 +41,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 1b3ed15f00..5a18ea14d8 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/244/output.json @@ -1,101 +1,34 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:14)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "arguments" - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23},"identifierName":"arguments"}, "name": "arguments" } ], "body": { "type": "NumericLiteral", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "extra": { "rawValue": 42, "raw": "42" @@ -108,32 +41,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 6b7ae83c0a..c5a150d343 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/245/output.json @@ -1,118 +1,39 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:15)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "eval" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"eval"}, "name": "eval" }, { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "a" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"a"}, "name": "a" } ], "body": { "type": "NumericLiteral", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "extra": { "rawValue": 42, "raw": "42" @@ -125,32 +46,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 c681755fb1..402704e9de 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/246/output.json @@ -1,118 +1,39 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":14,"end":34,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":34}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":14,"end":34,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":34}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "arguments" - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24},"identifierName":"arguments"}, "name": "arguments" }, { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "a" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"a"}, "name": "a" } ], "body": { "type": "NumericLiteral", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "extra": { "rawValue": 42, "raw": "42" @@ -125,32 +46,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 b8b375182e..db4f4a90fe 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/247/output.json @@ -1,131 +1,41 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":14,"end":34,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":34}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":14,"end":34,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":34}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "eval" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"eval"}, "name": "eval" }, { "type": "AssignmentPattern", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}}, "left": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "a" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"a"}, "name": "a" }, "right": { "type": "NumericLiteral", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "extra": { "rawValue": 10, "raw": "10" @@ -136,18 +46,7 @@ ], "body": { "type": "NumericLiteral", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "extra": { "rawValue": 42, "raw": "42" @@ -160,32 +59,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 3a5f60bddd..e552560189 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/248/output.json @@ -1,118 +1,39 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ "SyntaxError: Argument name clash (1:18)" ], "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "a" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"a"}, "name": "a" } ], "body": { "type": "NumericLiteral", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "extra": { "rawValue": 42, "raw": "42" @@ -125,32 +46,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 18c0889f74..70812a59cc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/249/output.json @@ -1,101 +1,34 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:21)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a" } ], "body": { "type": "NumericLiteral", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "extra": { "rawValue": 0, "raw": "00" @@ -108,32 +41,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/25/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/25/output.json index 646a2349df..0189e907f5 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/25/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/25/output.json @@ -1,123 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "raw" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"raw"}, "name": "raw" }, "quasi": { "type": "TemplateLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "value": { "raw": "42", "cooked": "42" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json index a7c444dfbc..6b624a3ee4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/251/output.json @@ -1,83 +1,28 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "NumericLiteral", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "extra": { "rawValue": 10, "raw": "10" @@ -87,18 +32,7 @@ ], "body": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": 0, "raw": "00" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json index 2d80f047d2..06d87dffa4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/252/output.json @@ -1,84 +1,29 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)", "SyntaxError: Binding invalid left-hand side in function parameter list (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "NumericLiteral", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "extra": { "rawValue": 10, "raw": "10" @@ -87,18 +32,7 @@ }, { "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": 20, "raw": "20" @@ -108,18 +42,7 @@ ], "body": { "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": 0, "raw": "00" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/26/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/26/output.json index 09b757b7e0..07eb105001 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/26/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/26/output.json @@ -1,175 +1,52 @@ { "type": "File", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 70 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":70}}, "program": { "type": "Program", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 70 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":70}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 70 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":70}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 70 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":70}}, "expressions": [ { "type": "ObjectExpression", - "start": 8, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":8,"end":20,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19}}, "method": false, "key": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "ObjectExpression", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19}}, "properties": [ { "type": "ObjectProperty", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18}}, "method": false, "key": { "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" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "extra": { "rawValue": 10, "raw": "10" @@ -184,80 +61,25 @@ }, { "type": "TemplateLiteral", - "start": 26, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":26,"end":65,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":65}}, "expressions": [ { "type": "FunctionExpression", - "start": 35, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":35,"end":56,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":56}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 45, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":45,"end":56,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":56}}, "body": [ { "type": "ReturnStatement", - "start": 46, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":46,"end":55,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":55}}, "argument": { "type": "NumericLiteral", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":53,"end":54,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":54}}, "extra": { "rawValue": 1, "raw": "1" @@ -273,18 +95,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":27,"end":33,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":33}}, "value": { "raw": "nested", "cooked": "nested" @@ -293,18 +104,7 @@ }, { "type": "TemplateElement", - "start": 57, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":57,"end":64,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":64}}, "value": { "raw": "endnest", "cooked": "endnest" @@ -317,18 +117,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "value": { "raw": "outer", "cooked": "outer" @@ -337,18 +126,7 @@ }, { "type": "TemplateElement", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24}}, "value": { "raw": "bar", "cooked": "bar" @@ -357,18 +135,7 @@ }, { "type": "TemplateElement", - "start": 66, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 66 - }, - "end": { - "line": 1, - "column": 69 - } - }, + "start":66,"end":69,"loc":{"start":{"line":1,"column":66},"end":{"line":1,"column":69}}, "value": { "raw": "end", "cooked": "end" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/27/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/27/output.json index 0d2a9ed4dc..4af86db4bc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/27/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/27/output.json @@ -1,141 +1,40 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "discriminant": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "answer" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"answer"}, "name": "answer" }, "cases": [ { "type": "SwitchCase", - "start": 18, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":18,"end":45,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":45}}, "consequent": [ { "type": "VariableDeclaration", - "start": 27, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":27,"end":38,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":38}}, "declarations": [ { "type": "VariableDeclarator", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":31,"end":37,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "t" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"t"}, "name": "t" }, "init": { "type": "NumericLiteral", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":35,"end":37,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":37}}, "extra": { "rawValue": 42, "raw": "42" @@ -148,35 +47,13 @@ }, { "type": "BreakStatement", - "start": 39, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":39,"end":45,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":45}}, "label": null } ], "test": { "type": "NumericLiteral", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/279/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/279/output.json index 081fe15730..cfcf370f5c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/279/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/279/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -65,82 +20,25 @@ "params": [ { "type": "RestElement", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19}}, "argument": { "type": "ObjectPattern", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "properties": [ { "type": "ObjectProperty", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "method": false, "key": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a" }, "extra": { @@ -153,18 +51,7 @@ ], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/28/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/28/output.json index c59ac797ad..c14b141b09 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/28/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/28/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "StringLiteral", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "extra": { "rawValue": "test", "raw": "\"test\"" 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 299c0dabda..bdb2864372 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/280/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Argument name clash (1:30)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":14,"end":36,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -68,85 +23,27 @@ "params": [ { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "a" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"a"}, "name": "a" }, { "type": "ObjectPattern", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33}}, "properties": [ { "type": "ObjectProperty", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31}}, "method": false, "key": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "a" - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "a" - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"a"}, "name": "a" }, "extra": { @@ -158,18 +55,7 @@ ], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "body": [], "directives": [] } @@ -178,32 +64,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 50b6eca3fd..f2543aba97 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/281/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "errors": [ "SyntaxError: Argument name clash (1:47)" ], "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":14,"end":56,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":56}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -68,117 +23,37 @@ "params": [ { "type": "ObjectPattern", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":25,"end":37,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":37}}, "properties": [ { "type": "ObjectProperty", - "start": 27, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":27,"end":35,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":35}}, "method": false, "key": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "b" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35}}, "properties": [ { "type": "ObjectProperty", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33}}, "method": false, "key": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "a" - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "a" - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"a"}, "name": "a" }, "extra": { @@ -192,132 +67,41 @@ }, { "type": "ArrayPattern", - "start": 39, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":39,"end":53,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":53}}, "elements": [ { "type": "ObjectPattern", - "start": 40, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":40,"end":52,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":52}}, "properties": [ { "type": "ObjectProperty", - "start": 42, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":42,"end":50,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":50}}, "method": false, "key": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "b" - }, + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 45, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":45,"end":50,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":50}}, "properties": [ { "type": "ObjectProperty", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48}}, "method": false, "key": { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "a" - }, + "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "a" - }, + "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48},"identifierName":"a"}, "name": "a" }, "extra": { @@ -334,18 +118,7 @@ ], "body": { "type": "BlockStatement", - "start": 54, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":54,"end":56,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":56}}, "body": [], "directives": [] } @@ -354,32 +127,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json index 68f6ccb7ce..dba83d09de 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/284/output.json @@ -1,98 +1,32 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding invalid left-hand side in array destructuring pattern (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ArrayPattern", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "elements": [ { "type": "NumericLiteral", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4}}, "extra": { "rawValue": 5, "raw": "5" @@ -104,18 +38,7 @@ ], "body": { "type": "BlockStatement", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/287/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/287/output.json index 1c442ac1c6..b10e8612e2 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/287/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/287/output.json @@ -1,156 +1,44 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrayPattern", - "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}}, "elements": [ { "type": "RestElement", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "argument": { "type": "ObjectPattern", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "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" }, "extra": { @@ -164,19 +52,7 @@ }, "right": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "b" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"b"}, "name": "b" } } 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 db0bdfa541..38f67c2463 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/289/output.json @@ -1,96 +1,29 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":1,"end":30,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":30}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":3,"end":28,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":28}}, "method": true, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "t" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"t"}, "name": "t" }, "computed": false, @@ -101,66 +34,21 @@ "params": [ { "type": "Identifier", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "eval" - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 11, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":11,"end":28,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":28}}, "body": [], "directives": [ { "type": "Directive", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "value": { "type": "DirectiveLiteral", - "start": 13, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":13,"end":25,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":25}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/29/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/29/output.json index 728dfb4051..9618fdfb2c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/29/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/29/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "e" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"e"}, "name": "e" } ], "body": { "type": "StringLiteral", - "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}}, "extra": { "rawValue": "test", "raw": "\"test\"" 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 34fe89ec4c..2eb9655675 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/290/output.json @@ -1,99 +1,32 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:23)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":14,"end":27,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":27}}, "expression": { "type": "TemplateLiteral", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "expressions": [ { "type": "Identifier", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "test" - }, + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21},"identifierName":"test"}, "name": "test" } ], "quasis": [ { "type": "TemplateElement", - "start": 15, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":15,"end":15,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":15}}, "value": { "raw": "", "cooked": "" @@ -102,18 +35,7 @@ }, { "type": "TemplateElement", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "value": { "raw": "\\02", "cooked": null @@ -127,32 +49,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json index 42655f4b97..c87a88a757 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/291/output.json @@ -1,66 +1,22 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: 'import' and 'export' may only appear at the top level (1:7)", "SyntaxError: 'import' and 'export' may appear only with 'sourceType: \"module\"' (1:7)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "test": { "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" @@ -69,33 +25,11 @@ }, "consequent": { "type": "ImportDeclaration", - "start": 7, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":7,"end":22,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":22}}, "specifiers": [], "source": { "type": "StringLiteral", - "start": 14, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":14,"end":21,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":21}}, "extra": { "rawValue": "acorn", "raw": "\"acorn\"" 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 49e0835c1b..8515329a04 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/296/output.json @@ -1,101 +1,34 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "eval" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "NumericLiteral", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "extra": { "rawValue": 42, "raw": "42" @@ -108,32 +41,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 85866aeddd..16f6411a56 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/297/output.json @@ -1,130 +1,41 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:1)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "eval" - }, + "start":1,"end":5,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":5},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 10, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":10,"end":30,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":30}}, "body": [ { "type": "ExpressionStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "expression": { "type": "NumericLiteral", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "extra": { "rawValue": 42, "raw": "42" @@ -136,32 +47,10 @@ "directives": [ { "type": "Directive", - "start": 12, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":12,"end":25,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":25}}, "value": { "type": "DirectiveLiteral", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json index fd0a014544..86c9ce2155 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/298/output.json @@ -1,114 +1,36 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ "SyntaxError: Object pattern can't contain getter or setter (1:7)" ], "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 1, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":1,"end":19,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":19}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":3,"end":17,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":17}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "test" - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11},"identifierName":"test"}, "name": "test" }, "computed": false, @@ -119,18 +41,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "body": [], "directives": [] } @@ -140,18 +51,7 @@ ], "body": { "type": "NumericLiteral", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/299/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/299/output.json index 0cd40feef9..fffbe0878a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/299/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/299/output.json @@ -1,176 +1,50 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "Identifier", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "doSmth" - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"doSmth"}, "name": "doSmth" }, "arguments": [ { "type": "TemplateLiteral", - "start": 7, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":7,"end":31,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":31}}, "expressions": [ { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" }, { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "y" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"y"}, "name": "y" }, { "type": "BinaryExpression", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29}}, "left": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"x"}, "name": "x" }, "operator": "+", "right": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "y" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"y"}, "name": "y" } } @@ -178,18 +52,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 8, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":8,"end":8,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":8}}, "value": { "raw": "", "cooked": "" @@ -198,18 +61,7 @@ }, { "type": "TemplateElement", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15}}, "value": { "raw": " + ", "cooked": " + " @@ -218,18 +70,7 @@ }, { "type": "TemplateElement", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, "value": { "raw": " = ", "cooked": " = " @@ -238,18 +79,7 @@ }, { "type": "TemplateElement", - "start": 30, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":30,"end":30,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":30}}, "value": { "raw": "", "cooked": "" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/3/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/3/output.json index b1465d1f54..fbed9f8857 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/3/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/3/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "00" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/30/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/30/output.json index c2375ef25d..0d0d28d7f1 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/30/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/30/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "e" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"e"}, "name": "e" } ], "body": { "type": "StringLiteral", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "extra": { "rawValue": "test", "raw": "\"test\"" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/300/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/300/output.json index 053896a5a9..e57a1ec0b9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/300/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/300/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "normal" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"normal"}, "name": "normal" }, "generator": false, @@ -65,66 +20,20 @@ "params": [ { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "x" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"x"}, "name": "x" }, { "type": "AssignmentPattern", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}}, "left": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "y" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"y"}, "name": "y" }, "right": { "type": "NumericLiteral", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "extra": { "rawValue": 10, "raw": "10" @@ -135,18 +44,7 @@ ], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/301/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/301/output.json index bf47299eba..fc986dc293 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/301/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/301/output.json @@ -1,128 +1,38 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "local": { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "foo" - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"foo"}, "name": "foo" } }, { "type": "ImportNamespaceSpecifier", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "local": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "bar" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"bar"}, "name": "bar" } } ], "source": { "type": "StringLiteral", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}}, "extra": { "rawValue": "baz", "raw": "'baz'" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/302/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/302/output.json index 623d4ad5b4..1499ee54d3 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/302/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/302/output.json @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "TemplateLiteral", - "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}}, "expressions": [ { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" } ], "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "{", "cooked": "{" @@ -114,18 +36,7 @@ }, { "type": "TemplateElement", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "value": { "raw": "}", "cooked": "}" @@ -136,34 +47,12 @@ }, { "type": "TemplateLiteral", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "value": { "raw": "}", "cooked": "}" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/303/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/303/output.json index 7c5da8e4fa..c0512f4093 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/303/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/303/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ObjectPattern", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "method": false, "key": { "type": "Identifier", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "get" - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"get"}, "name": "get" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "get" - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"get"}, "name": "get" }, "extra": { @@ -132,19 +42,7 @@ }, "init": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "obj" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"obj"}, "name": "obj" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/304/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/304/output.json index 87af851a91..3130f6cb9f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/304/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/304/output.json @@ -1,158 +1,45 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":4,"end":45,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":45}}, "id": { "type": "ObjectPattern", - "start": 4, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":4,"end":39,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":39}}, "properties": [ { "type": "ObjectProperty", - "start": 5, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":5,"end":38,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":38}}, "method": false, "key": { "type": "Identifier", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "propName" - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13},"identifierName":"propName"}, "name": "propName" }, "computed": false, "shorthand": false, "value": { "type": "AssignmentPattern", - "start": 15, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":15,"end":38,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":38}}, "left": { "type": "Identifier", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "localVar" - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23},"identifierName":"localVar"}, "name": "localVar" }, "right": { "type": "Identifier", - "start": 26, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "defaultValue" - }, + "start":26,"end":38,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":38},"identifierName":"defaultValue"}, "name": "defaultValue" } } @@ -161,19 +48,7 @@ }, "init": { "type": "Identifier", - "start": 42, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "obj" - }, + "start":42,"end":45,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":45},"identifierName":"obj"}, "name": "obj" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/305/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/305/output.json index 219d24cef1..ac7f792906 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/305/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/305/output.json @@ -1,158 +1,45 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":4,"end":35,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":35}}, "id": { "type": "ObjectPattern", - "start": 4, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":4,"end":29,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":29}}, "properties": [ { "type": "ObjectProperty", - "start": 5, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":5,"end":28,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":28}}, "method": false, "key": { "type": "Identifier", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "propName" - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13},"identifierName":"propName"}, "name": "propName" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 5, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":5,"end":28,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":28}}, "left": { "type": "Identifier", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "propName" - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13},"identifierName":"propName"}, "name": "propName" }, "right": { "type": "Identifier", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "defaultValue" - }, + "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28},"identifierName":"defaultValue"}, "name": "defaultValue" } }, @@ -164,19 +51,7 @@ }, "init": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "obj" - }, + "start":32,"end":35,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":35},"identifierName":"obj"}, "name": "obj" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/306/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/306/output.json index 0ebadb028b..b992a269a4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/306/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/306/output.json @@ -1,124 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":4,"end":35,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":35}}, "id": { "type": "ArrayPattern", - "start": 4, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":4,"end":29,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":29}}, "elements": [ { "type": "AssignmentPattern", - "start": 5, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":5,"end":28,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":28}}, "left": { "type": "Identifier", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "localVar" - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13},"identifierName":"localVar"}, "name": "localVar" }, "right": { "type": "Identifier", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "defaultValue" - }, + "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28},"identifierName":"defaultValue"}, "name": "defaultValue" } } @@ -126,19 +36,7 @@ }, "init": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "obj" - }, + "start":32,"end":35,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":35},"identifierName":"obj"}, "name": "obj" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/307/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/307/output.json index cd6133289d..735b339ca7 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/307/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/307/output.json @@ -1,157 +1,45 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":1,"end":14,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":14}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "left": { "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" }, "right": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" @@ -167,19 +55,7 @@ }, "right": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "obj" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"obj"}, "name": "obj" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/308/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/308/output.json index 217356d377..23a12f79ff 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/308/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/308/output.json @@ -1,160 +1,48 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "left": { "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" }, "right": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" @@ -171,19 +59,7 @@ ], "body": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/309/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/309/output.json index f2e1c3bfd4..4da91987fb 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/309/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/309/output.json @@ -1,238 +1,69 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "operator": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "ObjectPattern", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "properties": [ { "type": "ObjectProperty", - "start": 5, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":5,"end":15,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":15}}, "method": false, "key": { "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" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15}}, "properties": [ { "type": "ObjectProperty", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "c" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "left": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "c" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"c"}, "name": "c" }, "right": { "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": 1, "raw": "1" @@ -253,19 +84,7 @@ }, "right": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "arr" - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23},"identifierName":"arr"}, "name": "arr" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/31/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/31/output.json index dda3533215..dfe12266a2 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/31/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/31/output.json @@ -1,115 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "b" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"b"}, "name": "b" } ], "body": { "type": "StringLiteral", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}}, "extra": { "rawValue": "test", "raw": "\"test\"" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/310/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/310/output.json index daf3984059..ff2f7de3f1 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/310/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/310/output.json @@ -1,142 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "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}}, "left": { "type": "ObjectPattern", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "left": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "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": 0, "raw": "0" @@ -152,35 +51,12 @@ }, "right": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "arr" - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19},"identifierName":"arr"}, "name": "arr" }, "body": { "type": "EmptyStatement", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}} } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/313/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/313/output.json index 1714f8b7d8..e1a0121f30 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/313/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/313/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "block": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 7, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":7,"end":27,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":27}}, "param": { "type": "ObjectPattern", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}}, "properties": [ { "type": "ObjectProperty", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "message" - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22},"identifierName":"message"}, "name": "message" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "message" - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22},"identifierName":"message"}, "name": "message" }, "extra": { @@ -148,18 +47,7 @@ }, "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/314/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/314/output.json index ad7fb88fb6..d83d3d34f4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/314/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/314/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":8,"end":23,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":23}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21}}, "kind": "method", "computed": false, "key": { "type": "Identifier", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "static" - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16},"identifierName":"static"}, "name": "static" }, "static": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/315/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/315/output.json index c70a86da71..fcc33f3742 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/315/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/315/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "await": false, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "init": null @@ -97,82 +30,24 @@ }, "right": { "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "list" - }, + "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 22, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":22,"end":33,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":33}}, "expression": { "type": "CallExpression", - "start": 22, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":22,"end":32,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":32}}, "callee": { "type": "Identifier", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "process" - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "x" - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/316/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/316/output.json index e82aed2b8a..a50a075e29 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/316/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/316/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":8,"end":24,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":24}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":10,"end":22,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":22}}, "static": false, "kind": "method", "key": { "type": "Identifier", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "static" - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17},"identifierName":"static"}, "name": "static" }, "computed": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } 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 7fef6fe7c8..28f11eec46 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/317/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/317/output.json @@ -1,119 +1,31 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expressions": [ { "type": "MemberExpression", - "start": 3, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":3,"end":20,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":20}}, "object": { "type": "CallExpression", - "start": 3, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":3,"end":17,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":17}}, "callee": { "type": "MemberExpression", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12}}, "object": { "type": "RegExpLiteral", - "start": 3, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":3,"end":7,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":7}}, "extra": { "raw": "/\\d/" }, @@ -122,19 +34,7 @@ }, "property": { "type": "Identifier", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "exec" - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"exec"}, "name": "exec" }, "computed": false @@ -142,18 +42,7 @@ "arguments": [ { "type": "StringLiteral", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16}}, "extra": { "rawValue": "1", "raw": "'1'" @@ -164,18 +53,7 @@ }, "property": { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 0, "raw": "0" @@ -188,18 +66,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 1 - } - }, + "start":1,"end":1,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":1}}, "value": { "raw": "", "cooked": "" @@ -208,18 +75,7 @@ }, { "type": "TemplateElement", - "start": 21, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":21,"end":21,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":21}}, "value": { "raw": "", "cooked": "" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/318/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/318/output.json index 3f69bd9158..0d1ed1d7d8 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/318/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/318/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "_𐒦" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"_𐒦"}, "name": "_𐒦" }, "init": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/319/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/319/output.json index 52de80ad5e..7a875c41be 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/319/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/319/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "_𐒦" - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14},"identifierName":"_𐒦"}, "name": "_𐒦" }, "init": { "type": "NumericLiteral", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "extra": { "rawValue": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/32/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/32/output.json index 1c6e09f83b..b16741cd69 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/32/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/32/output.json @@ -1,127 +1,38 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "e" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"e"}, "name": "e" } ], "body": { "type": "BlockStatement", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "body": [ { "type": "ExpressionStatement", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "expression": { "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/fixtures/es2015/uncategorised/320/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/320/output.json index 6a08a2afa8..9bfbdf26ff 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/320/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/320/output.json @@ -1,126 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "ArrayPattern", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "elements": [ { "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" } ] }, "init": { "type": "ArrayExpression", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "elements": [ { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/321/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/321/output.json index f581d7e8cc..4a82688197 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/321/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/321/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ObjectPattern", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "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" }, "extra": { @@ -132,19 +42,7 @@ }, "init": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "y" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"y"}, "name": "y" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/322/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/322/output.json index 68286e968b..56fad205b1 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/322/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/322/output.json @@ -1,115 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrayPattern", - "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}}, + "extra": { + "trailingComma": 3 }, "elements": [ { "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" }, null - ], - "extra": { - "trailingComma": 3 - } + ] }, "right": { "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": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/323/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/323/output.json index b02eeda569..6906bdb578 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/323/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/323/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":5,"end":22,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "id": { "type": "ArrayPattern", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "elements": [ { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "name" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"name"}, "name": "name" }, { "type": "Identifier", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "value" - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21},"identifierName":"value"}, "name": "value" } ] @@ -130,35 +40,12 @@ }, "right": { "type": "Identifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "obj" - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29},"identifierName":"obj"}, "name": "obj" }, "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json index 09ca9d8754..95055f68cb 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/324/output.json @@ -1,96 +1,29 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Complex binding patterns require an initialization value (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "type": "ArrayPattern", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "elements": [ { "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" } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json index 6d0d7ab1d0..357a7e282e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/325/output.json @@ -1,96 +1,29 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Complex binding patterns require an initialization value (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "type": "ArrayPattern", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "elements": [ { "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" } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json index 9b5c4b8b18..7e613e65e9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/329/output.json @@ -1,114 +1,36 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: Lexical declaration cannot appear in a single-statement context (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "init": null, "test": null, "update": null, "body": { "type": "VariableDeclaration", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "x" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "extra": { "rawValue": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/33/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/33/output.json index b38e5d2c1b..d62ccc4896 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/33/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/33/output.json @@ -1,147 +1,46 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "e" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"e"}, "name": "e" } ], "body": { "type": "ObjectExpression", - "start": 6, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":6,"end":22,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":8,"end":20,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "property" - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16},"identifierName":"property"}, "name": "property" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "extra": { "rawValue": 42, "raw": "42" 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 cc9bdf3e16..c604d5892a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/332/output.json @@ -1,110 +1,32 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'eval' in strict mode (1:18)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "expression": { "type": "AssignmentExpression", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "operator": "=", "left": { "type": "ArrayPattern", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}}, "elements": [ { "type": "RestElement", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22}}, "argument": { "type": "Identifier", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "eval" - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22},"identifierName":"eval"}, "name": "eval" } } @@ -112,19 +34,7 @@ }, "right": { "type": "Identifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "arr" - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29},"identifierName":"arr"}, "name": "arr" } } @@ -133,32 +43,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/333/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/333/output.json index 5d9acaecea..df2a6a81e4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/333/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/333/output.json @@ -1,162 +1,49 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected reserved word 'eval' (1:16)", "SyntaxError: Assigning to 'eval' in strict mode (1:16)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":14,"end":39,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":39}}, "expression": { "type": "AssignmentExpression", - "start": 15, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":15,"end":38,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":38}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 15, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":15,"end":32,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":32}}, "properties": [ { "type": "ObjectProperty", - "start": 16, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":16,"end":31,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":31}}, "method": false, "key": { "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "eval" - }, + "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"eval"}, "name": "eval" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 16, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":16,"end":31,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":31}}, "left": { "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "eval" - }, + "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"eval"}, "name": "eval" }, "right": { "type": "Identifier", - "start": 23, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "defValue" - }, + "start":23,"end":31,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":31},"identifierName":"defValue"}, "name": "defValue" } }, @@ -168,19 +55,7 @@ }, "right": { "type": "Identifier", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "obj" - }, + "start":35,"end":38,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":38},"identifierName":"obj"}, "name": "obj" }, "extra": { @@ -193,32 +68,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json index a1414d86bb..56ed13d09f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/334/output.json @@ -1,110 +1,32 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'eval' in strict mode (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrayPattern", - "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}}, "elements": [ { "type": "RestElement", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "argument": { "type": "Identifier", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "eval" - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8},"identifierName":"eval"}, "name": "eval" } } @@ -112,19 +34,7 @@ }, "right": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "arr" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"arr"}, "name": "arr" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/338/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/338/output.json index d10dfda13c..3659ff0539 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/338/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/338/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "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}}, "declaration": { "type": "FunctionDeclaration", - "start": 15, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":15,"end":32,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":32}}, "id": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "foo" - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -79,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":30,"end":32,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":32}}, "body": [], "directives": [] } @@ -98,32 +31,10 @@ }, { "type": "ExpressionStatement", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":33,"end":38,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":38}}, "expression": { "type": "BooleanLiteral", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":33,"end":38,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":38}}, "value": false } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json index 86383c01fe..0f3359c665 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/339/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "value": { "raw": "\\07", "cooked": null diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/34/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/34/output.json index aeaacfb4d4..00e4c4cd68 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/34/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/34/output.json @@ -1,141 +1,41 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "e" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"e"}, "name": "e" } ], "body": { "type": "BlockStatement", - "start": 5, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":5,"end":18,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":18}}, "body": [ { "type": "LabeledStatement", - "start": 7, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":7,"end":16,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":16}}, "body": { "type": "ExpressionStatement", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "expression": { "type": "NumericLiteral", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "extra": { "rawValue": 42, "raw": "42" @@ -145,19 +45,7 @@ }, "label": { "type": "Identifier", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "label" - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12},"identifierName":"label"}, "name": "label" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json index ee3b4cb355..7cde5ed762 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/344/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: super is only allowed in object methods and classes (1:0)", "SyntaxError: super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Super", - "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}} } } ], diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json index 31975621dc..875ae6923b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/347/output.json @@ -1,114 +1,35 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: setter must have exactly one formal parameter (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":8,"end":29,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":29}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":27}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "prop" - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"prop"}, "name": "prop" }, "computed": false, @@ -119,53 +40,18 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "x" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"x"}, "name": "x" }, { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "y" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"y"}, "name": "y" } ], "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [], "directives": [] } 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 49d20172fc..e976347b71 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/348/output.json @@ -1,114 +1,36 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Redefinition of __proto__ property (1:17)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":1,"end":31,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":31}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":3,"end":15,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":15}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "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": 1, "raw": "1" @@ -118,52 +40,18 @@ }, { "type": "ObjectProperty", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "__proto__" - }, + "start":17,"end":26,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":26},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29}}, "extra": { "rawValue": 2, "raw": "2" 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 ba254dda4d..f3676a82d6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/349/output.json @@ -1,95 +1,29 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ "SyntaxError: Redefinition of __proto__ property (1:19)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":3,"end":17,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":17}}, "method": false, "key": { "type": "StringLiteral", - "start": 3, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":3,"end":14,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":14}}, "extra": { "rawValue": "__proto__", "raw": "'__proto__'" @@ -100,18 +34,7 @@ "shorthand": false, "value": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 1, "raw": "1" @@ -121,52 +44,18 @@ }, { "type": "ObjectProperty", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "method": false, "key": { "type": "Identifier", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "__proto__" - }, + "start":19,"end":28,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":28},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/35/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/35/output.json index 3283c962d6..e9089f70a5 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/35/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/35/output.json @@ -1,144 +1,43 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "b" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"b"}, "name": "b" } ], "body": { "type": "BlockStatement", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "body": [ { "type": "ExpressionStatement", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15}}, "expression": { "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/fixtures/es2015/uncategorised/350/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/350/output.json index 6c41f74ec2..be737302ae 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/350/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/350/output.json @@ -1,93 +1,27 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":3,"end":19,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":19}}, "method": false, "computed": true, "key": { "type": "StringLiteral", - "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}}, "extra": { "rawValue": "__proto__", "raw": "'__proto__'" @@ -97,18 +31,7 @@ "shorthand": false, "value": { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 1, "raw": "1" @@ -118,52 +41,18 @@ }, { "type": "ObjectProperty", - "start": 21, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, "method": false, "key": { "type": "Identifier", - "start": 21, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "__proto__" - }, + "start":21,"end":30,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":30},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/351/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/351/output.json index 72ac1d371e..a9591c9cb8 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/351/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/351/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":1,"end":43,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":43}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":3,"end":27,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":27}}, "method": true, "key": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, @@ -98,47 +31,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "body": [ { "type": "ReturnStatement", - "start": 17, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":17,"end":25,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":25}}, "argument": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}}, "extra": { "rawValue": 1, "raw": "1" @@ -152,52 +52,18 @@ }, { "type": "ObjectProperty", - "start": 29, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":29,"end":41,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":41}}, "method": false, "key": { "type": "Identifier", - "start": 29, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "__proto__" - }, + "start":29,"end":38,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":38},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/352/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/352/output.json index 2a28996931..0d849579ce 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/352/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/352/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":1,"end":47,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":47}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":3,"end":31,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":31}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "__proto__" - }, + "start":7,"end":16,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":16},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, @@ -98,47 +31,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "body": [ { "type": "ReturnStatement", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "argument": { "type": "NumericLiteral", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29}}, "extra": { "rawValue": 1, "raw": "1" @@ -152,52 +52,18 @@ }, { "type": "ObjectProperty", - "start": 33, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":33,"end":45,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":45}}, "method": false, "key": { "type": "Identifier", - "start": 33, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "__proto__" - }, + "start":33,"end":42,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":42},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":44,"end":45,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":45}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/354/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/354/output.json index 9e25d9da5d..3b7cf678f8 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/354/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/354/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "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}}, "declaration": { "type": "RegExpLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "raw": "/foo/" }, diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/355/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/355/output.json index cb43f63dc3..d95563f2b9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/355/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/355/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -65,98 +20,30 @@ "params": [ { "type": "ObjectPattern", - "start": 11, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":11,"end":25,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":25}}, "properties": [ { "type": "ObjectProperty", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":13,"end":23,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":23}}, "method": false, "key": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "set" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"set"}, "name": "set" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":13,"end":23,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":23}}, "left": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "set" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"set"}, "name": "set" }, "right": { "type": "NullLiteral", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":19,"end":23,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":23}} } }, "extra": { @@ -168,18 +55,7 @@ ], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/356/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/356/output.json index 8555ebc476..1f42603733 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/356/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/356/output.json @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "await" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"await"}, "name": "await" }, "right": { "type": "CallExpression", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"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/fixtures/es2015/uncategorised/357/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json index b5f573a72f..7c4008d329 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/357/output.json @@ -1,112 +1,33 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Can not use keyword 'await' outside an async function (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "await" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"await"}, "name": "await" }, "right": { "type": "CallExpression", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"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/fixtures/es2015/uncategorised/358/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/358/output.json index 7ff3c49080..5d77657d82 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/358/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/358/output.json @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "await" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"await"}, "name": "await" }, "init": { "type": "CallExpression", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "callee": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json index cc297fab6b..290e89d5fc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/359/output.json @@ -1,112 +1,33 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Can not use keyword 'await' outside an async function (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "await" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"await"}, "name": "await" }, "init": { "type": "CallExpression", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "callee": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/36/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/36/output.json index 4e41014ff6..fa7e54bcd4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/36/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/36/output.json @@ -1,114 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ArrayPattern", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "elements": [ { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, null, { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "b" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" } ] @@ -116,18 +37,7 @@ ], "body": { "type": "NumericLiteral", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/360/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/360/output.json index dc5c92e48a..3182e3f357 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/360/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/360/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":6,"end":23,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":23}}, "id": { "type": "ObjectPattern", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "await" - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"await"}, "name": "await" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "await" - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"await"}, "name": "await" }, "extra": { @@ -132,33 +42,10 @@ }, "init": { "type": "CallExpression", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "callee": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "foo" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"foo"}, "name": "foo" }, "arguments": [] 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 1bbb6a10ec..8b0aa3cdb2 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/361/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: Can not use keyword 'await' outside an async function (1:8)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":6,"end":23,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":23}}, "id": { "type": "ObjectPattern", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "await" - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"await"}, "name": "await" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "await" - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"await"}, "name": "await" }, "extra": { @@ -135,33 +45,10 @@ }, "init": { "type": "CallExpression", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "callee": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "foo" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/362/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/362/output.json index 400d7abe65..f220a5016a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/362/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/362/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,68 +20,22 @@ "params": [ { "type": "ObjectPattern", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":13,"end":22,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectProperty", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "await" - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"await"}, "name": "await" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "await" - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"await"}, "name": "await" }, "extra": { @@ -138,18 +47,7 @@ ], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] } 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 8734398fed..1ab8abb190 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/363/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ "SyntaxError: Can not use keyword 'await' outside an async function (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -68,68 +23,22 @@ "params": [ { "type": "ObjectPattern", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":13,"end":22,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectProperty", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "await" - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"await"}, "name": "await" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "await" - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"await"}, "name": "await" }, "extra": { @@ -141,18 +50,7 @@ ], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/364/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/364/output.json index c3b382f194..c0242adce5 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/364/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/364/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "await" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"await"}, "name": "await" }, "generator": false, @@ -65,18 +20,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json index 9f69841ee6..f09a6f2813 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/365/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Can not use keyword 'await' outside an async function (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "await" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"await"}, "name": "await" }, "generator": false, @@ -68,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/366/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/366/output.json index 94fce7f2c8..399cf3cbb6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/366/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/366/output.json @@ -1,80 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "await" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"await"}, "name": "await" }, "superClass": null, "body": { "type": "ClassBody", - "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}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json index 12f2a4f356..8b3ca71abc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/367/output.json @@ -1,83 +1,27 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Can not use keyword 'await' outside an async function (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "await" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"await"}, "name": "await" }, "superClass": null, "body": { "type": "ClassBody", - "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}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json index db0bfd7b2d..600dd2bbb9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/368/output.json @@ -1,112 +1,33 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected reserved word 'enum' (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "enum" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"enum"}, "name": "enum" }, "right": { "type": "CallExpression", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "callee": { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "foo" - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json index 7f72357046..5dcad34468 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/369/output.json @@ -1,112 +1,33 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected reserved word 'enum' (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "enum" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"enum"}, "name": "enum" }, "right": { "type": "CallExpression", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "callee": { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "foo" - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json index 074d84652a..58ec7c2475 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/37/output.json @@ -1,130 +1,40 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding member expression (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ArrayPattern", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "elements": [ { "type": "MemberExpression", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, "object": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "computed": false @@ -134,18 +44,7 @@ ], "body": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json index 6f19d31ea5..d702eecd62 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/370/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Unexpected reserved word 'enum' (1:6)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "enum" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"enum"}, "name": "enum" }, "init": { "type": "CallExpression", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18}}, "callee": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json index c6e7026255..4333b93e58 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/371/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Unexpected reserved word 'enum' (1:6)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "enum" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"enum"}, "name": "enum" }, "init": { "type": "CallExpression", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18}}, "callee": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "arguments": [] 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 7da63dd7a9..6521ee477c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/372/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ "SyntaxError: Unexpected reserved word 'enum' (1:8)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":6,"end":22,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":22}}, "id": { "type": "ObjectPattern", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "enum" - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"enum"}, "name": "enum" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "enum" - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"enum"}, "name": "enum" }, "extra": { @@ -135,33 +45,10 @@ }, "init": { "type": "CallExpression", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "callee": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"foo"}, "name": "foo" }, "arguments": [] 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 f906a9f99e..dfeea9b4cd 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/373/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ "SyntaxError: Unexpected reserved word 'enum' (1:8)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":6,"end":22,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":22}}, "id": { "type": "ObjectPattern", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "enum" - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"enum"}, "name": "enum" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "enum" - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"enum"}, "name": "enum" }, "extra": { @@ -135,33 +45,10 @@ }, "init": { "type": "CallExpression", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "callee": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"foo"}, "name": "foo" }, "arguments": [] 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 339a9b1d9a..19654730cb 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/374/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ "SyntaxError: Unexpected reserved word 'enum' (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -68,68 +23,22 @@ "params": [ { "type": "ObjectPattern", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21}}, "properties": [ { "type": "ObjectProperty", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "enum" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"enum"}, "name": "enum" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "enum" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"enum"}, "name": "enum" }, "extra": { @@ -141,18 +50,7 @@ ], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } 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 9ad60d6cf4..f01eb7211d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/375/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ "SyntaxError: Unexpected reserved word 'enum' (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -68,68 +23,22 @@ "params": [ { "type": "ObjectPattern", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21}}, "properties": [ { "type": "ObjectProperty", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "enum" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"enum"}, "name": "enum" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "enum" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"enum"}, "name": "enum" }, "extra": { @@ -141,18 +50,7 @@ ], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json index ed7ac1e295..322f8bc8c7 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/376/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Unexpected reserved word 'enum' (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "enum" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"enum"}, "name": "enum" }, "generator": false, @@ -68,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json index 7a06864215..4b207d606d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/377/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Unexpected reserved word 'enum' (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "enum" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"enum"}, "name": "enum" }, "generator": false, @@ -68,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json index 04f287aef7..c7c70afe77 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/378/output.json @@ -1,83 +1,27 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected reserved word 'enum' (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "enum" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"enum"}, "name": "enum" }, "superClass": null, "body": { "type": "ClassBody", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json index 0619ba17f5..168f8d9cc0 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/379/output.json @@ -1,83 +1,27 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected reserved word 'enum' (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "enum" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"enum"}, "name": "enum" }, "superClass": null, "body": { "type": "ClassBody", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/380/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/380/output.json index cb95fa84a1..d59a3ac4cc 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/380/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/380/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/381/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/381/output.json index 99ed085c71..718eae62c7 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/381/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/381/output.json @@ -1,110 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/382/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/382/output.json index d6ca5e1061..53d9b742e1 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/382/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/382/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/383/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/383/output.json index 1f6fd124cd..fc4874aa2f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/383/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/383/output.json @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "specifiers": [], "source": null, "declaration": { "type": "ClassDeclaration", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "Foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/384/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/384/output.json index f76dab287f..83ea4a2e0e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/384/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/384/output.json @@ -1,79 +1,23 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 7, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "foo" - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -81,18 +25,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/385/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/385/output.json index 5432ec7cac..a4b4f875f1 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/385/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/385/output.json @@ -1,79 +1,23 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 7, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":7,"end":30,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -81,18 +25,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/39/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/39/output.json index e60231ec6c..b2f75a4c1c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/39/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/39/output.json @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "left": { "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" }, "right": { "type": "NumericLiteral", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4}}, "extra": { "rawValue": 1, "raw": "1" @@ -116,51 +38,16 @@ ], "body": { "type": "BinaryExpression", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "left": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "operator": "*", "right": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/391/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/391/output.json index 643d604680..447c3d2533 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/391/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/391/output.json @@ -1,79 +1,23 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -81,18 +25,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } @@ -100,18 +33,7 @@ }, { "type": "EmptyStatement", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - } + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/393/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/393/output.json index beaa3b4c55..e09222b115 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/393/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/393/output.json @@ -1,160 +1,48 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 1, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":2,"end":10,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":10}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "set" - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5},"identifierName":"set"}, "name": "set" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 2, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":2,"end":10,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":10}}, "left": { "type": "Identifier", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "set" - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5},"identifierName":"set"}, "name": "set" }, "right": { "type": "ObjectExpression", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "properties": [] } }, @@ -167,19 +55,7 @@ ], "body": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "set" - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19},"identifierName":"set"}, "name": "set" } } 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 3eccd63cbd..611110b17d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/394/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/394/output.json @@ -1,78 +1,22 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":14}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": null @@ -82,172 +26,48 @@ }, { "type": "ExpressionStatement", - "start": 7, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":7,"end":16,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":9}}, "expression": { "type": "AssignmentExpression", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":7,"end":15,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}}, "operator": "=", "left": { "type": "ParenthesizedExpression", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":7,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "expression": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 2 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":2},"identifierName":"a"}, "name": "a" } }, "right": { "type": "ObjectExpression", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":13,"end":15,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "properties": [] } } }, { "type": "ExpressionStatement", - "start": 17, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":17,"end":28,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":11}}, "expression": { "type": "AssignmentExpression", - "start": 17, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":17,"end":27,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":10}}, "operator": "=", "left": { "type": "ParenthesizedExpression", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":17,"end":22,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":5}}, "expression": { "type": "MemberExpression", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":18,"end":21,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":4}}, "object": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 2 - }, - "identifierName": "a" - }, + "start":18,"end":19,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":2},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "b" - }, + "start":20,"end":21,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"b"}, "name": "b" }, "computed": false @@ -255,110 +75,32 @@ }, "right": { "type": "ObjectExpression", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":25,"end":27,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":10}}, "properties": [] } } }, { "type": "ExpressionStatement", - "start": 29, - "end": 43, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":29,"end":43,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":14}}, "expression": { "type": "AssignmentExpression", - "start": 29, - "end": 42, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":29,"end":42,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":13}}, "operator": "=", "left": { "type": "ParenthesizedExpression", - "start": 29, - "end": 37, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 8 - } - }, + "start":29,"end":37,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":8}}, "expression": { "type": "MemberExpression", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":30,"end":36,"loc":{"start":{"line":4,"column":1},"end":{"line":4,"column":7}}, "object": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 4, - "column": 2 - }, - "identifierName": "a" - }, + "start":30,"end":31,"loc":{"start":{"line":4,"column":1},"end":{"line":4,"column":2},"identifierName":"a"}, "name": "a" }, "property": { "type": "StringLiteral", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 4, - "column": 3 - }, - "end": { - "line": 4, - "column": 6 - } - }, + "start":32,"end":35,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":6}}, "extra": { "rawValue": "c", "raw": "'c'" @@ -370,18 +112,7 @@ }, "right": { "type": "ObjectExpression", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":40,"end":42,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":13}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json index 074d84652a..58ec7c2475 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/395/output.json @@ -1,130 +1,40 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding member expression (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ArrayPattern", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "elements": [ { "type": "MemberExpression", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, "object": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "computed": false @@ -134,18 +44,7 @@ ], "body": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/4/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/4/output.json index ba347ead99..69b1fc0dba 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/4/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/4/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0o0" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/40/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/40/output.json index 8f40c2b9e5..8f63cdd60d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/40/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/40/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/41/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/41/output.json index 13a6a64d03..d33e35056a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/41/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/41/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "NumericLiteral", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/42/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/42/output.json index 6ae12c62e3..72ab3ece36 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/42/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/42/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" } ], "body": { "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": 0, "raw": "00" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/43/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/43/output.json index fd7a891d8c..ed7c52c299 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/43/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/43/output.json @@ -1,115 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "eval" - }, + "start":1,"end":5,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":5},"identifierName":"eval"}, "name": "eval" }, { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" } ], "body": { "type": "NumericLiteral", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/44/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/44/output.json index a51e793b44..d13b273267 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/44/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/44/output.json @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, "left": { "type": "Identifier", - "start": 1, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "eval" - }, + "start":1,"end":5,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":5},"identifierName":"eval"}, "name": "eval" }, "right": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": 10, "raw": "10" @@ -116,18 +38,7 @@ ], "body": { "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/fixtures/es2015/uncategorised/45/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/45/output.json index 114403aa5e..d3c143b18e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/45/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/45/output.json @@ -1,128 +1,38 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "eval" - }, + "start":1,"end":5,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":5},"identifierName":"eval"}, "name": "eval" }, { "type": "AssignmentPattern", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "left": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, "right": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "extra": { "rawValue": 10, "raw": "10" @@ -133,18 +43,7 @@ ], "body": { "type": "NumericLiteral", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/46/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/46/output.json index cd821a586b..245d1b011a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/46/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/46/output.json @@ -1,99 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/47/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/47/output.json index 9250f449ee..c513497671 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/47/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/47/output.json @@ -1,134 +1,44 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "ArrowFunctionExpression", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/48/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/48/output.json index cdd0d45ece..91ad2d7f7a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/48/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/48/output.json @@ -1,201 +1,63 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":8,"end":27,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":27}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "y" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"y"}, "name": "y" }, { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "z" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"z"}, "name": "z" } ], "body": { "type": "SequenceExpression", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}}, "expressions": [ { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "x" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"x"}, "name": "x" }, { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "y" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"y"}, "name": "y" }, { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "z" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"z"}, "name": "z" } ], diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/49/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/49/output.json index fb2194b635..1d6b874fa0 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/49/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/49/output.json @@ -1,112 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "body": [], "directives": [] } 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 d5fe344096..61be53c7f1 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/5/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/5/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "test" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"test"}, "name": "test" }, "generator": false, @@ -65,47 +20,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":16,"end":37,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":37}}, "body": [ { "type": "ExpressionStatement", - "start": 31, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":31,"end":35,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":35}}, "expression": { "type": "NumericLiteral", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":31,"end":34,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":34}}, "extra": { "rawValue": 0, "raw": "0o0" @@ -117,32 +39,10 @@ "directives": [ { "type": "Directive", - "start": 17, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":17,"end":30,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":30}}, "value": { "type": "DirectiveLiteral", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/50/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/50/output.json index c075ce9f91..d8574a83a9 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/50/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/50/output.json @@ -1,147 +1,45 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "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": "ArrowFunctionExpression", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": null, "generator": false, "async": false, "params": [ { "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" }, { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "y" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"y"}, "name": "y" } ], "body": { "type": "BlockStatement", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/52/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/52/output.json index f21c6941d4..5a3a57f142 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/52/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/52/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, "method": true, "key": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "method" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"method"}, "name": "method" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/53/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/53/output.json index c81975172d..69bfad8eae 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/53/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/53/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "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": "ObjectExpression", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":6,"end":22,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":22}}, "method": true, "key": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "method" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"method"}, "name": "method" }, "computed": false, @@ -130,36 +40,13 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "test" - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17},"identifierName":"test"}, "name": "test" } ], "body": { "type": "BlockStatement", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/54/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/54/output.json index 1b04fa1a9e..9458f1abae 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/54/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/54/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "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": "ObjectExpression", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":6,"end":20,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":20}}, "method": true, "key": { "type": "StringLiteral", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "extra": { "rawValue": "method", "raw": "'method'" @@ -133,18 +44,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/55/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/55/output.json index b741ed8e8c..e4fe6bae92 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/55/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/55/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "method": true, "key": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "get" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"get"}, "name": "get" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/56/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/56/output.json index dcc857d36a..501eec0d1d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/56/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/56/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "method": true, "key": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "set" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"set"}, "name": "set" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/6/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/6/output.json index 83bb02767b..8e667f20e7 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/6/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/6/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 2, "raw": "0o2" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/61/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/61/output.json index 4d782bacf3..d3c16c2f9e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/61/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/61/output.json @@ -1,144 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "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" }, "extra": { @@ -147,53 +45,18 @@ }, { "type": "ObjectProperty", - "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}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "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" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/62/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/62/output.json index c26d3df644..8f81c662bb 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/62/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/62/output.json @@ -1,161 +1,47 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrayPattern", - "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}}, "elements": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "b" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"b"}, "name": "b" } ] }, "right": { "type": "ArrayExpression", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "elements": [ { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "b" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"b"}, "name": "b" }, { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a" } ] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/63/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/63/output.json index 4f02fd1fd0..bfffdb8bfb 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/63/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/63/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "id": { "type": "ObjectPattern", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, "extra": { @@ -132,18 +42,7 @@ }, "init": { "type": "ObjectExpression", - "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}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/64/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/64/output.json index 22e50c8fdd..858f2811a8 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/64/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/64/output.json @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "id": { "type": "ArrayPattern", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9}}, "elements": [ { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" } ] }, "init": { "type": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/65/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/65/output.json index 58770afcb5..78253742ef 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/65/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/65/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ObjectPattern", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "extra": { @@ -132,18 +42,7 @@ }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/66/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/66/output.json index 4b9e1e2f8f..ce4e71a130 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/66/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/66/output.json @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ArrayPattern", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "elements": [ { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" } ] }, "init": { "type": "ArrayExpression", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/67/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/67/output.json index 389812ee6d..8b63047c19 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/67/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/67/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ObjectPattern", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "extra": { @@ -132,18 +42,7 @@ }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/68/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/68/output.json index b51f000a64..3ba59fcb3e 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/68/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/68/output.json @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ArrayPattern", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "elements": [ { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" } ] }, "init": { "type": "ArrayExpression", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/69/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/69/output.json index 0255b7eed5..b10331a51b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/69/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/69/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":6,"end":16,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":16}}, "id": { "type": "ObjectPattern", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "properties": [ { "type": "ObjectProperty", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "b" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"b"}, "name": "b" } } @@ -129,18 +39,7 @@ }, "init": { "type": "ObjectExpression", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/7/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/7/output.json index b6a8fbeae7..cb18be5923 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/7/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/7/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 10, "raw": "0o12" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/70/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/70/output.json index cdc69cac50..18020adbe1 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/70/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/70/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "ObjectPattern", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "method": false, "key": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "b" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" } } @@ -129,18 +39,7 @@ }, "init": { "type": "ObjectExpression", - "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}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/71/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/71/output.json index 9340538d88..d8a1fcb106 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/71/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/71/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "ObjectPattern", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "method": false, "key": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "b" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" } } @@ -129,18 +39,7 @@ }, "init": { "type": "ObjectExpression", - "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}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/72/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/72/output.json index 42877b9e29..653a4a71e6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/72/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/72/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "document" - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19},"identifierName":"document"}, "name": "document" }, "init": null diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/73/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/73/output.json index 666b9568c3..09f7482c16 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/73/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/73/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":11,"end":25,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "document" - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19},"identifierName":"document"}, "name": "document" }, "init": { "type": "ObjectExpression", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/74/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/74/output.json index 2a9c973e47..ccd72eb65d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/74/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/74/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "document" - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19},"identifierName":"document"}, "name": "document" }, "init": null diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/75/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/75/output.json index 9d7617c358..b1d90d76c4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/75/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/75/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":11,"end":25,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "document" - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19},"identifierName":"document"}, "name": "document" }, "init": { "type": "ObjectExpression", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/76/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/76/output.json index 7262e926c7..421458d255 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/76/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/76/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":7,"end":27,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":13,"end":27,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "document" - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21},"identifierName":"document"}, "name": "document" }, "init": { "type": "ObjectExpression", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/77/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/77/output.json index 39d4d490b5..7618cbb48f 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/77/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/77/output.json @@ -1,79 +1,23 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 7, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":7,"end":27,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "parse" - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21},"identifierName":"parse"}, "name": "parse" }, "generator": false, @@ -81,18 +25,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/78/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/78/output.json index 8af62b1cae..3c3cbd026a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/78/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/78/output.json @@ -1,96 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "ClassDeclaration", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "Class" - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18},"identifierName":"Class"}, "name": "Class" }, "superClass": null, "body": { "type": "ClassBody", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/79/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/79/output.json index cfbfd26932..2f511ea7f4 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/79/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/79/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "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}}, "declaration": { "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/fixtures/es2015/uncategorised/8/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/8/output.json index 28ed794187..88aa9ec11b 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/8/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/8/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0O0" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/80/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/80/output.json index 52f9f4e1dc..1689c32a0d 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/80/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/80/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "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}}, "declaration": { "type": "FunctionDeclaration", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":15,"end":29,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":29}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/81/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/81/output.json index a8d8b98ed5..7afc284a47 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/81/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/81/output.json @@ -1,77 +1,21 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "declaration": { "type": "FunctionDeclaration", - "start": 15, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":15,"end":30,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "f" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -79,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/82/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/82/output.json index a6431fd6f6..502e479af6 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/82/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/82/output.json @@ -1,78 +1,23 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "declaration": { "type": "ClassDeclaration", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/83/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/83/output.json index 55d9497f89..67706de2fd 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/83/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/83/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "declaration": { "type": "ClassDeclaration", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":15,"end":25,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "A" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/85/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/85/output.json index 8f3f16accc..24822f85f3 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/85/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/85/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportAllDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "source": { "type": "StringLiteral", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":14,"end":22,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":22}}, "extra": { "rawValue": "crypto", "raw": "\"crypto\"" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/86/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/86/output.json index 7e4ade4989..bbaa0eac18 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/86/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/86/output.json @@ -1,95 +1,27 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, "local": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"encrypt"}, "name": "encrypt" }, "exported": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"encrypt"}, "name": "encrypt" } } @@ -99,33 +31,10 @@ }, { "type": "FunctionDeclaration", - "start": 19, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":19,"end":41,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, "id": { "type": "Identifier", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":28,"end":35,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":16},"identifierName":"encrypt"}, "name": "encrypt" }, "generator": false, @@ -133,18 +42,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":39,"end":41,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/87/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/87/output.json index 28e7320743..34836ef130 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/87/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/87/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"encrypt"}, "name": "encrypt" }, "generator": false, @@ -65,181 +20,55 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } }, { "type": "ClassDeclaration", - "start": 23, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":38,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 29, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "decrypt" - }, + "start":29,"end":36,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":13},"identifierName":"decrypt"}, "name": "decrypt" }, "superClass": null, "body": { "type": "ClassBody", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":36,"end":38,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "body": [] } }, { "type": "ExportNamedDeclaration", - "start": 39, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":39,"end":66,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":27}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 48, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":48,"end":55,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":16}}, "local": { "type": "Identifier", - "start": 48, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":48,"end":55,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":16},"identifierName":"encrypt"}, "name": "encrypt" }, "exported": { "type": "Identifier", - "start": 48, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":48,"end":55,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":16},"identifierName":"encrypt"}, "name": "encrypt" } }, { "type": "ExportSpecifier", - "start": 57, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":57,"end":64,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":25}}, "local": { "type": "Identifier", - "start": 57, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 25 - }, - "identifierName": "decrypt" - }, + "start":57,"end":64,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":25},"identifierName":"decrypt"}, "name": "decrypt" }, "exported": { "type": "Identifier", - "start": 57, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 25 - }, - "identifierName": "decrypt" - }, + "start":57,"end":64,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":25},"identifierName":"decrypt"}, "name": "decrypt" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/88/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/88/output.json index 25b0fd9741..bbc9bf9f48 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/88/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/88/output.json @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":29}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":29}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "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}}, "local": { "type": "Identifier", - "start": 7, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "encrypt" - }, + "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14},"identifierName":"encrypt"}, "name": "encrypt" } } ], "source": { "type": "StringLiteral", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "extra": { "rawValue": "", "raw": "\"\"" @@ -100,65 +33,19 @@ }, { "type": "ExportNamedDeclaration", - "start": 24, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":24,"end":53,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":29}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 33, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":33,"end":51,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":27}}, "local": { "type": "Identifier", - "start": 33, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":33,"end":40,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":16},"identifierName":"encrypt"}, "name": "encrypt" }, "exported": { "type": "Identifier", - "start": 44, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "default" - }, + "start":44,"end":51,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":27},"identifierName":"default"}, "name": "default" } } diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/89/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/89/output.json index 6e52c6fd4d..0057ceda7c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/89/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/89/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 34 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 34 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"encrypt"}, "name": "encrypt" }, "generator": false, @@ -65,181 +20,55 @@ "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } }, { "type": "ClassDeclaration", - "start": 22, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":22,"end":38,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "id": { "type": "Identifier", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "decrypt" - }, + "start":28,"end":35,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":13},"identifierName":"decrypt"}, "name": "decrypt" }, "superClass": null, "body": { "type": "ClassBody", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":36,"end":38,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "body": [] } }, { "type": "ExportNamedDeclaration", - "start": 39, - "end": 73, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 34 - } - }, + "start":39,"end":73,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":34}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 48, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":48,"end":55,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":16}}, "local": { "type": "Identifier", - "start": 48, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":48,"end":55,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":16},"identifierName":"encrypt"}, "name": "encrypt" }, "exported": { "type": "Identifier", - "start": 48, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":48,"end":55,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":16},"identifierName":"encrypt"}, "name": "encrypt" } }, { "type": "ExportSpecifier", - "start": 57, - "end": 71, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 32 - } - }, + "start":57,"end":71,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":32}}, "local": { "type": "Identifier", - "start": 57, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 25 - }, - "identifierName": "decrypt" - }, + "start":57,"end":64,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":25},"identifierName":"decrypt"}, "name": "decrypt" }, "exported": { "type": "Identifier", - "start": 68, - "end": 71, - "loc": { - "start": { - "line": 3, - "column": 29 - }, - "end": { - "line": 3, - "column": 32 - }, - "identifierName": "dec" - }, + "start":68,"end":71,"loc":{"start":{"line":3,"column":29},"end":{"line":3,"column":32},"identifierName":"dec"}, "name": "dec" } } 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 c8c90942d5..055a0e3f11 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/9/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/9/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "test" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"test"}, "name": "test" }, "generator": false, @@ -65,47 +20,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":16,"end":37,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":37}}, "body": [ { "type": "ExpressionStatement", - "start": 31, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":31,"end":35,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":35}}, "expression": { "type": "NumericLiteral", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":31,"end":34,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":34}}, "extra": { "rawValue": 0, "raw": "0O0" @@ -117,32 +39,10 @@ "directives": [ { "type": "Directive", - "start": 17, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":17,"end":30,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":30}}, "value": { "type": "DirectiveLiteral", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/90/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/90/output.json index 2c1db06fce..801c6010cd 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/90/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/90/output.json @@ -1,120 +1,41 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "declaration": null, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, "local": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "default" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"default"}, "name": "default" }, "exported": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "default" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"default"}, "name": "default" } } ], "source": { "type": "StringLiteral", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}}, "extra": { "rawValue": "other", "raw": "\"other\"" }, "value": "other" - } + }, + "declaration": null } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/91/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/91/output.json index 12c4be4224..7a55897d48 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/91/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/91/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [], "source": { "type": "StringLiteral", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "extra": { "rawValue": "jquery", "raw": "\"jquery\"" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/92/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/92/output.json index 30cae98f64..3e36b1ca77 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/92/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/92/output.json @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "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}}, "local": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "$" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"$"}, "name": "$" } } ], "source": { "type": "StringLiteral", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":14,"end":22,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":22}}, "extra": { "rawValue": "jquery", "raw": "\"jquery\"" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/93/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/93/output.json index 4591fadf23..6f8d6a6525 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/93/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/93/output.json @@ -1,162 +1,48 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, "imported": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"encrypt"}, "name": "encrypt" }, "local": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"encrypt"}, "name": "encrypt" } }, { "type": "ImportSpecifier", - "start": 18, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":18,"end":25,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":25}}, "imported": { "type": "Identifier", - "start": 18, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "decrypt" - }, + "start":18,"end":25,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":25},"identifierName":"decrypt"}, "name": "decrypt" }, "local": { "type": "Identifier", - "start": 18, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "decrypt" - }, + "start":18,"end":25,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":25},"identifierName":"decrypt"}, "name": "decrypt" } } ], "source": { "type": "StringLiteral", - "start": 33, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":33,"end":41,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":41}}, "extra": { "rawValue": "crypto", "raw": "\"crypto\"" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/94/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/94/output.json index f2cd05d585..e36df8cbfd 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/94/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/94/output.json @@ -1,113 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "imported": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "encrypt" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"encrypt"}, "name": "encrypt" }, "local": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "enc" - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23},"identifierName":"enc"}, "name": "enc" } } ], "source": { "type": "StringLiteral", - "start": 31, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":31,"end":39,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":39}}, "extra": { "rawValue": "crypto", "raw": "\"crypto\"" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/95/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/95/output.json index 4d1f5f67a5..a391944e5a 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/95/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/95/output.json @@ -1,194 +1,57 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "local": { "type": "Identifier", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "crypto" - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13},"identifierName":"crypto"}, "name": "crypto" } }, { "type": "ImportSpecifier", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}}, "imported": { "type": "Identifier", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "decrypt" - }, + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24},"identifierName":"decrypt"}, "name": "decrypt" }, "local": { "type": "Identifier", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "decrypt" - }, + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24},"identifierName":"decrypt"}, "name": "decrypt" } }, { "type": "ImportSpecifier", - "start": 26, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":26,"end":40,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":40}}, "imported": { "type": "Identifier", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "encrypt" - }, + "start":26,"end":33,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":33},"identifierName":"encrypt"}, "name": "encrypt" }, "local": { "type": "Identifier", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "enc" - }, + "start":37,"end":40,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":40},"identifierName":"enc"}, "name": "enc" } } ], "source": { "type": "StringLiteral", - "start": 48, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":48,"end":56,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":56}}, "extra": { "rawValue": "crypto", "raw": "\"crypto\"" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/97/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/97/output.json index d589597abf..0c902bf05c 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/97/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/97/output.json @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":9,"end":20,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":20}}, "imported": { "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" }, "local": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "nil" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"nil"}, "name": "nil" } } ], "source": { "type": "StringLiteral", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" diff --git a/packages/babel-parser/test/fixtures/es2015/uncategorised/98/output.json b/packages/babel-parser/test/fixtures/es2015/uncategorised/98/output.json index 6e021038f2..628f749c47 100644 --- a/packages/babel-parser/test/fixtures/es2015/uncategorised/98/output.json +++ b/packages/babel-parser/test/fixtures/es2015/uncategorised/98/output.json @@ -1,96 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportNamespaceSpecifier", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "local": { "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "crypto" - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18},"identifierName":"crypto"}, "name": "crypto" } } ], "source": { "type": "StringLiteral", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":24,"end":32,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":32}}, "extra": { "rawValue": "crypto", "raw": "\"crypto\"" diff --git a/packages/babel-parser/test/fixtures/es2015/yield/accessor-name-inst-computed-yield-expr/output.json b/packages/babel-parser/test/fixtures/es2015/yield/accessor-name-inst-computed-yield-expr/output.json index 1082894c21..f2e281db8d 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/accessor-name-inst-computed-yield-expr/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/accessor-name-inst-computed-yield-expr/output.json @@ -1,144 +1,42 @@ { "type": "File", - "start": 0, - "end": 155, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":155,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 155, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":155,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "yieldSet" - }, + "start":4,"end":12,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":12},"identifierName":"yieldSet"}, "name": "yieldSet" }, "init": null }, { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "C" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"C"}, "name": "C" }, "init": null }, { "type": "VariableDeclarator", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "iter" - }, + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21},"identifierName":"iter"}, "name": "iter" }, "init": null @@ -148,33 +46,10 @@ }, { "type": "FunctionDeclaration", - "start": 23, - "end": 155, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":23,"end":155,"loc":{"start":{"line":2,"column":0},"end":{"line":9,"column":1}}, "id": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "g" - }, + "start":33,"end":34,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -182,95 +57,28 @@ "params": [], "body": { "type": "BlockStatement", - "start": 37, - "end": 155, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":37,"end":155,"loc":{"start":{"line":2,"column":14},"end":{"line":9,"column":1}}, "body": [ { "type": "ClassDeclaration", - "start": 41, - "end": 142, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":41,"end":142,"loc":{"start":{"line":3,"column":2},"end":{"line":6,"column":3}}, "id": { "type": "Identifier", - "start": 47, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "C_" - }, + "start":47,"end":49,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":10},"identifierName":"C_"}, "name": "C_" }, "superClass": null, "body": { "type": "ClassBody", - "start": 50, - "end": 142, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":50,"end":142,"loc":{"start":{"line":3,"column":11},"end":{"line":6,"column":3}}, "body": [ { "type": "ClassMethod", - "start": 56, - "end": 93, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 41 - } - }, + "start":56,"end":93,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":41}}, "static": false, "key": { "type": "YieldExpression", - "start": 61, - "end": 66, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":61,"end":66,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":14}}, "delegate": false, "argument": null }, @@ -282,47 +90,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 70, - "end": 93, - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 41 - } - }, + "start":70,"end":93,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":41}}, "body": [ { "type": "ReturnStatement", - "start": 72, - "end": 91, - "loc": { - "start": { - "line": 4, - "column": 20 - }, - "end": { - "line": 4, - "column": 39 - } - }, + "start":72,"end":91,"loc":{"start":{"line":4,"column":20},"end":{"line":4,"column":39}}, "argument": { "type": "StringLiteral", - "start": 79, - "end": 90, - "loc": { - "start": { - "line": 4, - "column": 27 - }, - "end": { - "line": 4, - "column": 38 - } - }, + "start":79,"end":90,"loc":{"start":{"line":4,"column":27},"end":{"line":4,"column":38}}, "extra": { "rawValue": "get yield", "raw": "'get yield'" @@ -336,33 +111,11 @@ }, { "type": "ClassMethod", - "start": 98, - "end": 138, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 44 - } - }, + "start":98,"end":138,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":44}}, "static": false, "key": { "type": "YieldExpression", - "start": 103, - "end": 108, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 14 - } - }, + "start":103,"end":108,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":14}}, "delegate": false, "argument": null }, @@ -374,98 +127,29 @@ "params": [ { "type": "Identifier", - "start": 110, - "end": 115, - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 5, - "column": 21 - }, - "identifierName": "param" - }, + "start":110,"end":115,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":21},"identifierName":"param"}, "name": "param" } ], "body": { "type": "BlockStatement", - "start": 117, - "end": 138, - "loc": { - "start": { - "line": 5, - "column": 23 - }, - "end": { - "line": 5, - "column": 44 - } - }, + "start":117,"end":138,"loc":{"start":{"line":5,"column":23},"end":{"line":5,"column":44}}, "body": [ { "type": "ExpressionStatement", - "start": 119, - "end": 136, - "loc": { - "start": { - "line": 5, - "column": 25 - }, - "end": { - "line": 5, - "column": 42 - } - }, + "start":119,"end":136,"loc":{"start":{"line":5,"column":25},"end":{"line":5,"column":42}}, "expression": { "type": "AssignmentExpression", - "start": 119, - "end": 135, - "loc": { - "start": { - "line": 5, - "column": 25 - }, - "end": { - "line": 5, - "column": 41 - } - }, + "start":119,"end":135,"loc":{"start":{"line":5,"column":25},"end":{"line":5,"column":41}}, "operator": "=", "left": { "type": "Identifier", - "start": 119, - "end": 127, - "loc": { - "start": { - "line": 5, - "column": 25 - }, - "end": { - "line": 5, - "column": 33 - }, - "identifierName": "yieldSet" - }, + "start":119,"end":127,"loc":{"start":{"line":5,"column":25},"end":{"line":5,"column":33},"identifierName":"yieldSet"}, "name": "yieldSet" }, "right": { "type": "Identifier", - "start": 130, - "end": 135, - "loc": { - "start": { - "line": 5, - "column": 36 - }, - "end": { - "line": 5, - "column": 41 - }, - "identifierName": "param" - }, + "start":130,"end":135,"loc":{"start":{"line":5,"column":36},"end":{"line":5,"column":41},"identifierName":"param"}, "name": "param" } } @@ -479,65 +163,19 @@ }, { "type": "ExpressionStatement", - "start": 146, - "end": 153, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 9 - } - }, + "start":146,"end":153,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":9}}, "expression": { "type": "AssignmentExpression", - "start": 146, - "end": 152, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 8 - } - }, + "start":146,"end":152,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":8}}, "operator": "=", "left": { "type": "Identifier", - "start": 146, - "end": 147, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 3 - }, - "identifierName": "C" - }, + "start":146,"end":147,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":3},"identifierName":"C"}, "name": "C" }, "right": { "type": "Identifier", - "start": 150, - "end": 152, - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 8 - }, - "identifierName": "C_" - }, + "start":150,"end":152,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":8},"identifierName":"C_"}, "name": "C_" } } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/asi/output.json b/packages/babel-parser/test/fixtures/es2015/yield/asi/output.json index ca699a6363..3f78b0f9d2 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/asi/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/asi/output.json @@ -1,142 +1,42 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":1,"end":25,"loc":{"start":{"line":1,"column":1},"end":{"line":2,"column":3}}, "id": null, "generator": true, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":14,"end":25,"loc":{"start":{"line":1,"column":14},"end":{"line":2,"column":3}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "expression": { "type": "YieldExpression", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "delegate": false, "argument": null } }, { "type": "ExpressionStatement", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1}}, "expression": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "v" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"v"}, "name": "v" } } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/asi2/output.json b/packages/babel-parser/test/fixtures/es2015/yield/asi2/output.json index 2d86b5998e..de3e5e33b0 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/asi2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/asi2/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "f" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"f"}, "name": "f" }, "generator": true, @@ -65,96 +20,30 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":14,"end":30,"loc":{"start":{"line":1,"column":14},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "expression": { "type": "YieldExpression", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "delegate": false, "argument": null } }, { "type": "BlockStatement", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "body": [], "directives": [] }, { "type": "ExpressionStatement", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":24,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "expression": { "type": "RegExpLiteral", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":24,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "extra": { "raw": "/1/g" }, diff --git a/packages/babel-parser/test/fixtures/es2015/yield/basic-with-argument/output.json b/packages/babel-parser/test/fixtures/es2015/yield/basic-with-argument/output.json index 2a22f3aa8f..00ab717c3a 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/basic-with-argument/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/basic-with-argument/output.json @@ -1,125 +1,36 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":1,"end":25,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":25}}, "id": null, "generator": true, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":14,"end":25,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":25}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":16,"end":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23}}, "expression": { "type": "YieldExpression", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":16,"end":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23}}, "delegate": false, "argument": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "v" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"v"}, "name": "v" } } 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 20b6ee4b6a..585d9f7a1a 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 @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,93 +20,25 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":16,"end":39,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":39}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":18,"end":37,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":37}}, "expression": { "type": "CallExpression", - "start": 18, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":18,"end":36,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":36}}, "callee": { "type": "MemberExpression", - "start": 18, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":18,"end":29,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":29}}, "object": { "type": "Identifier", - "start": 18, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "console" - }, + "start":18,"end":25,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":25},"identifierName":"console"}, "name": "console" }, "property": { "type": "Identifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "log" - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29},"identifierName":"log"}, "name": "log" }, "computed": false @@ -159,18 +46,7 @@ "arguments": [ { "type": "YieldExpression", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35}}, "delegate": false, "argument": null } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-class-wrapped/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-class-wrapped/output.json index c646340e65..fc0de38bd9 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-class-wrapped/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-class-wrapped/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "wrap" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"wrap"}, "name": "wrap" }, "generator": true, @@ -65,97 +20,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":17,"end":46,"loc":{"start":{"line":1,"column":17},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassDeclaration", - "start": 23, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":23,"end":44,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":25}}, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "A" - }, + "start":29,"end":30,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 31, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":31,"end":44,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":25}}, "body": [ { "type": "ClassMethod", - "start": 32, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":32,"end":43,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":24}}, "static": false, "kind": "method", "key": { "type": "Identifier", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "yield" - }, + "start":33,"end":38,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":19},"identifierName":"yield"}, "name": "yield" }, "computed": false, @@ -165,18 +52,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":41,"end":43,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":24}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/output.json index a545b4a024..ced2dbfb67 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration-inside-generator/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Can not use 'yield' as identifier inside a generator (2:11)" ], "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":15,"end":40,"loc":{"start":{"line":1,"column":15},"end":{"line":3,"column":1}}, "body": [ { "type": "FunctionDeclaration", - "start": 19, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":19,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "id": { "type": "Identifier", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "yield" - }, + "start":28,"end":33,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":16},"identifierName":"yield"}, "name": "yield" }, "generator": false, @@ -117,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":36,"end":38,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration/output.json index de221659f0..f339b4a15f 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-declaration/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "yield" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"yield"}, "name": "yield" }, "generator": false, @@ -65,18 +20,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-expression-inside-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-expression-inside-generator/output.json index 0b39f18573..76ba81501b 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-expression-inside-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-expression-inside-generator/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -65,62 +20,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":15,"end":43,"loc":{"start":{"line":1,"column":15},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":19,"end":41,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":24}}, "expression": { "type": "FunctionExpression", - "start": 20, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":20,"end":39,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":22}}, "id": { "type": "Identifier", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "yield" - }, + "start":29,"end":34,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":17},"identifierName":"yield"}, "name": "yield" }, "generator": false, @@ -128,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":37,"end":39,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":22}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-expression/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-expression/output.json index bffc0911fd..23b3d59c7d 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-expression/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "UnaryExpression", - "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}}, "operator": "+", "prefix": true, "argument": { "type": "FunctionExpression", - "start": 1, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":1,"end":20,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "yield" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"yield"}, "name": "yield" }, "generator": false, @@ -95,18 +28,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-method/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-method/output.json index e30fc7f279..e6390c43b0 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-method/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-function-method/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":24,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "yield" - }, + "start":12,"end":17,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7},"identifierName":"yield"}, "name": "yield" }, "computed": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":20,"end":22,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":12}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-declaration/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-declaration/output.json index 8bbaf72055..de589f46ac 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-declaration/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-declaration/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "yield" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"yield"}, "name": "yield" }, "generator": true, @@ -65,18 +20,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/output.json index 39554296d4..0026ac0e93 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-expression/output.json @@ -1,96 +1,29 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:11)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "UnaryExpression", - "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}}, "operator": "+", "prefix": true, "argument": { "type": "FunctionExpression", - "start": 1, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":1,"end":21,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "yield" - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"yield"}, "name": "yield" }, "generator": true, @@ -98,18 +31,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-method/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-method/output.json index fa4df3c82a..b5a527721e 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-method/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-method/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":25,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "static": false, "kind": "method", "key": { "type": "Identifier", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "yield" - }, + "start":13,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":8},"identifierName":"yield"}, "name": "yield" }, "computed": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":21,"end":23,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-wrapped/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-wrapped/output.json index 6856b64eb1..27e8f94561 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-wrapped/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-generator-wrapped/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "wrap" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"wrap"}, "name": "wrap" }, "generator": true, @@ -65,78 +20,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":17,"end":40,"loc":{"start":{"line":1,"column":17},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 23, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":23,"end":38,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":19}}, "expression": { "type": "ObjectExpression", - "start": 24, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":24,"end":37,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":18}}, "properties": [ { "type": "ObjectMethod", - "start": 25, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":25,"end":36,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":17}}, "method": true, "key": { "type": "Identifier", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "yield" - }, + "start":26,"end":31,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":12},"identifierName":"yield"}, "name": "yield" }, "computed": false, @@ -147,18 +46,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":34,"end":36,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":17}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/function-name-inside-function/output.json b/packages/babel-parser/test/fixtures/es2015/yield/function-name-inside-function/output.json index b70dd7de39..096d8e3272 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/function-name-inside-function/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/function-name-inside-function/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "fn" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -65,48 +20,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":14,"end":39,"loc":{"start":{"line":1,"column":14},"end":{"line":3,"column":1}}, "body": [ { "type": "FunctionDeclaration", - "start": 18, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":18,"end":37,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "id": { "type": "Identifier", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "yield" - }, + "start":27,"end":32,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":16},"identifierName":"yield"}, "name": "yield" }, "generator": false, @@ -114,18 +35,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":35,"end":37,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } 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 1a8500a416..8b8e3b1ff8 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ "SyntaxError: Binding 'yield' in strict mode (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "yield" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"yield"}, "name": "yield" }, "generator": false, @@ -68,48 +23,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":17,"end":34,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":34}}, "body": [], "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 19d96b67a3..bd1a026701 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (2:9)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":14,"end":33,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "id": { "type": "Identifier", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "yield" - }, + "start":23,"end":28,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":14},"identifierName":"yield"}, "name": "yield" }, "generator": false, @@ -68,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":31,"end":33,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":19}}, "body": [], "directives": [] } @@ -88,32 +32,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/input-not-followed-by-regex/output.json b/packages/babel-parser/test/fixtures/es2015/yield/input-not-followed-by-regex/output.json index 7b6b61f8c0..3aed36c563 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/input-not-followed-by-regex/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/input-not-followed-by-regex/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "f2" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"f2"}, "name": "f2" }, "generator": true, @@ -65,97 +20,30 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":15,"end":34,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":34}}, "body": [ { "type": "ExpressionStatement", - "start": 17, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":17,"end":32,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":32}}, "expression": { "type": "ArrowFunctionExpression", - "start": 17, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":17,"end":32,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":32}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BinaryExpression", - "start": 23, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":23,"end":32,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":32}}, "left": { "type": "Identifier", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "yield" - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28},"identifierName":"yield"}, "name": "yield" }, "operator": "/", "right": { "type": "NumericLiteral", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2015/yield/inside-arrow-inside-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/inside-arrow-inside-generator/output.json index 389fa52e3a..10e73e0e56 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/inside-arrow-inside-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/inside-arrow-inside-generator/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -65,146 +20,45 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":15,"end":52,"loc":{"start":{"line":1,"column":15},"end":{"line":4,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":19,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "expression": { "type": "ArrowFunctionExpression", - "start": 19, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":19,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "Identifier", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "yield" - }, + "start":25,"end":30,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":13},"identifierName":"yield"}, "name": "yield" } } }, { "type": "ExpressionStatement", - "start": 34, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":34,"end":50,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":18}}, "expression": { "type": "ArrowFunctionExpression", - "start": 34, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":34,"end":49,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":17}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 40, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":40,"end":49,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":17}}, "body": [ { "type": "ExpressionStatement", - "start": 42, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":42,"end":47,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":15}}, "expression": { "type": "Identifier", - "start": 42, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "yield" - }, + "start":42,"end":47,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":15},"identifierName":"yield"}, "name": "yield" } } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-arrow-inside-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-arrow-inside-generator/output.json index ff8ef77873..3ae9600e17 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-arrow-inside-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-arrow-inside-generator/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -65,133 +20,43 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":15,"end":45,"loc":{"start":{"line":1,"column":15},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":19,"end":43,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":26}}, "expression": { "type": "ArrowFunctionExpression", - "start": 19, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":19,"end":42,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":25}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "ArrowFunctionExpression", - "start": 25, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":25,"end":42,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":25}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":26,"end":35,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":18}}, "left": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "x" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"x"}, "name": "x" }, "right": { "type": "Identifier", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "yield" - }, + "start":30,"end":35,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18},"identifierName":"yield"}, "name": "yield" } } ], "body": { "type": "BlockStatement", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":40,"end":42,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/output.json index 6639d749ab..7fb0d2ac2c 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-1/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:7)" ], "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -68,96 +23,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":15,"end":39,"loc":{"start":{"line":1,"column":15},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":19,"end":37,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "expression": { "type": "ArrowFunctionExpression", - "start": 19, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":19,"end":36,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":20,"end":29,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":12}}, "left": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" }, "right": { "type": "YieldExpression", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":24,"end":29,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":12}}, "delegate": false, "argument": null } @@ -165,18 +53,7 @@ ], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":34,"end":36,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/output.json index b029ca9f0c..f526c32520 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-2/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:15)" ], "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -68,110 +23,32 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":15,"end":53,"loc":{"start":{"line":1,"column":15},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":19,"end":51,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":34}}, "expression": { "type": "ArrowFunctionExpression", - "start": 19, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":19,"end":50,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":33}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 20, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":20,"end":43,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":26}}, "left": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" }, "right": { "type": "BinaryExpression", - "start": 24, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":24,"end":43,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":26}}, "left": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "extra": { "rawValue": 3, "raw": "3" @@ -181,78 +58,21 @@ "operator": "+", "right": { "type": "BinaryExpression", - "start": 28, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":28,"end":43,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":26}}, "left": { "type": "CallExpression", - "start": 28, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":28,"end":38,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":21}}, "callee": { "type": "MemberExpression", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":28,"end":31,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14}}, "object": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "a" - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "b" - }, + "start":30,"end":31,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"b"}, "name": "b" }, "computed": false @@ -260,18 +80,7 @@ "arguments": [ { "type": "YieldExpression", - "start": 32, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":32,"end":37,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":20}}, "delegate": false, "argument": null } @@ -280,18 +89,7 @@ "operator": "**", "right": { "type": "NumericLiteral", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":42,"end":43,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":26}}, "extra": { "rawValue": 2, "raw": "2" @@ -304,18 +102,7 @@ ], "body": { "type": "BlockStatement", - "start": 48, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 31 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":48,"end":50,"loc":{"start":{"line":2,"column":31},"end":{"line":2,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/output.json index 7ce61876e0..f6e29bf0fd 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-3/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:7)" ], "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -68,112 +23,33 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":15,"end":42,"loc":{"start":{"line":1,"column":15},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":19,"end":40,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":23}}, "expression": { "type": "ArrowFunctionExpression", - "start": 19, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":19,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":22}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 20, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":20,"end":32,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":15}}, "left": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" }, "right": { "type": "YieldExpression", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":24,"end":32,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":15}}, "delegate": false, "argument": { "type": "Identifier", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "fn" - }, + "start":30,"end":32,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15},"identifierName":"fn"}, "name": "fn" } } @@ -181,18 +57,7 @@ ], "body": { "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":37,"end":39,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/output.json index e88af5b40a..427ec4363f 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-4/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:17)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -68,113 +23,34 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":15,"end":49,"loc":{"start":{"line":1,"column":15},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":19,"end":47,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":30}}, "expression": { "type": "ArrowFunctionExpression", - "start": 19, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":19,"end":46,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":29}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "a" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"a"}, "name": "a" }, { "type": "AssignmentPattern", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":23,"end":28,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":11}}, "left": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "b" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"b"}, "name": "b" }, "right": { "type": "NumericLiteral", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, "extra": { "rawValue": 3, "raw": "3" @@ -184,49 +60,15 @@ }, { "type": "AssignmentPattern", - "start": 30, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":30,"end":39,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":22}}, "left": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "x" - }, + "start":30,"end":31,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"x"}, "name": "x" }, "right": { "type": "YieldExpression", - "start": 34, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":34,"end":39,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":22}}, "delegate": false, "argument": null } @@ -234,18 +76,7 @@ ], "body": { "type": "BlockStatement", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":44,"end":46,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json index 30bb59f8c6..4f2ee50da9 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow-inside-generator-5/output.json @@ -1,67 +1,22 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:8)", "SyntaxError: Binding invalid left-hand side in function parameter list (2:8)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -69,132 +24,43 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":15,"end":47,"loc":{"start":{"line":1,"column":15},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":19,"end":45,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":28}}, "expression": { "type": "ArrowFunctionExpression", - "start": 19, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":19,"end":44,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":27}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 20, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":20,"end":37,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":20}}, "left": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" }, "right": { "type": "ArrowFunctionExpression", - "start": 24, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":24,"end":37,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":20}}, "id": null, "generator": false, "async": false, "params": [ { "type": "YieldExpression", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":25,"end":30,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":13}}, "delegate": false, "argument": null } ], "body": { "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":35,"end":37,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}}, "body": [], "directives": [] } @@ -203,18 +69,7 @@ ], "body": { "type": "BlockStatement", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":42,"end":44,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":27}}, "body": [], "directives": [] } 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 ce92441a57..b78292c799 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:8)" ], "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -68,96 +23,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":15,"end":41,"loc":{"start":{"line":1,"column":15},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":19,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":22}}, "expression": { "type": "ArrowFunctionExpression", - "start": 19, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":19,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":20,"end":31,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":14}}, "left": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" }, "right": { "type": "YieldExpression", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":25,"end":30,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":13}}, "delegate": false, "argument": null, "extra": { @@ -169,18 +57,7 @@ ], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":36,"end":38,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow/output.json index 69a580ede4..6b7cee11c5 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-arrow/output.json @@ -1,130 +1,40 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, "left": { "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" }, "right": { "type": "Identifier", - "start": 5, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "yield" - }, + "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10},"identifierName":"yield"}, "name": "yield" } } ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-function-inside-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-function-inside-generator/output.json index 9e2b85b224..85fdc2e087 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-function-inside-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-function-inside-generator/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -65,48 +20,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":15,"end":47,"loc":{"start":{"line":1,"column":15},"end":{"line":3,"column":1}}, "body": [ { "type": "FunctionDeclaration", - "start": 19, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":19,"end":45,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":28}}, "id": { "type": "Identifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "fn2" - }, + "start":28,"end":31,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"fn2"}, "name": "fn2" }, "generator": false, @@ -114,68 +35,22 @@ "params": [ { "type": "AssignmentPattern", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":32,"end":41,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":24}}, "left": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "x" - }, + "start":32,"end":33,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16},"identifierName":"x"}, "name": "x" }, "right": { "type": "Identifier", - "start": 36, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "yield" - }, + "start":36,"end":41,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":24},"identifierName":"yield"}, "name": "yield" } } ], "body": { "type": "BlockStatement", - "start": 43, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":43,"end":45,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":28}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-function/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-function/output.json index 7db0a927b5..e4dbca6d99 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-function/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-function/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "fn" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -65,68 +20,22 @@ "params": [ { "type": "AssignmentPattern", - "start": 12, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":12,"end":21,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":21}}, "left": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" }, "right": { "type": "Identifier", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "yield" - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21},"identifierName":"yield"}, "name": "yield" } } ], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } 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 a2234a6938..b26aaee3a5 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 @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ "SyntaxError: yield is not allowed in generator parameters (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":1,"end":26,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":3,"end":24,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":24}}, "method": true, "key": { "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "method" - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10},"identifierName":"method"}, "name": "method" }, "computed": false, @@ -101,49 +34,15 @@ "params": [ { "type": "AssignmentPattern", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20}}, "left": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "right": { "type": "YieldExpression", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "delegate": false, "argument": null } @@ -151,18 +50,7 @@ ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/output.json index b21c88bc4f..4d69a77ac2 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-default-inside-generator/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ "SyntaxError: yield is not allowed in generator parameters (1:17)" ], "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -68,49 +23,15 @@ "params": [ { "type": "AssignmentPattern", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":13,"end":22,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":22}}, "left": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"x"}, "name": "x" }, "right": { "type": "YieldExpression", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "delegate": false, "argument": null } @@ -118,18 +39,7 @@ ], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] } 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 e051b9ac13..edd07f81cc 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (2:16)" ], "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":14,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":25}}, "id": { "type": "Identifier", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "fn" - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -68,68 +23,22 @@ "params": [ { "type": "AssignmentPattern", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":26,"end":35,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":21}}, "left": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "x" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"x"}, "name": "x" }, "right": { "type": "Identifier", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 21 - }, - "identifierName": "yield" - }, + "start":30,"end":35,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":21},"identifierName":"yield"}, "name": "yield" } } ], "body": { "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":37,"end":39,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":25}}, "body": [], "directives": [] } @@ -138,32 +47,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-arrow-inside-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-arrow-inside-generator/output.json index e8b351c393..8c9639d859 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-arrow-inside-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-arrow-inside-generator/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -65,101 +20,34 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":15,"end":41,"loc":{"start":{"line":1,"column":15},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":19,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":22}}, "expression": { "type": "ArrowFunctionExpression", - "start": 19, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":19,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "ArrowFunctionExpression", - "start": 25, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":25,"end":38,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":21}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "yield" - }, + "start":26,"end":31,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":14},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":36,"end":38,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json index 1bec942c71..ff99d56fa4 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-1/output.json @@ -1,67 +1,22 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:3)", "SyntaxError: Binding invalid left-hand side in function parameter list (2:3)" ], "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -69,83 +24,28 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":15,"end":35,"loc":{"start":{"line":1,"column":15},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":19,"end":33,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "expression": { "type": "ArrowFunctionExpression", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":19,"end":32,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "id": null, "generator": false, "async": false, "params": [ { "type": "YieldExpression", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":20,"end":25,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":8}}, "delegate": false, "argument": null } ], "body": { "type": "BlockStatement", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":30,"end":32,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json index 3c16beba8c..fae1c616f0 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-2/output.json @@ -1,67 +1,22 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:3)", "SyntaxError: Binding invalid left-hand side in function parameter list (2:3)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -69,99 +24,32 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":15,"end":38,"loc":{"start":{"line":1,"column":15},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":19,"end":36,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "expression": { "type": "ArrowFunctionExpression", - "start": 19, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":19,"end":35,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, "id": null, "generator": false, "async": false, "params": [ { "type": "YieldExpression", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":20,"end":28,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":11}}, "delegate": false, "argument": { "type": "Identifier", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "fn" - }, + "start":26,"end":28,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11},"identifierName":"fn"}, "name": "fn" } } ], "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":33,"end":35,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json index 18209649f3..6e589aab51 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-inside-generator-3/output.json @@ -1,67 +1,22 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (2:9)", "SyntaxError: Binding invalid left-hand side in function parameter list (2:9)" ], "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -69,117 +24,38 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":15,"end":41,"loc":{"start":{"line":1,"column":15},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":19,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":22}}, "expression": { "type": "ArrowFunctionExpression", - "start": 19, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":19,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "a" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "b" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"b"}, "name": "b" }, { "type": "YieldExpression", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":26,"end":31,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":14}}, "delegate": false, "argument": null } ], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":36,"end":38,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-no-parens/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-no-parens/output.json index 129088f1e5..1f57152ef8 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-no-parens/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow-no-parens/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "yield" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow/output.json index b92e9f00f4..afc2aa68b0 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-arrow/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "yield" - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "BlockStatement", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-function/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-function/output.json index 38dba1c200..7ad59c55b4 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-function/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-function/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "fn" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -65,36 +20,13 @@ "params": [ { "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "yield" - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } 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 2a15b906e9..94529c93e1 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 @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:11)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":1,"end":22,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":3,"end":20,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":20}}, "method": true, "key": { "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "method" - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10},"identifierName":"method"}, "name": "method" }, "computed": false, @@ -101,36 +34,13 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "yield" - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/output.json index a8a1424ee4..e26adaef5c 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/parameter-name-generator/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:13)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -68,36 +23,13 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "yield" - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } 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 ad17fc3ec4..a5d721d8ec 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Binding 'yield' in strict mode (1:12)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "fn" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -68,66 +23,21 @@ "params": [ { "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "yield" - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "BlockStatement", - "start": 19, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":19,"end":36,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":36}}, "body": [], "directives": [ { "type": "Directive", - "start": 21, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":21,"end":34,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":34}}, "value": { "type": "DirectiveLiteral", - "start": 21, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, "value": "use strict", "extra": { "raw": "\"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 ac0ac6a92f..e6116f716d 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (2:12)" ], "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":14,"end":35,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":21}}, "id": { "type": "Identifier", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "fn" - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -68,36 +23,13 @@ "params": [ { "type": "Identifier", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "yield" - }, + "start":26,"end":31,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":17},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":33,"end":35,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } @@ -106,32 +38,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2015/yield/yield class/output.json b/packages/babel-parser/test/fixtures/es2015/yield/yield class/output.json index e4526ece76..e7a96f2b27 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/yield class/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/yield class/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "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" }, "generator": true, @@ -65,78 +20,23 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":16,"end":34,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":34}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "expression": { "type": "YieldExpression", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "delegate": false, "argument": { "type": "ClassExpression", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":24,"end":32,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":32}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":30,"end":32,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":32}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/yield-as-identifier/output.json b/packages/babel-parser/test/fixtures/es2015/yield/yield-as-identifier/output.json index b0139b0da8..9af89ad88f 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/yield-as-identifier/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/yield-as-identifier/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "yield" - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9},"identifierName":"yield"}, "name": "yield" }, "init": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-in-arrow-scope-is-multiplication/output.json b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-in-arrow-scope-is-multiplication/output.json index e1dae05be9..7d44ac03c6 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-in-arrow-scope-is-multiplication/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-in-arrow-scope-is-multiplication/output.json @@ -1,130 +1,40 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "e" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"e"}, "name": "e" } ], "body": { "type": "BinaryExpression", - "start": 5, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":5,"end":14,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":14}}, "left": { "type": "Identifier", - "start": 5, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "yield" - }, + "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10},"identifierName":"yield"}, "name": "yield" }, "operator": "*", "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": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-in-global-scope-is-multiplication/output.json b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-in-global-scope-is-multiplication/output.json index 6615c691c1..bd97db9803 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-in-global-scope-is-multiplication/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-in-global-scope-is-multiplication/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "yield" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"yield"}, "name": "yield" }, "operator": "*", "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": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-generator-function-declaration/output.json b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-generator-function-declaration/output.json index 61f2ea2b09..660626e6a8 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-generator-function-declaration/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-generator-function-declaration/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "test" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"test"}, "name": "test" }, "generator": true, @@ -65,63 +20,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "expression": { "type": "YieldExpression", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "delegate": true, "argument": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "v" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"v"}, "name": "v" } } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-generator-function-expression/output.json b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-generator-function-expression/output.json index 91b236468d..7e991ebad1 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-generator-function-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-generator-function-expression/output.json @@ -1,125 +1,36 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":1,"end":26,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}, "id": null, "generator": true, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":16,"end":24,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":24}}, "expression": { "type": "YieldExpression", - "start": 16, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":16,"end":24,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":24}}, "delegate": true, "argument": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "v" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"v"}, "name": "v" } } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-generator-method/output.json b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-generator-method/output.json index 99d39defc2..f1770f76ce 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-generator-method/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-generator-method/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":4,"end":33,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "ObjectExpression", - "start": 8, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":8,"end":33,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":33}}, "properties": [ { "type": "ObjectMethod", - "start": 10, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":10,"end":31,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":31}}, "method": true, "key": { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "test" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"test"}, "name": "test" }, "computed": false, @@ -130,63 +40,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "body": [ { "type": "ExpressionStatement", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "expression": { "type": "YieldExpression", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "delegate": true, "argument": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "v" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"v"}, "name": "v" } } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-plain-function/output.json b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-plain-function/output.json index a551957cda..4b14fc797d 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-plain-function/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-inside-plain-function/output.json @@ -1,141 +1,41 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":1,"end":26,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "body": [ { "type": "ExpressionStatement", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24}}, "expression": { "type": "BinaryExpression", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24}}, "left": { "type": "Identifier", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "yield" - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"yield"}, "name": "yield" }, "operator": "*", "right": { "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": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-function/output.json b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-function/output.json index d9481780b1..fec2cae5e5 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-function/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-function/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "fn" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -65,82 +20,24 @@ "params": [ { "type": "AssignmentPattern", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":12,"end":28,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":28}}, "left": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" }, "right": { "type": "BinaryExpression", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, "left": { "type": "Identifier", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "yield" - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21},"identifierName":"yield"}, "name": "yield" }, "operator": "*", "right": { "type": "Identifier", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "yield" - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28},"identifierName":"yield"}, "name": "yield" } } @@ -148,18 +45,7 @@ ], "body": { "type": "BlockStatement", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":30,"end":32,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":32}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/output.json b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/output.json index 77a0a58b8e..0e6599694f 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/yield-star-parameter-default-inside-generator/output.json @@ -1,67 +1,22 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ "SyntaxError: yield is not allowed in generator parameters (1:17)", "SyntaxError: yield is not allowed in generator parameters (1:24)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "generator": true, @@ -69,64 +24,19 @@ "params": [ { "type": "AssignmentPattern", - "start": 13, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":13,"end":29,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":29}}, "left": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"x"}, "name": "x" }, "right": { "type": "YieldExpression", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "delegate": true, "argument": { "type": "YieldExpression", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29}}, "delegate": false, "argument": null } @@ -135,18 +45,7 @@ ], "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2015/yield/yield-yield/output.json b/packages/babel-parser/test/fixtures/es2015/yield/yield-yield/output.json index bce2a8a321..05b87b7f53 100644 --- a/packages/babel-parser/test/fixtures/es2015/yield/yield-yield/output.json +++ b/packages/babel-parser/test/fixtures/es2015/yield/yield-yield/output.json @@ -1,139 +1,40 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":1,"end":32,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":32}}, "id": null, "generator": true, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":14,"end":32,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":32}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":16,"end":30,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":30}}, "expression": { "type": "YieldExpression", - "start": 16, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":16,"end":30,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":30}}, "delegate": false, "argument": { "type": "YieldExpression", - "start": 22, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":22,"end":30,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":30}}, "delegate": false, "argument": { "type": "NumericLiteral", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "extra": { "rawValue": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/1/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/1/output.json index 192bbad20b..c164041f97 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/1/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/1/output.json @@ -1,76 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "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": 3, "raw": "3" @@ -80,18 +25,7 @@ "operator": "**", "right": { "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": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/output.json index 99a1c0eac6..c0305a64da 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/10/output.json @@ -1,95 +1,29 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "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": "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": 5, "raw": "5" @@ -100,18 +34,7 @@ "operator": "**", "right": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 6, "raw": "6" diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/output.json index 8bfc60ddbd..b71f64505f 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/11/output.json @@ -1,95 +1,29 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "UnaryExpression", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "extra": { "rawValue": 5, "raw": "5", @@ -102,18 +36,7 @@ "operator": "**", "right": { "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": 6, "raw": "6" diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/output.json index 1a7be0b48b..510475c7e4 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/12/output.json @@ -1,95 +1,29 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "left": { "type": "UnaryExpression", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "extra": { "rawValue": 5, "raw": "5" @@ -100,18 +34,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": 6, "raw": "6" diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/output.json index 56e0b17f48..d0582d5840 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/15/output.json @@ -1,109 +1,32 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "UnaryExpression", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "operator": "-", "prefix": true, "argument": { "type": "ParenthesizedExpression", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "extra": { "rawValue": 5, "raw": "5" @@ -115,18 +38,7 @@ "operator": "**", "right": { "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": 6, "raw": "6" diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/output.json index 5fd8ad0e4f..33d3d6fe7f 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/16/output.json @@ -1,109 +1,32 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ParenthesizedExpression", - "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}}, "expression": { "type": "BinaryExpression", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "left": { "type": "UnaryExpression", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "extra": { "rawValue": 5, "raw": "5" @@ -114,18 +37,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": 6, "raw": "6" diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/2/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/2/output.json index e840aecbd1..9083e2542f 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/2/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/2/output.json @@ -1,92 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "UnaryExpression", - "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": "-", "prefix": true, "argument": { "type": "BinaryExpression", - "start": 2, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":2,"end":8,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":8}}, "left": { "type": "NumericLiteral", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "extra": { "rawValue": 5, "raw": "5" @@ -96,18 +30,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": 6, "raw": "6" @@ -124,4 +47,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/3/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/3/output.json index 3b0d6f0acc..c4c070e89a 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/3/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/3/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "a" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"a"}, "name": "a" }, "right": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/4/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/4/output.json index 5c99d2fccb..3ab4831ddd 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/4/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/4/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "squared" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"squared"}, "name": "squared" }, "init": { "type": "BinaryExpression", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}}, "left": { "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" @@ -112,18 +34,7 @@ "operator": "**", "right": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/5/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/5/output.json index b30c8ca494..2cadfcee13 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/5/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/5/output.json @@ -1,76 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "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": 2, "raw": "2" @@ -80,32 +25,10 @@ "operator": "**", "right": { "type": "BinaryExpression", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "left": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 3, "raw": "3" @@ -115,18 +38,7 @@ "operator": "**", "right": { "type": "NumericLiteral", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/6/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/6/output.json index cb363b79da..043af14c0b 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/6/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/6/output.json @@ -1,76 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 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": 2, "raw": "2" @@ -80,32 +25,10 @@ "operator": "**", "right": { "type": "BinaryExpression", - "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": "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": 3, "raw": "3" @@ -115,18 +38,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": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/7/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/7/output.json index 2fb85f363b..bdd1d891d6 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/7/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/7/output.json @@ -1,90 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "left": { "type": "BinaryExpression", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "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": 2, "raw": "2" @@ -94,34 +28,12 @@ "operator": "**", "right": { "type": "UnaryExpression", - "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}}, "operator": "-", "prefix": true, "argument": { "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": 1, "raw": "1" @@ -137,18 +49,7 @@ "operator": "*", "right": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 2, "raw": "2" @@ -160,4 +61,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/8/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/8/output.json index 56c71d7d25..294544806c 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/8/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/8/output.json @@ -1,90 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 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": "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": 2, "raw": "2" @@ -94,34 +28,12 @@ "operator": "**", "right": { "type": "UnaryExpression", - "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}}, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +45,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": 2, "raw": "2" @@ -156,4 +57,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/9/output.json b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/9/output.json index 2691c64337..b01a64d1df 100644 --- a/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/9/output.json +++ b/packages/babel-parser/test/fixtures/es2016/exponentiation-operator/9/output.json @@ -1,92 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "UnaryExpression", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "extra": { "rawValue": 5, "raw": "5" @@ -101,18 +35,7 @@ "operator": "**", "right": { "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": 6, "raw": "6" @@ -124,4 +47,4 @@ ], "directives": [] } -} +} \ No newline at end of file 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 5c66e79b65..d034afbc9b 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,131 +23,41 @@ "params": [ { "type": "AssignmentPattern", - "start": 11, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":11,"end":36,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":36}}, "left": { "type": "ArrayPattern", - "start": 11, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":11,"end":31,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":31}}, "elements": [ { "type": "Identifier", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "option1" - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20},"identifierName":"option1"}, "name": "option1" }, { "type": "Identifier", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "option2" - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"option2"}, "name": "option2" } ] }, "right": { "type": "ArrayExpression", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "elements": [] } } ], "body": { "type": "BlockStatement", - "start": 38, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":38,"end":57,"loc":{"start":{"line":1,"column":38},"end":{"line":3,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 42, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":42,"end":55,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 42, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":42,"end":54,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "value": "use strict", "extra": { "raw": "\"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 21f903177a..35fd2a0adb 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,51 +23,16 @@ "params": [ { "type": "ArrayPattern", - "start": 11, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":11,"end":31,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":31}}, "elements": [ { "type": "Identifier", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "option1" - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20},"identifierName":"option1"}, "name": "option1" }, { "type": "Identifier", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "option2" - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"option2"}, "name": "option2" } ] @@ -120,48 +40,15 @@ ], "body": { "type": "BlockStatement", - "start": 33, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":3,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 37, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":37,"end":50,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 37, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":37,"end":49,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function-concise-body/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function-concise-body/output.json index 132794e783..ef61ee97f3 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function-concise-body/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/arrow-function-concise-body/output.json @@ -1,162 +1,49 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":4,"end":33,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":8,"end":33,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":33}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":21}}, "left": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "options" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"options"}, "name": "options" }, "right": { "type": "ObjectExpression", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "properties": [] } } ], "body": { "type": "Identifier", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "options" - }, + "start":26,"end":33,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":33},"identifierName":"options"}, "name": "options" } } 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 c63422a6be..e10dbf8aa2 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 @@ -1,194 +1,60 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:8)" ], "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":4,"end":45,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":45,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":21}}, "left": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "options" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"options"}, "name": "options" }, "right": { "type": "ObjectExpression", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "properties": [] } } ], "body": { "type": "BlockStatement", - "start": 26, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":26,"end":45,"loc":{"start":{"line":1,"column":26},"end":{"line":3,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 30, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":30,"end":43,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 30, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":30,"end":42,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function-concise-body/output.json b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function-concise-body/output.json index c31ea27b02..12dd6b193f 100644 --- a/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function-concise-body/output.json +++ b/packages/babel-parser/test/fixtures/es2016/simple-parameter-list/async-arrow-function-concise-body/output.json @@ -1,162 +1,49 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":4,"end":39,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":39}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":8,"end":39,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":39}}, "id": null, "generator": false, "async": true, "params": [ { "type": "AssignmentPattern", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "left": { "type": "Identifier", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "options" - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22},"identifierName":"options"}, "name": "options" }, "right": { "type": "ObjectExpression", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "properties": [] } } ], "body": { "type": "Identifier", - "start": 32, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "options" - }, + "start":32,"end":39,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":39},"identifierName":"options"}, "name": "options" } } 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 6183a084c3..2b90608b4c 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 @@ -1,194 +1,60 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:8)" ], "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":4,"end":51,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":51,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "id": null, "generator": false, "async": true, "params": [ { "type": "AssignmentPattern", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "left": { "type": "Identifier", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "options" - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22},"identifierName":"options"}, "name": "options" }, "right": { "type": "ObjectExpression", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "properties": [] } } ], "body": { "type": "BlockStatement", - "start": 32, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":32,"end":51,"loc":{"start":{"line":1,"column":32},"end":{"line":3,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 36, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":36,"end":49,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 36, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":36,"end":48,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "value": "use strict", "extra": { "raw": "\"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 324b53bc26..7e82b95fea 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,97 +23,30 @@ "params": [ { "type": "AssignmentPattern", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "left": { "type": "Identifier", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "options" - }, + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24},"identifierName":"options"}, "name": "options" }, "right": { "type": "ObjectExpression", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "properties": [] } } ], "body": { "type": "BlockStatement", - "start": 31, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":31,"end":50,"loc":{"start":{"line":1,"column":31},"end":{"line":3,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 35, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":35,"end":48,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 35, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":35,"end":47,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "value": "use strict", "extra": { "raw": "\"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 f40df83751..f07a72ed5d 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,97 +23,30 @@ "params": [ { "type": "AssignmentPattern", - "start": 11, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":11,"end":23,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":23}}, "left": { "type": "Identifier", - "start": 11, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "options" - }, + "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18},"identifierName":"options"}, "name": "options" }, "right": { "type": "ObjectExpression", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "properties": [] } } ], "body": { "type": "BlockStatement", - "start": 25, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":25,"end":44,"loc":{"start":{"line":1,"column":25},"end":{"line":3,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 29, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":29,"end":42,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 29, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":29,"end":41,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "value": "use strict", "extra": { "raw": "\"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 4d433d4b0b..a75e2062ef 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "generator": true, @@ -68,97 +23,30 @@ "params": [ { "type": "AssignmentPattern", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}}, "left": { "type": "Identifier", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "options" - }, + "start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19},"identifierName":"options"}, "name": "options" }, "right": { "type": "ObjectExpression", - "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}}, "properties": [] } } ], "body": { "type": "BlockStatement", - "start": 26, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":26,"end":45,"loc":{"start":{"line":1,"column":26},"end":{"line":3,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 30, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":30,"end":43,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 30, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":30,"end":42,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "value": "use strict", "extra": { "raw": "\"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 393540b1fa..2838eba94d 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 @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "errors": [ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":4,"end":57,"loc":{"start":{"line":1,"column":4},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "obj" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"obj"}, "name": "obj" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":10,"end":57,"loc":{"start":{"line":1,"column":10},"end":{"line":5,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 14, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":14,"end":55,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "method": true, "key": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "a" - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -133,97 +43,30 @@ "params": [ { "type": "AssignmentPattern", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":18,"end":30,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":18}}, "left": { "type": "Identifier", - "start": 18, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "options" - }, + "start":18,"end":25,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":13},"identifierName":"options"}, "name": "options" }, "right": { "type": "ObjectExpression", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":28,"end":30,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "properties": [] } } ], "body": { "type": "BlockStatement", - "start": 32, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":32,"end":55,"loc":{"start":{"line":2,"column":20},"end":{"line":4,"column":3}}, "body": [], "directives": [ { "type": "Directive", - "start": 38, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":38,"end":51,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":17}}, "value": { "type": "DirectiveLiteral", - "start": 38, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":38,"end":50,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":16}}, "value": "use strict", "extra": { "raw": "\"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 99d18df924..496683da23 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 @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "errors": [ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (2:3)" ], "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":4,"end":55,"loc":{"start":{"line":1,"column":4},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "obj" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"obj"}, "name": "obj" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":10,"end":55,"loc":{"start":{"line":1,"column":10},"end":{"line":5,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 14, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":14,"end":53,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "method": true, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "a" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -133,97 +43,30 @@ "params": [ { "type": "AssignmentPattern", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":16,"end":28,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}}, "left": { "type": "Identifier", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "options" - }, + "start":16,"end":23,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":11},"identifierName":"options"}, "name": "options" }, "right": { "type": "ObjectExpression", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":26,"end":28,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "properties": [] } } ], "body": { "type": "BlockStatement", - "start": 30, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":30,"end":53,"loc":{"start":{"line":2,"column":18},"end":{"line":4,"column":3}}, "body": [], "directives": [ { "type": "Directive", - "start": 36, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":36,"end":49,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":17}}, "value": { "type": "DirectiveLiteral", - "start": 36, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":36,"end":48,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":16}}, "value": "use strict", "extra": { "raw": "\"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 f6c0442d81..ce4565e35a 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,82 +23,25 @@ "params": [ { "type": "AssignmentPattern", - "start": 11, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":11,"end":36,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":36}}, "left": { "type": "ObjectPattern", - "start": 11, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":11,"end":31,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":31}}, "properties": [ { "type": "ObjectProperty", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "option1" - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20},"identifierName":"option1"}, "name": "option1" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "option1" - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20},"identifierName":"option1"}, "name": "option1" }, "extra": { @@ -152,53 +50,18 @@ }, { "type": "ObjectProperty", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "option2" - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"option2"}, "name": "option2" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "option2" - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"option2"}, "name": "option2" }, "extra": { @@ -209,66 +72,22 @@ }, "right": { "type": "ObjectExpression", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "properties": [] } } ], "body": { "type": "BlockStatement", - "start": 38, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":38,"end":57,"loc":{"start":{"line":1,"column":38},"end":{"line":3,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 42, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":42,"end":55,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 42, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":42,"end":54,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "value": "use strict", "extra": { "raw": "\"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 2089ba375f..c51370c9d6 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,68 +23,22 @@ "params": [ { "type": "ObjectPattern", - "start": 11, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":11,"end":31,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":31}}, "properties": [ { "type": "ObjectProperty", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "option1" - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20},"identifierName":"option1"}, "name": "option1" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "option1" - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20},"identifierName":"option1"}, "name": "option1" }, "extra": { @@ -138,53 +47,18 @@ }, { "type": "ObjectProperty", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "option2" - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"option2"}, "name": "option2" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "option2" - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"option2"}, "name": "option2" }, "extra": { @@ -196,48 +70,15 @@ ], "body": { "type": "BlockStatement", - "start": 33, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":3,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 37, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":37,"end":50,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 37, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":37,"end":49,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "value": "use strict", "extra": { "raw": "\"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 9c23ba0225..6287e33952 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Illegal 'use strict' directive in function with non-simple parameter list (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,81 +23,25 @@ "params": [ { "type": "RestElement", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21}}, "argument": { "type": "Identifier", - "start": 14, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "options" - }, + "start":14,"end":21,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":21},"identifierName":"options"}, "name": "options" } } ], "body": { "type": "BlockStatement", - "start": 23, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":23,"end":42,"loc":{"start":{"line":1,"column":23},"end":{"line":3,"column":1}}, "body": [], "directives": [ { "type": "Directive", - "start": 27, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":27,"end":40,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "value": { "type": "DirectiveLiteral", - "start": 27, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":27,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/1/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/1/output.json index 597fa90b29..e6c4610e6d 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/1/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/1/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": true, "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/11/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/11/output.json index 5056295536..441aa47411 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/11/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/11/output.json @@ -1,95 +1,27 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "async" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"async"}, "name": "async" } }, { "type": "FunctionDeclaration", - "start": 6, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":6,"end":23,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "id": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -97,18 +29,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":21,"end":23,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":17}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/12/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/12/output.json index 56efca553c..f6a637bb56 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/12/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/12/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,80 +20,23 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "promise" - }, + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26},"identifierName":"promise"}, "name": "promise" } ], "body": { "type": "BlockStatement", - "start": 28, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":28,"end":46,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":46}}, "body": [ { "type": "ExpressionStatement", - "start": 30, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":30,"end":44,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":44}}, "expression": { "type": "AwaitExpression", - "start": 30, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":30,"end":43,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":43}}, "argument": { "type": "Identifier", - "start": 36, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "promise" - }, + "start":36,"end":43,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":43},"identifierName":"promise"}, "name": "promise" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/13/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/13/output.json index dca847dd46..c0d40ca4f4 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/13/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/13/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":1,"end":51,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":51}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" } ], "body": { "type": "BlockStatement", - "start": 13, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":13,"end":51,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":51}}, "body": [ { "type": "FunctionDeclaration", - "start": 15, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":15,"end":49,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "inner" - }, + "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35},"identifierName":"inner"}, "name": "inner" }, "generator": false, @@ -130,62 +40,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 38, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":38,"end":49,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":49}}, "body": [ { "type": "ExpressionStatement", - "start": 40, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":40,"end":47,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":47}}, "expression": { "type": "AwaitExpression", - "start": 40, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":40,"end":47,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":47}}, "argument": { "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "x" - }, + "start":46,"end":47,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":47},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/14/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/14/output.json index 7105d5ba25..edb18cfcdf 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/14/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/14/output.json @@ -1,174 +1,50 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":4,"end":52,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":52}}, "id": { "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" }, "init": { "type": "FunctionExpression", - "start": 10, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":10,"end":52,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":52}}, "id": null, "generator": false, "async": true, "params": [ { "type": "Identifier", - "start": 25, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "promise" - }, + "start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32},"identifierName":"promise"}, "name": "promise" } ], "body": { "type": "BlockStatement", - "start": 34, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":34,"end":52,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":52}}, "body": [ { "type": "ExpressionStatement", - "start": 36, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":36,"end":50,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":50}}, "expression": { "type": "AwaitExpression", - "start": 36, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":36,"end":49,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":49}}, "argument": { "type": "Identifier", - "start": 42, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 49 - }, - "identifierName": "promise" - }, + "start":42,"end":49,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":49},"identifierName":"promise"}, "name": "promise" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/15/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/15/output.json index 429d56963c..adaa351c6c 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/15/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/15/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":4,"end":54,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":54}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "o" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"o"}, "name": "o" }, "init": { "type": "ObjectExpression", - "start": 8, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":8,"end":54,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":54}}, "properties": [ { "type": "ObjectProperty", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "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": 1, "raw": "1" @@ -147,34 +46,11 @@ }, { "type": "ObjectMethod", - "start": 16, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":16,"end":52,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":52}}, "method": true, "key": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -185,80 +61,23 @@ "params": [ { "type": "Identifier", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "promise" - }, + "start":26,"end":33,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":33},"identifierName":"promise"}, "name": "promise" } ], "body": { "type": "BlockStatement", - "start": 35, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":35,"end":52,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":52}}, "body": [ { "type": "ExpressionStatement", - "start": 37, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":37,"end":50,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":50}}, "expression": { "type": "AwaitExpression", - "start": 37, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":37,"end":50,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":50}}, "argument": { "type": "Identifier", - "start": 43, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 50 - }, - "identifierName": "promise" - }, + "start":43,"end":50,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":50},"identifierName":"promise"}, "name": "promise" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/16/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/16/output.json index 3cc1f0503c..2c00d10439 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/16/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/16/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":10,"end":50,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":50}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":12,"end":48,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":48}}, "static": false, "key": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "bar" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -116,80 +37,23 @@ "params": [ { "type": "Identifier", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "promise" - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"promise"}, "name": "promise" } ], "body": { "type": "BlockStatement", - "start": 31, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":31,"end":48,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":48}}, "body": [ { "type": "ExpressionStatement", - "start": 33, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":33,"end":46,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":46}}, "expression": { "type": "AwaitExpression", - "start": 33, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":33,"end":46,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":46}}, "argument": { "type": "Identifier", - "start": 39, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "promise" - }, + "start":39,"end":46,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":46},"identifierName":"promise"}, "name": "promise" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/17/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/17/output.json index 5f917cbbc0..c80804bc9e 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/17/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/17/output.json @@ -1,162 +1,48 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "callee": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, { "type": "ArrowFunctionExpression", - "start": 5, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":5,"end":35,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":35}}, "id": null, "generator": false, "async": true, "params": [ { "type": "Identifier", - "start": 11, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "promise" - }, + "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18},"identifierName":"promise"}, "name": "promise" } ], "body": { "type": "AwaitExpression", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":22,"end":35,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":35}}, "argument": { "type": "Identifier", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "promise" - }, + "start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35},"identifierName":"promise"}, "name": "promise" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/18/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/18/output.json index 26729dfbbe..129b29306d 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/18/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/18/output.json @@ -1,174 +1,50 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "callee": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "FunctionExpression", - "start": 2, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":2,"end":43,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":43}}, "id": null, "generator": false, "async": true, "params": [ { "type": "Identifier", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "promise" - }, + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24},"identifierName":"promise"}, "name": "promise" } ], "body": { "type": "BlockStatement", - "start": 26, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":26,"end":43,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":43}}, "body": [ { "type": "ExpressionStatement", - "start": 28, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":28,"end":41,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":41}}, "expression": { "type": "AwaitExpression", - "start": 28, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":28,"end":41,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":41}}, "argument": { "type": "Identifier", - "start": 34, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "promise" - }, + "start":34,"end":41,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":41},"identifierName":"promise"}, "name": "promise" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/19/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/19/output.json index 11f837c1d2..715c8131b5 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/19/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/19/output.json @@ -1,143 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, { "type": "CallExpression", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}}, "callee": { "type": "Identifier", - "start": 5, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "async" - }, + "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10},"identifierName":"async"}, "name": "async" }, "arguments": [ { "type": "NumericLiteral", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "extra": { "rawValue": 1, "raw": "1" @@ -146,18 +44,7 @@ }, { "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" @@ -168,19 +55,7 @@ }, { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "b" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"b"}, "name": "b" } ] diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/2/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/2/output.json index d6708279fd..78391ab5a0 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/2/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/2/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: await* has been removed from the async functions proposal. Use Promise.all() instead. (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "bar" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"bar"}, "name": "bar" }, "generator": false, @@ -68,76 +23,20 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":21,"end":40,"loc":{"start":{"line":1,"column":21},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 25, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":25,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "expression": { "type": "AwaitExpression", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":25,"end":37,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "argument": { "type": "CallExpression", - "start": 32, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":32,"end":37,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":14}}, "callee": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "foo" - }, + "start":32,"end":35,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/20/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/20/output.json index 7493b94dd0..57d50fd7b8 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/20/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/20/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "ok" - }, + "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6},"identifierName":"ok"}, "name": "ok" }, "init": { "type": "CallExpression", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "callee": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "async" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"async"}, "name": "async" }, "arguments": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "x" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/21/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/21/output.json index 5f3d322716..528d37a079 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/21/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/21/output.json @@ -1,125 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":1,"end":37,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":37}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 12, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":12,"end":37,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":37}}, "body": [ { "type": "VariableDeclaration", - "start": 14, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":14,"end":24,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":24}}, "declarations": [ { "type": "VariableDeclarator", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "async" - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23},"identifierName":"async"}, "name": "async" }, "init": null @@ -129,64 +40,19 @@ }, { "type": "ExpressionStatement", - "start": 25, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":25,"end":35,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":35}}, "expression": { "type": "AssignmentExpression", - "start": 25, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":25,"end":35,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":35}}, "operator": "=", "left": { "type": "Identifier", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "async" - }, + "start":25,"end":30,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":30},"identifierName":"async"}, "name": "async" }, "right": { "type": "NumericLiteral", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "extra": { "rawValue": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/22/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/22/output.json index 762d2fceec..63432da84d 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/22/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/22/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "Test" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"Test"}, "name": "Test" }, "superClass": null, "body": { "type": "ClassBody", - "start": 11, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":11,"end":25,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":25}}, "body": [ { "type": "ClassMethod", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":13,"end":23,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":23}}, "static": false, "key": { "type": "Identifier", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "async" - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18},"identifierName":"async"}, "name": "async" }, "computed": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/23/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/23/output.json index 8f07a5227a..ff53c76d85 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/23/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/23/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "obj" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"obj"}, "name": "obj" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":27}}, "properties": [ { "type": "ObjectProperty", - "start": 12, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":12,"end":25,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":25}}, "method": false, "key": { "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "async" - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17},"identifierName":"async"}, "name": "async" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}}, "extra": { "rawValue": "test", "raw": "\"test\"" diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/24/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/24/output.json index 7867e7d8e7..befcd7055b 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/24/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/24/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "obj" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"obj"}, "name": "obj" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":10,"end":24,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":24}}, "properties": [ { "type": "ObjectMethod", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":12,"end":22,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":22}}, "method": true, "key": { "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "async" - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17},"identifierName":"async"}, "name": "async" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/25/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/25/output.json index 5432ec7cac..a4b4f875f1 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/25/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/25/output.json @@ -1,79 +1,23 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 7, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":7,"end":30,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -81,18 +25,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/26/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/26/output.json index aa3160913c..59b59c8b5b 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/26/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/26/output.json @@ -1,211 +1,62 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "callee": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, { "type": "ArrowFunctionExpression", - "start": 5, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":5,"end":32,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":32}}, "id": null, "generator": false, "async": true, "params": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "y" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"y"}, "name": "y" } ], "body": { "type": "AwaitExpression", - "start": 20, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, "argument": { "type": "ArrayExpression", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":26,"end":32,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":32}}, "elements": [ { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "x" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"x"}, "name": "x" }, { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "y" - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"y"}, "name": "y" } ] @@ -214,19 +65,7 @@ }, { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "b" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"b"}, "name": "b" } ] diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/27/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/27/output.json index 5768fef8a7..5f1b2eebf8 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/27/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/27/output.json @@ -1,192 +1,57 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":6,"end":36,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":36}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 12, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":12,"end":36,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":36}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 13, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":13,"end":29,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":29}}, "properties": [ { "type": "ObjectProperty", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "async" - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"async"}, "name": "async" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "left": { "type": "Identifier", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "async" - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"async"}, "name": "async" }, "right": { "type": "BooleanLiteral", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27}}, "value": true } }, @@ -199,18 +64,7 @@ ], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/28/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/28/output.json index 43dd8a794c..dfcc899c1a 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/28/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/28/output.json @@ -1,162 +1,49 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":6,"end":34,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":34}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 12, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":12,"end":34,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":34}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 13, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":13,"end":27,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":27}}, "properties": [ { "type": "ObjectProperty", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":15,"end":25,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":25}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "async" - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"async"}, "name": "async" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "bar" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"bar"}, "name": "bar" } } @@ -165,18 +52,7 @@ ], "body": { "type": "BlockStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/29/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/29/output.json index e2487bab97..4fd39cd120 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/29/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/29/output.json @@ -1,192 +1,57 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":6,"end":41,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":41}}, "id": { "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" }, "init": { "type": "FunctionExpression", - "start": 12, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":12,"end":41,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":41}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 21, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":21,"end":37,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":37}}, "properties": [ { "type": "ObjectProperty", - "start": 23, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, "method": false, "key": { "type": "Identifier", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "async" - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28},"identifierName":"async"}, "name": "async" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 23, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, "left": { "type": "Identifier", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "async" - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28},"identifierName":"async"}, "name": "async" }, "right": { "type": "BooleanLiteral", - "start": 31, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":31,"end":35,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":35}}, "value": true } }, @@ -199,18 +64,7 @@ ], "body": { "type": "BlockStatement", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":39,"end":41,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":41}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/30/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/30/output.json index b1bef6eada..c4992f473c 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/30/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/30/output.json @@ -1,162 +1,49 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":6,"end":39,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":39}}, "id": { "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" }, "init": { "type": "FunctionExpression", - "start": 12, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":12,"end":39,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":39}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 21, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":21,"end":35,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":35}}, "properties": [ { "type": "ObjectProperty", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":23,"end":33,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":33}}, "method": false, "key": { "type": "Identifier", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "async" - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28},"identifierName":"async"}, "name": "async" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "bar" - }, + "start":30,"end":33,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":33},"identifierName":"bar"}, "name": "bar" } } @@ -165,18 +52,7 @@ ], "body": { "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":37,"end":39,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":39}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/31/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/31/output.json index fc0cb9d7f5..0b5c81b467 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/31/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/31/output.json @@ -1,162 +1,49 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":6,"end":54,"loc":{"start":{"line":1,"column":6},"end":{"line":3,"column":1}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 12, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":54,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "id": null, "generator": false, "async": true, "params": [ { "type": "ObjectPattern", - "start": 19, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":19,"end":33,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":33}}, "properties": [ { "type": "ObjectProperty", - "start": 21, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":21,"end":31,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":31}}, "method": false, "key": { "type": "Identifier", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "async" - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26},"identifierName":"async"}, "name": "async" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "bar" - }, + "start":28,"end":31,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":31},"identifierName":"bar"}, "name": "bar" } } @@ -165,62 +52,17 @@ ], "body": { "type": "BlockStatement", - "start": 38, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":38,"end":54,"loc":{"start":{"line":1,"column":38},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 42, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":42,"end":52,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "expression": { "type": "AwaitExpression", - "start": 42, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":42,"end":51,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}}, "argument": { "type": "Identifier", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "baz" - }, + "start":48,"end":51,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11},"identifierName":"baz"}, "name": "baz" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/32/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/32/output.json index 0a1dd11478..b22103cb44 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/32/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/32/output.json @@ -1,193 +1,57 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":6,"end":55,"loc":{"start":{"line":1,"column":6},"end":{"line":3,"column":1}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 12, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":55,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "id": null, "generator": false, "async": true, "params": [ { "type": "ObjectPattern", - "start": 19, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":19,"end":34,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":34}}, "properties": [ { "type": "ObjectProperty", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "method": false, "key": { "type": "Identifier", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "async" - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26},"identifierName":"async"}, "name": "async" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "left": { "type": "Identifier", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "async" - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26},"identifierName":"async"}, "name": "async" }, "right": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "bar" - }, + "start":29,"end":32,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":32},"identifierName":"bar"}, "name": "bar" } }, @@ -200,62 +64,17 @@ ], "body": { "type": "BlockStatement", - "start": 39, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":39,"end":55,"loc":{"start":{"line":1,"column":39},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 43, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":43,"end":53,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "expression": { "type": "AwaitExpression", - "start": 43, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":43,"end":52,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}}, "argument": { "type": "Identifier", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "baz" - }, + "start":49,"end":52,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11},"identifierName":"baz"}, "name": "baz" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/33/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/33/output.json index eb5cabf9ce..3626c5879a 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/33/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/33/output.json @@ -1,162 +1,49 @@ { "type": "File", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":6,"end":59,"loc":{"start":{"line":1,"column":6},"end":{"line":3,"column":1}}, "id": { "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" }, "init": { "type": "FunctionExpression", - "start": 12, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":59,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "id": null, "generator": false, "async": true, "params": [ { "type": "ObjectPattern", - "start": 27, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":27,"end":41,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":41}}, "properties": [ { "type": "ObjectProperty", - "start": 29, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":29,"end":39,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":39}}, "method": false, "key": { "type": "Identifier", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "async" - }, + "start":29,"end":34,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":34},"identifierName":"async"}, "name": "async" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "bar" - }, + "start":36,"end":39,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":39},"identifierName":"bar"}, "name": "bar" } } @@ -165,62 +52,17 @@ ], "body": { "type": "BlockStatement", - "start": 43, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":43,"end":59,"loc":{"start":{"line":1,"column":43},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 47, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":47,"end":57,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "expression": { "type": "AwaitExpression", - "start": 47, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":47,"end":56,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}}, "argument": { "type": "Identifier", - "start": 53, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "baz" - }, + "start":53,"end":56,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11},"identifierName":"baz"}, "name": "baz" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/34/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/34/output.json index b3eb53b70e..3381a94ff2 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/34/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/34/output.json @@ -1,193 +1,57 @@ { "type": "File", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":6,"end":60,"loc":{"start":{"line":1,"column":6},"end":{"line":3,"column":1}}, "id": { "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" }, "init": { "type": "FunctionExpression", - "start": 12, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":60,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "id": null, "generator": false, "async": true, "params": [ { "type": "ObjectPattern", - "start": 27, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":27,"end":42,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":42}}, "properties": [ { "type": "ObjectProperty", - "start": 29, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":29,"end":40,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":40}}, "method": false, "key": { "type": "Identifier", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "async" - }, + "start":29,"end":34,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":34},"identifierName":"async"}, "name": "async" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 29, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":29,"end":40,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":40}}, "left": { "type": "Identifier", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "async" - }, + "start":29,"end":34,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":34},"identifierName":"async"}, "name": "async" }, "right": { "type": "Identifier", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "bar" - }, + "start":37,"end":40,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":40},"identifierName":"bar"}, "name": "bar" } }, @@ -200,62 +64,17 @@ ], "body": { "type": "BlockStatement", - "start": 44, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":44,"end":60,"loc":{"start":{"line":1,"column":44},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 48, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":48,"end":58,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "expression": { "type": "AwaitExpression", - "start": 48, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":48,"end":57,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}}, "argument": { "type": "Identifier", - "start": 54, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "baz" - }, + "start":54,"end":57,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11},"identifierName":"baz"}, "name": "baz" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/37/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/37/output.json index f5c50075ec..1a3678ab70 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/37/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/37/output.json @@ -1,157 +1,45 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":6,"end":28,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":28}}, "id": { "type": "ObjectPattern", - "start": 6, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":6,"end":22,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":8,"end":20,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "async" - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"async"}, "name": "async" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 8, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":8,"end":20,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":20}}, "left": { "type": "Identifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "async" - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"async"}, "name": "async" }, "right": { "type": "BooleanLiteral", - "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}}, "value": true } }, @@ -163,19 +51,7 @@ }, "init": { "type": "Identifier", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "foo" - }, + "start":25,"end":28,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":28},"identifierName":"foo"}, "name": "foo" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/38/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/38/output.json index 3f73e77b69..11e80fe9c0 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/38/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/38/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":6,"end":26,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":26}}, "id": { "type": "ObjectPattern", - "start": 6, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":6,"end":20,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":8,"end":18,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "async" - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"async"}, "name": "async" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" } } @@ -129,19 +39,7 @@ }, "init": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "bar" - }, + "start":23,"end":26,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":26},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/7/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/7/output.json index 0b7a650552..3d7b20d5c1 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/7/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/7/output.json @@ -1,144 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "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": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "async" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"async"}, "name": "async" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "async" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"async"}, "name": "async" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/8/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/8/output.json index dee1edbd15..0c972c1f69 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/8/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/8/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":6,"end":39,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":39}}, "id": { "type": "ObjectPattern", - "start": 6, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13}}, "properties": [ { "type": "ObjectProperty", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "async" - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12},"identifierName":"async"}, "name": "async" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "async" - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12},"identifierName":"async"}, "name": "async" }, "extra": { @@ -132,50 +42,16 @@ }, "init": { "type": "CallExpression", - "start": 16, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":16,"end":39,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":39}}, "callee": { "type": "Identifier", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "require" - }, + "start":16,"end":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23},"identifierName":"require"}, "name": "require" }, "arguments": [ { "type": "StringLiteral", - "start": 24, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":24,"end":38,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":38}}, "extra": { "rawValue": "../lang/task", "raw": "'../lang/task'" diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/allow-await-outside-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/allow-await-outside-function/output.json index 1f1d637ff0..878b81ab50 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/allow-await-outside-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/allow-await-outside-function/output.json @@ -1,76 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AwaitExpression", - "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}}, "argument": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/output.json index b264aa447e..f41c5e0fe4 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/async-await-as-arrow-binding-identifier/output.json @@ -1,101 +1,34 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Await cannot be used as name inside an async function (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": true, "params": [ { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "await" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"await"}, "name": "await" } ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-as-argument-identifier-in-non-async-functions/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-as-argument-identifier-in-non-async-functions/output.json index ffa6e2942a..b99bac3df2 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-as-argument-identifier-in-non-async-functions/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-as-argument-identifier-in-non-async-functions/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "await" - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6},"identifierName":"await"}, "name": "await" } ], "body": { "type": "BlockStatement", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-declaration-name/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-declaration-name/output.json index 2d128072e7..d98029d550 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-declaration-name/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-async-function-declaration-name/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "await" - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"await"}, "name": "await" }, "generator": false, @@ -65,18 +20,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } 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 34fa5d9a8d..db893c1726 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 @@ -1,80 +1,24 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ "SyntaxError: Can not use 'await' as identifier inside an async function (1:16)" ], "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":1,"end":26,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}, "id": { "type": "Identifier", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "await" - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21},"identifierName":"await"}, "name": "await" }, "generator": false, @@ -82,18 +26,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] }, 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 c9a8709666..c6a76429a1 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 @@ -1,182 +1,58 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Await cannot be used as name inside an async function (1:20)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": true, "params": [ { "type": "AssignmentPattern", - "start": 7, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":7,"end":28,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":28}}, "left": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, "right": { "type": "ArrowFunctionExpression", - "start": 11, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":11,"end":28,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":28}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 12, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":12,"end":21,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":21}}, "properties": [ { "type": "ObjectProperty", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "method": false, "key": { "type": "Identifier", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "await" - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19},"identifierName":"await"}, "name": "await" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "await" - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19},"identifierName":"await"}, "name": "await" }, "extra": { @@ -188,18 +64,7 @@ ], "body": { "type": "BlockStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "body": [], "directives": [] } @@ -208,18 +73,7 @@ ], "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/output.json index 3d543c665b..1f579129c7 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-declaration-name-inside-async-function/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Can not use 'await' as identifier inside an async function (2:11)" ], "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":21,"end":46,"loc":{"start":{"line":1,"column":21},"end":{"line":3,"column":1}}, "body": [ { "type": "FunctionDeclaration", - "start": 25, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":25,"end":44,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "id": { "type": "Identifier", - "start": 34, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "await" - }, + "start":34,"end":39,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":16},"identifierName":"await"}, "name": "await" }, "generator": false, @@ -117,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":42,"end":44,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-expression-name-inside-async-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-expression-name-inside-async-function/output.json index 701abef485..064e275663 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-expression-name-inside-async-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-function-expression-name-inside-async-function/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "fn" - }, + "start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -65,62 +20,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":20,"end":48,"loc":{"start":{"line":1,"column":20},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 24, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":24,"end":46,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":24}}, "expression": { "type": "FunctionExpression", - "start": 25, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":25,"end":44,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":22}}, "id": { "type": "Identifier", - "start": 34, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "await" - }, + "start":34,"end":39,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":17},"identifierName":"await"}, "name": "await" }, "generator": false, @@ -128,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":42,"end":44,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":22}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-identifier-inside-parameters-of-nested-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-identifier-inside-parameters-of-nested-function/output.json index 1ad9f719af..e7edf5e4bd 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-identifier-inside-parameters-of-nested-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-identifier-inside-parameters-of-nested-function/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "fn" - }, + "start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -65,48 +20,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":20,"end":50,"loc":{"start":{"line":1,"column":20},"end":{"line":3,"column":1}}, "body": [ { "type": "FunctionDeclaration", - "start": 24, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":24,"end":48,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":26}}, "id": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "g" - }, + "start":33,"end":34,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"g"}, "name": "g" }, "generator": false, @@ -114,68 +35,22 @@ "params": [ { "type": "AssignmentPattern", - "start": 35, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":35,"end":44,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":22}}, "left": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "x" - }, + "start":35,"end":36,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"x"}, "name": "x" }, "right": { "type": "Identifier", - "start": 39, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "await" - }, + "start":39,"end":44,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":22},"identifierName":"await"}, "name": "await" } } ], "body": { "type": "BlockStatement", - "start": 46, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":46,"end":48,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":26}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/output.json index 281c412888..fe9f611da0 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-call-inside-parameters-of-async-arrow-function/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Await cannot be used as name inside an async function (2:23)" ], "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "fn" - }, + "start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -68,174 +23,50 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":20,"end":63,"loc":{"start":{"line":1,"column":20},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 24, - "end": 61, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 39 - } - }, + "start":24,"end":61,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":39}}, "expression": { "type": "ArrowFunctionExpression", - "start": 24, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":24,"end":60,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":38}}, "id": null, "generator": false, "async": true, "params": [ { "type": "AssignmentPattern", - "start": 31, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":31,"end":53,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":31}}, "left": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "x" - }, + "start":31,"end":32,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"x"}, "name": "x" }, "right": { "type": "CallExpression", - "start": 35, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":35,"end":53,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":31}}, "callee": { "type": "Identifier", - "start": 35, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "async" - }, + "start":35,"end":40,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18},"identifierName":"async"}, "name": "async" }, "arguments": [ { "type": "AssignmentExpression", - "start": 41, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":41,"end":52,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":30}}, "operator": "=", "left": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "y" - }, + "start":41,"end":42,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20},"identifierName":"y"}, "name": "y" }, "right": { "type": "AwaitExpression", - "start": 45, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":45,"end":52,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":30}}, "argument": { "type": "NumericLiteral", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":51,"end":52,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":30}}, "extra": { "rawValue": 2, "raw": "2" @@ -250,18 +81,7 @@ ], "body": { "type": "BlockStatement", - "start": 58, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 36 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":58,"end":60,"loc":{"start":{"line":2,"column":36},"end":{"line":2,"column":38}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-function-call/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-function-call/output.json index 39c5735ec9..316c54dd43 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-function-call/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arguments-of-async-function-call/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "fn" - }, + "start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -65,125 +20,35 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":20,"end":45,"loc":{"start":{"line":1,"column":20},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 24, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":24,"end":43,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "expression": { "type": "CallExpression", - "start": 24, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":24,"end":42,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "callee": { "type": "Identifier", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "async" - }, + "start":24,"end":29,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7},"identifierName":"async"}, "name": "async" }, "arguments": [ { "type": "AssignmentExpression", - "start": 30, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":30,"end":41,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":19}}, "operator": "=", "left": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "x" - }, + "start":30,"end":31,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"x"}, "name": "x" }, "right": { "type": "AwaitExpression", - "start": 34, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":34,"end":41,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":19}}, "argument": { "type": "NumericLiteral", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":40,"end":41,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arrow-identifier-allowed/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arrow-identifier-allowed/output.json index f6ca7cfa0d..efe20a5c6b 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arrow-identifier-allowed/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-arrow-identifier-allowed/output.json @@ -1,110 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "body": [ { "type": "ExpressionStatement", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "expression": { "type": "Identifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "await" - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"await"}, "name": "await" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-async-call-inside-parameters-of-function-inside-async-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-async-call-inside-parameters-of-function-inside-async-function/output.json index 41946b0a2b..85fbbd7594 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-async-call-inside-parameters-of-function-inside-async-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-async-call-inside-parameters-of-function-inside-async-function/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "f" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,48 +20,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":19,"end":56,"loc":{"start":{"line":1,"column":19},"end":{"line":3,"column":1}}, "body": [ { "type": "FunctionDeclaration", - "start": 23, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":23,"end":54,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":33}}, "id": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "g" - }, + "start":32,"end":33,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"g"}, "name": "g" }, "generator": false, @@ -114,82 +35,24 @@ "params": [ { "type": "AssignmentPattern", - "start": 34, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":34,"end":50,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":29}}, "left": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"x"}, "name": "x" }, "right": { "type": "CallExpression", - "start": 38, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":38,"end":50,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":29}}, "callee": { "type": "Identifier", - "start": 38, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "async" - }, + "start":38,"end":43,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":22},"identifierName":"async"}, "name": "async" }, "arguments": [ { "type": "Identifier", - "start": 44, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 28 - }, - "identifierName": "await" - }, + "start":44,"end":49,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":28},"identifierName":"await"}, "name": "await" } ] @@ -198,18 +61,7 @@ ], "body": { "type": "BlockStatement", - "start": 52, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 31 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":52,"end":54,"loc":{"start":{"line":2,"column":31},"end":{"line":2,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-class-methods/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-class-methods/output.json index 04024e0142..4466a94f87 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-class-methods/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-class-methods/output.json @@ -1,127 +1,38 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "ClassExpression", - "start": 6, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":6,"end":40,"loc":{"start":{"line":1,"column":6},"end":{"line":3,"column":1}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "start": 12, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":40,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 16, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":16,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":24}}, "static": false, "key": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "m" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"m"}, "name": "m" }, "computed": false, @@ -132,61 +43,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 26, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":26,"end":38,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":24}}, "body": [ { "type": "ExpressionStatement", - "start": 28, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":28,"end":36,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":22}}, "expression": { "type": "AwaitExpression", - "start": 28, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":28,"end":36,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":22}}, "argument": { "type": "NumericLiteral", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":34,"end":36,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":22}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-computed-class-property/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-computed-class-property/output.json index 2518cd543d..aacdba1de7 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-computed-class-property/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-computed-class-property/output.json @@ -1,141 +1,42 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": null, "generator": false, "async": true, "params": [], "body": { "type": "ClassExpression", - "start": 12, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":40,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "start": 18, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":18,"end":40,"loc":{"start":{"line":1,"column":18},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 22, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":22,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, "static": false, "computed": true, "key": { "type": "AwaitExpression", - "start": 23, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":23,"end":31,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":11}}, "argument": { "type": "NumericLiteral", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "extra": { "rawValue": 42, "raw": "42" @@ -150,18 +51,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":35,"end":38,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/output.json index 329e0670c5..46e1451080 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-arrow-function/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Await cannot be used as name inside an async function (2:7)" ], "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "fn" - }, + "start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -68,110 +23,32 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":20,"end":46,"loc":{"start":{"line":1,"column":20},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 24, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":24,"end":44,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":22}}, "expression": { "type": "ArrowFunctionExpression", - "start": 24, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":24,"end":43,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 25, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":25,"end":36,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":14}}, "left": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" }, "right": { "type": "AwaitExpression", - "start": 29, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":29,"end":36,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":14}}, "argument": { "type": "NumericLiteral", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":35,"end":36,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14}}, "extra": { "rawValue": 2, "raw": "2" @@ -183,18 +60,7 @@ ], "body": { "type": "BlockStatement", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":41,"end":43,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/output.json index 39796387c7..da4bfb18b9 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters-of-nested-async-arrow-function/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Await cannot be used as name inside an async function (2:13)" ], "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "fn" - }, + "start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -68,110 +23,32 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":20,"end":52,"loc":{"start":{"line":1,"column":20},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 24, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":24,"end":50,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":28}}, "expression": { "type": "ArrowFunctionExpression", - "start": 24, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":24,"end":49,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":27}}, "id": null, "generator": false, "async": true, "params": [ { "type": "AssignmentPattern", - "start": 31, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":31,"end":42,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":20}}, "left": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "x" - }, + "start":31,"end":32,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"x"}, "name": "x" }, "right": { "type": "AwaitExpression", - "start": 35, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":35,"end":42,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":20}}, "argument": { "type": "NumericLiteral", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":41,"end":42,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20}}, "extra": { "rawValue": 2, "raw": "2" @@ -183,18 +60,7 @@ ], "body": { "type": "BlockStatement", - "start": 47, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":47,"end":49,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":27}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/output.json index be635254c8..fcf89fb5da 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parameters/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ "SyntaxError: await is not allowed in async function parameters (1:22)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "fn" - }, + "start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -68,63 +23,18 @@ "params": [ { "type": "AssignmentPattern", - "start": 18, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":18,"end":29,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":29}}, "left": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"x"}, "name": "x" }, "right": { "type": "AwaitExpression", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29}}, "argument": { "type": "NumericLiteral", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29}}, "extra": { "rawValue": 2, "raw": "2" @@ -136,18 +46,7 @@ ], "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parenthesized-assign/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parenthesized-assign/output.json index 76cec56e02..d15d303d40 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parenthesized-assign/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-inside-parenthesized-assign/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "fn" - }, + "start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -65,93 +20,26 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":20,"end":40,"loc":{"start":{"line":1,"column":20},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 24, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":24,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "expression": { "type": "AssignmentExpression", - "start": 25, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":25,"end":36,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":14}}, "operator": "=", "left": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" }, "right": { "type": "AwaitExpression", - "start": 29, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":29,"end":36,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":14}}, "argument": { "type": "NumericLiteral", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":35,"end":36,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/await-object-key-inside-arrow-params-inside-async-arrow-params copy/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/await-object-key-inside-arrow-params-inside-async-arrow-params copy/output.json index 0d5a5b2fa5..22b6c9ddd0 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/await-object-key-inside-arrow-params-inside-async-arrow-params copy/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/await-object-key-inside-arrow-params-inside-async-arrow-params copy/output.json @@ -1,179 +1,55 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": true, "params": [ { "type": "AssignmentPattern", - "start": 7, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":7,"end":31,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":31}}, "left": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, "right": { "type": "ArrowFunctionExpression", - "start": 11, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":11,"end":31,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":31}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}}, "properties": [ { "type": "ObjectProperty", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":14,"end":22,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":22}}, "method": false, "key": { "type": "Identifier", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "await" - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19},"identifierName":"await"}, "name": "await" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"x"}, "name": "x" } } @@ -182,18 +58,7 @@ ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } @@ -202,18 +67,7 @@ ], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/context-division-after-expression/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/context-division-after-expression/output.json index 9bd2028bf8..790c225cc2 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/context-division-after-expression/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/context-division-after-expression/output.json @@ -1,121 +1,32 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "left": { "type": "BinaryExpression", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "left": { "type": "UnaryExpression", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "operator": "void", "prefix": true, "argument": { "type": "FunctionExpression", - "start": 5, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":5,"end":27,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "fn" - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -123,18 +34,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [], "directives": [] } @@ -143,38 +43,14 @@ "operator": "/", "right": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "foo" - }, + "start":29,"end":32,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":4},"identifierName":"foo"}, "name": "foo" } }, "operator": "/", "right": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "g" - }, + "start":33,"end":34,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"g"}, "name": "g" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/context-regex-after-statement/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/context-regex-after-statement/output.json index 05504dd073..0e40e99acd 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/context-regex-after-statement/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/context-regex-after-statement/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "fn" - }, + "start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -65,50 +20,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } }, { "type": "ExpressionStatement", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":23,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "RegExpLiteral", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":23,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "extra": { "raw": "/foo/g" }, diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/export-arrow/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/export-arrow/output.json index acea8f1a29..ae0b862723 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/export-arrow/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/export-arrow/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "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}}, "declaration": { "type": "ArrowFunctionExpression", - "start": 15, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":15,"end":38,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":38}}, "id": null, "generator": false, "async": true, "params": [], "body": { "type": "AwaitExpression", - "start": 27, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":27,"end":38,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":38}}, "argument": { "type": "CallExpression", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":33,"end":38,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":38}}, "callee": { "type": "Identifier", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "foo" - }, + "start":33,"end":36,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":36},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/export-default-newline/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/export-default-newline/output.json index 9179ea920b..0f8838870a 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/export-default-newline/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/export-default-newline/output.json @@ -1,95 +1,27 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "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}}, "declaration": { "type": "Identifier", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "async" - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"async"}, "name": "async" } }, { "type": "FunctionDeclaration", - "start": 21, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":21,"end":38,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "id": { "type": "Identifier", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "bar" - }, + "start":30,"end":33,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"bar"}, "name": "bar" }, "generator": false, @@ -97,18 +29,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":36,"end":38,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":17}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/export/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/export/output.json index 25a3bfc7d1..91120752ac 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/export/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/export/output.json @@ -1,79 +1,23 @@ { "type": "File", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":38}}, "program": { "type": "Program", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":38}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 7, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":7,"end":30,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -81,18 +25,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "body": [], "directives": [] } @@ -100,47 +33,13 @@ }, { "type": "ExportDefaultDeclaration", - "start": 31, - "end": 69, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":31,"end":69,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":38}}, "declaration": { "type": "FunctionDeclaration", - "start": 46, - "end": 69, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":46,"end":69,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":38}}, "id": { "type": "Identifier", - "start": 61, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 33 - }, - "identifierName": "bar" - }, + "start":61,"end":64,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":33},"identifierName":"bar"}, "name": "bar" }, "generator": false, @@ -148,18 +47,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 67, - "end": 69, - "loc": { - "start": { - "line": 2, - "column": 36 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":67,"end":69,"loc":{"start":{"line":2,"column":36},"end":{"line":2,"column":38}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/output.json index e4933140f3..139be62a2f 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/invalid-inside-loop/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Async functions can only be declared at the top level or inside a block (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "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}}, "test": { "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": 1, "raw": "1" @@ -68,33 +24,10 @@ }, "body": { "type": "FunctionDeclaration", - "start": 10, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":10,"end":32,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":32}}, "id": { "type": "Identifier", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "foo" - }, + "start":25,"end":28,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":28},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -102,18 +35,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":30,"end":32,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":32}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/newline-arrow/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/newline-arrow/output.json index 4c44c11863..fe6c0b495b 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/newline-arrow/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/newline-arrow/output.json @@ -1,131 +1,40 @@ { "type": "File", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "async" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"async"}, "name": "async" } }, { "type": "ExpressionStatement", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":6,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "ArrowFunctionExpression", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":6,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"x"}, "name": "x" } ], "body": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/newline/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/newline/output.json index bed2c37da9..3f90482d93 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/newline/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/newline/output.json @@ -1,95 +1,27 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "async" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"async"}, "name": "async" } }, { "type": "FunctionDeclaration", - "start": 6, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":6,"end":24,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -97,18 +29,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":21,"end":24,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/output.json index 8a46002d51..abbe3abb26 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/no-constructor/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Constructor can't be an async function (2:8)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":36,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":12,"end":34,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":24}}, "static": false, "key": { "type": "Identifier", - "start": 18, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "constructor" - }, + "start":18,"end":29,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":19},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -119,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":32,"end":34,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":24}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/object-default-params/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/object-default-params/output.json index 15647855a3..eacde0dd25 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/object-default-params/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/object-default-params/output.json @@ -1,192 +1,57 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":6,"end":37,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "b" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"b"}, "name": "b" }, "init": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":10,"end":37,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":37}}, "id": null, "generator": false, "async": true, "params": [ { "type": "ObjectPattern", - "start": 17, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":17,"end":30,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":30}}, "properties": [ { "type": "ObjectProperty", - "start": 18, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":18,"end":29,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "bar" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"bar"}, "name": "bar" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 18, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":18,"end":29,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":29}}, "left": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "bar" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"bar"}, "name": "bar" }, "right": { "type": "StringLiteral", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" @@ -203,18 +68,7 @@ ], "body": { "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":35,"end":37,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":37}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/output.json b/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/output.json index 009f725231..630b3e12eb 100644 --- a/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/es2017/async-functions/params-invalid-rest-trailing-comma/output.json @@ -1,116 +1,38 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected trailing comma after rest element (1:11)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": null, "generator": false, "async": true, "params": [ { "type": "RestElement", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "argument": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" } } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/1/output.json b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/1/output.json index 40aa851025..8fe4e28db0 100644 --- a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/1/output.json +++ b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/1/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "Identifier", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "log" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"log"}, "name": "log" }, "extra": { @@ -80,35 +24,12 @@ "arguments": [ { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "n" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"n"}, "name": "n" }, { "type": "StringLiteral", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "extra": { "rawValue": "=", "raw": "'='" @@ -117,18 +38,7 @@ }, { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/2/output.json b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/2/output.json index b36b03f409..a09840875e 100644 --- a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/2/output.json +++ b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/2/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "log" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"log"}, "name": "log" }, "generator": false, @@ -65,70 +20,23 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "n" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"n"}, "name": "n" }, { "type": "Identifier", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "op" - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18},"identifierName":"op"}, "name": "op" }, { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "val" - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23},"identifierName":"val"}, "name": "val" } ], "body": { "type": "BlockStatement", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/3/output.json b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/3/output.json index e04f346772..530e874086 100644 --- a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/3/output.json +++ b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/3/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":10,"end":25,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":25}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":12,"end":23,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":23}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "bar" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -116,36 +37,13 @@ "params": [ { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a" } ], "body": { "type": "BlockStatement", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/4/output.json b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/4/output.json index 39f347e043..8c83452cdd 100644 --- a/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/4/output.json +++ b/packages/babel-parser/test/fixtures/es2017/trailing-function-commas/4/output.json @@ -1,115 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "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" }, { "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" } ], "body": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2018/async-generators/class-method-2/output.json b/packages/babel-parser/test/fixtures/es2018/async-generators/class-method-2/output.json index daf37aab3a..64027acd5b 100644 --- a/packages/babel-parser/test/fixtures/es2018/async-generators/class-method-2/output.json +++ b/packages/babel-parser/test/fixtures/es2018/async-generators/class-method-2/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":29,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":12,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":7}}, "static": false, "key": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "a" - }, + "start":22,"end":23,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":25,"end":27,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":7}}, "body": [], "directives": [] } 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 14cc3bddee..3cddfe78de 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 @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 130, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":130,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 130, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":130,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 130, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":130,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "Query" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"Query"}, "name": "Query" }, "superClass": null, "body": { "type": "ClassBody", - "start": 12, - "end": 130, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":12,"end":130,"loc":{"start":{"line":1,"column":12},"end":{"line":7,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 18, - "end": 128, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 6, - "column": 5 - } - }, + "start":18,"end":128,"loc":{"start":{"line":2,"column":4},"end":{"line":6,"column":5}}, "static": false, "key": { "type": "Identifier", - "start": 25, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "queryAll" - }, + "start":25,"end":33,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":19},"identifierName":"queryAll"}, "name": "queryAll" }, "computed": false, @@ -116,96 +37,28 @@ "params": [ { "type": "Identifier", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "ids" - }, + "start":34,"end":37,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23},"identifierName":"ids"}, "name": "ids" } ], "body": { "type": "BlockStatement", - "start": 39, - "end": 128, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 6, - "column": 5 - } - }, + "start":39,"end":128,"loc":{"start":{"line":2,"column":25},"end":{"line":6,"column":5}}, "body": [ { "type": "ForOfStatement", - "start": 49, - "end": 122, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 5, - "column": 9 - } - }, + "start":49,"end":122,"loc":{"start":{"line":3,"column":8},"end":{"line":5,"column":9}}, "await": false, "left": { "type": "VariableDeclaration", - "start": 54, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":54,"end":62,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 60, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":60,"end":62,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":21}}, "id": { "type": "Identifier", - "start": 60, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 21 - }, - "identifierName": "id" - }, + "start":60,"end":62,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":21},"identifierName":"id"}, "name": "id" }, "init": null @@ -215,137 +68,36 @@ }, "right": { "type": "Identifier", - "start": 66, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 25 - }, - "end": { - "line": 3, - "column": 28 - }, - "identifierName": "ids" - }, + "start":66,"end":69,"loc":{"start":{"line":3,"column":25},"end":{"line":3,"column":28},"identifierName":"ids"}, "name": "ids" }, "body": { "type": "BlockStatement", - "start": 71, - "end": 122, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 5, - "column": 9 - } - }, + "start":71,"end":122,"loc":{"start":{"line":3,"column":30},"end":{"line":5,"column":9}}, "body": [ { "type": "ExpressionStatement", - "start": 85, - "end": 112, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 39 - } - }, + "start":85,"end":112,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":39}}, "expression": { "type": "YieldExpression", - "start": 85, - "end": 111, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 38 - } - }, + "start":85,"end":111,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":38}}, "delegate": false, "argument": { "type": "AwaitExpression", - "start": 91, - "end": 111, - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 38 - } - }, + "start":91,"end":111,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":38}}, "argument": { "type": "CallExpression", - "start": 97, - "end": 111, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 38 - } - }, + "start":97,"end":111,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":38}}, "callee": { "type": "MemberExpression", - "start": 97, - "end": 107, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 34 - } - }, + "start":97,"end":107,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":34}}, "object": { "type": "ThisExpression", - "start": 97, - "end": 101, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 28 - } - } + "start":97,"end":101,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":28}} }, "property": { "type": "Identifier", - "start": 102, - "end": 107, - "loc": { - "start": { - "line": 4, - "column": 29 - }, - "end": { - "line": 4, - "column": 34 - }, - "identifierName": "query" - }, + "start":102,"end":107,"loc":{"start":{"line":4,"column":29},"end":{"line":4,"column":34},"identifierName":"query"}, "name": "query" }, "computed": false @@ -353,19 +105,7 @@ "arguments": [ { "type": "Identifier", - "start": 108, - "end": 110, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 37 - }, - "identifierName": "id" - }, + "start":108,"end":110,"loc":{"start":{"line":4,"column":35},"end":{"line":4,"column":37},"identifierName":"id"}, "name": "id" } ] diff --git a/packages/babel-parser/test/fixtures/es2018/async-generators/for-await/output.json b/packages/babel-parser/test/fixtures/es2018/async-generators/for-await/output.json index d096f12b19..74f0ff526d 100644 --- a/packages/babel-parser/test/fixtures/es2018/async-generators/for-await/output.json +++ b/packages/babel-parser/test/fixtures/es2018/async-generators/for-await/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "f" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,78 +20,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":19,"end":48,"loc":{"start":{"line":1,"column":19},"end":{"line":3,"column":1}}, "body": [ { "type": "ForOfStatement", - "start": 23, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":23,"end":46,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":25}}, "await": true, "left": { "type": "VariableDeclaration", - "start": 34, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":34,"end":39,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":38,"end":39,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "x" - }, + "start":38,"end":39,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"x"}, "name": "x" }, "init": null @@ -146,35 +45,12 @@ }, "right": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "y" - }, + "start":43,"end":44,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":23},"identifierName":"y"}, "name": "y" }, "body": { "type": "EmptyStatement", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - } - } + "start":45,"end":46,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":25}} } } ], 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 0dedcfd421..47180d5c75 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 @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 133, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - }, + "start":0,"end":133,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 133, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - }, + "start":0,"end":133,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 133, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - }, + "start":0,"end":133,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 132, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":6,"end":132,"loc":{"start":{"line":1,"column":6},"end":{"line":7,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "query" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"query"}, "name": "query" }, "init": { "type": "ObjectExpression", - "start": 14, - "end": 132, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":14,"end":132,"loc":{"start":{"line":1,"column":14},"end":{"line":7,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 20, - "end": 130, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 6, - "column": 5 - } - }, + "start":20,"end":130,"loc":{"start":{"line":2,"column":4},"end":{"line":6,"column":5}}, "method": true, "key": { "type": "Identifier", - "start": 27, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "queryAll" - }, + "start":27,"end":35,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":19},"identifierName":"queryAll"}, "name": "queryAll" }, "computed": false, @@ -130,96 +40,28 @@ "params": [ { "type": "Identifier", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "ids" - }, + "start":36,"end":39,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23},"identifierName":"ids"}, "name": "ids" } ], "body": { "type": "BlockStatement", - "start": 41, - "end": 130, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 6, - "column": 5 - } - }, + "start":41,"end":130,"loc":{"start":{"line":2,"column":25},"end":{"line":6,"column":5}}, "body": [ { "type": "ForOfStatement", - "start": 51, - "end": 124, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 5, - "column": 9 - } - }, + "start":51,"end":124,"loc":{"start":{"line":3,"column":8},"end":{"line":5,"column":9}}, "await": false, "left": { "type": "VariableDeclaration", - "start": 56, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":56,"end":64,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 62, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":62,"end":64,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":21}}, "id": { "type": "Identifier", - "start": 62, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 21 - }, - "identifierName": "id" - }, + "start":62,"end":64,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":21},"identifierName":"id"}, "name": "id" }, "init": null @@ -229,137 +71,36 @@ }, "right": { "type": "Identifier", - "start": 68, - "end": 71, - "loc": { - "start": { - "line": 3, - "column": 25 - }, - "end": { - "line": 3, - "column": 28 - }, - "identifierName": "ids" - }, + "start":68,"end":71,"loc":{"start":{"line":3,"column":25},"end":{"line":3,"column":28},"identifierName":"ids"}, "name": "ids" }, "body": { "type": "BlockStatement", - "start": 73, - "end": 124, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 5, - "column": 9 - } - }, + "start":73,"end":124,"loc":{"start":{"line":3,"column":30},"end":{"line":5,"column":9}}, "body": [ { "type": "ExpressionStatement", - "start": 87, - "end": 114, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 39 - } - }, + "start":87,"end":114,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":39}}, "expression": { "type": "YieldExpression", - "start": 87, - "end": 113, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 38 - } - }, + "start":87,"end":113,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":38}}, "delegate": false, "argument": { "type": "AwaitExpression", - "start": 93, - "end": 113, - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 38 - } - }, + "start":93,"end":113,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":38}}, "argument": { "type": "CallExpression", - "start": 99, - "end": 113, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 38 - } - }, + "start":99,"end":113,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":38}}, "callee": { "type": "MemberExpression", - "start": 99, - "end": 109, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 34 - } - }, + "start":99,"end":109,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":34}}, "object": { "type": "ThisExpression", - "start": 99, - "end": 103, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 28 - } - } + "start":99,"end":103,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":28}} }, "property": { "type": "Identifier", - "start": 104, - "end": 109, - "loc": { - "start": { - "line": 4, - "column": 29 - }, - "end": { - "line": 4, - "column": 34 - }, - "identifierName": "query" - }, + "start":104,"end":109,"loc":{"start":{"line":4,"column":29},"end":{"line":4,"column":34},"identifierName":"query"}, "name": "query" }, "computed": false @@ -367,19 +108,7 @@ "arguments": [ { "type": "Identifier", - "start": 110, - "end": 112, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 37 - }, - "identifierName": "id" - }, + "start":110,"end":112,"loc":{"start":{"line":4,"column":35},"end":{"line":4,"column":37},"identifierName":"id"}, "name": "id" } ] diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/1/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/1/output.json index 9e70bac913..6c5006b4fa 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/1/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/1/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "ObjectPattern", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "properties": [ { "type": "RestElement", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "argument": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" } } @@ -109,19 +31,7 @@ }, "init": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "z" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/10/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/10/output.json index 6b852f78de..aa56d0ec55 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/10/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/10/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, "id": { "type": "ObjectPattern", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "extra": { @@ -130,53 +40,18 @@ }, { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "y" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "y" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"y"}, "name": "y" }, "extra": { @@ -190,19 +65,7 @@ }, "init": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "obj" - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19},"identifierName":"obj"}, "name": "obj" } } 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 8e0284f73c..9107e6623d 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 @@ -1,114 +1,36 @@ { "type": "File", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":35}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:23)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:23)" ], "program": { "type": "Program", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":35}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" @@ -122,113 +44,34 @@ }, { "type": "ExportNamedDeclaration", - "start": 22, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":22,"end":57,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":35}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 29, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":29,"end":57,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":35}}, "declarations": [ { "type": "VariableDeclarator", - "start": 35, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":35,"end":56,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":34}}, "id": { "type": "ObjectPattern", - "start": 35, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":35,"end":50,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":28}}, "properties": [ { "type": "ObjectProperty", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":37,"end":40,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "bar" - }, + "start":37,"end":40,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"bar"}, "name": "bar" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "bar" - }, + "start":37,"end":40,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"bar"}, "name": "bar" }, "extra": { @@ -237,33 +80,10 @@ }, { "type": "RestElement", - "start": 42, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":42,"end":48,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":26}}, "argument": { "type": "Identifier", - "start": 45, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 26 - }, - "identifierName": "foo" - }, + "start":45,"end":48,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":26},"identifierName":"foo"}, "name": "foo" } } @@ -271,19 +91,7 @@ }, "init": { "type": "Identifier", - "start": 53, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 31 - }, - "end": { - "line": 2, - "column": 34 - }, - "identifierName": "baz" - }, + "start":53,"end":56,"loc":{"start":{"line":2,"column":31},"end":{"line":2,"column":34},"identifierName":"baz"}, "name": "baz" } } 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 dd11a6812a..ff6a186270 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 @@ -1,147 +1,46 @@ { "type": "File", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "errors": [ "SyntaxError: Identifier 'bar' has already been declared (2:13)", "SyntaxError: `bar` has already been exported. Exported identifiers must be unique. (2:13)" ], "program": { "type": "Program", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":21}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":7,"end":35,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":35}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":13,"end":34,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":34}}, "id": { "type": "ObjectPattern", - "start": 13, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":13,"end":28,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":28}}, "properties": [ { "type": "ObjectProperty", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" }, "extra": { @@ -150,33 +49,10 @@ }, { "type": "RestElement", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26}}, "argument": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "bar" - }, + "start":23,"end":26,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":26},"identifierName":"bar"}, "name": "bar" } } @@ -184,19 +60,7 @@ }, "init": { "type": "Identifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "baz" - }, + "start":31,"end":34,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":34},"identifierName":"baz"}, "name": "baz" } } @@ -206,80 +70,24 @@ }, { "type": "ExportNamedDeclaration", - "start": 36, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":36,"end":57,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":21}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 43, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":43,"end":57,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 49, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":49,"end":56,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":20}}, "id": { "type": "Identifier", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "bar" - }, + "start":49,"end":52,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16},"identifierName":"bar"}, "name": "bar" }, "init": { "type": "NumericLiteral", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":55,"end":56,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20}}, "extra": { "rawValue": 1, "raw": "1" 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 a591bf9015..4488d18649 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 @@ -1,114 +1,36 @@ { "type": "File", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 44 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":44}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:30)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:30)" ], "program": { "type": "Program", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 44 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":44}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" @@ -122,162 +44,49 @@ }, { "type": "ExportNamedDeclaration", - "start": 22, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 44 - } - }, + "start":22,"end":66,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":44}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 29, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 44 - } - }, + "start":29,"end":66,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":44}}, "declarations": [ { "type": "VariableDeclarator", - "start": 35, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 43 - } - }, + "start":35,"end":65,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":43}}, "id": { "type": "ObjectPattern", - "start": 35, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":35,"end":59,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":37}}, "properties": [ { "type": "ObjectProperty", - "start": 37, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":37,"end":57,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":35}}, "method": false, "key": { "type": "Identifier", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "bar" - }, + "start":37,"end":40,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"bar"}, "name": "bar" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 42, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":42,"end":57,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":35}}, "properties": [ { "type": "ObjectProperty", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25}}, "method": false, "key": { "type": "Identifier", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "baz" - }, + "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"baz"}, "name": "baz" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "baz" - }, + "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"baz"}, "name": "baz" }, "extra": { @@ -286,33 +95,10 @@ }, { "type": "RestElement", - "start": 49, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":49,"end":55,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":33}}, "argument": { "type": "Identifier", - "start": 52, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 33 - }, - "identifierName": "foo" - }, + "start":52,"end":55,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":33},"identifierName":"foo"}, "name": "foo" } } @@ -323,19 +109,7 @@ }, "init": { "type": "Identifier", - "start": 62, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 40 - }, - "end": { - "line": 2, - "column": 43 - }, - "identifierName": "qux" - }, + "start":62,"end":65,"loc":{"start":{"line":2,"column":40},"end":{"line":2,"column":43},"identifierName":"qux"}, "name": "qux" } } 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 d092e82a47..e3429dd557 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 @@ -1,114 +1,36 @@ { "type": "File", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 42 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":42}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:29)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:29)" ], "program": { "type": "Program", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 42 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":42}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" @@ -122,145 +44,43 @@ }, { "type": "ExportNamedDeclaration", - "start": 22, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 42 - } - }, + "start":22,"end":64,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":42}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 29, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 42 - } - }, + "start":29,"end":64,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":42}}, "declarations": [ { "type": "VariableDeclarator", - "start": 35, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 41 - } - }, + "start":35,"end":63,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":41}}, "id": { "type": "ArrayPattern", - "start": 35, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":35,"end":57,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":35}}, "elements": [ { "type": "Identifier", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "bar" - }, + "start":36,"end":39,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17},"identifierName":"bar"}, "name": "bar" }, { "type": "ObjectPattern", - "start": 41, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":41,"end":56,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":34}}, "properties": [ { "type": "ObjectProperty", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":43,"end":46,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24}}, "method": false, "key": { "type": "Identifier", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "baz" - }, + "start":43,"end":46,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24},"identifierName":"baz"}, "name": "baz" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "baz" - }, + "start":43,"end":46,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24},"identifierName":"baz"}, "name": "baz" }, "extra": { @@ -269,33 +89,10 @@ }, { "type": "RestElement", - "start": 48, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":48,"end":54,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":32}}, "argument": { "type": "Identifier", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 32 - }, - "identifierName": "foo" - }, + "start":51,"end":54,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":32},"identifierName":"foo"}, "name": "foo" } } @@ -305,19 +102,7 @@ }, "init": { "type": "Identifier", - "start": 60, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 2, - "column": 41 - }, - "identifierName": "qux" - }, + "start":60,"end":63,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":41},"identifierName":"qux"}, "name": "qux" } } 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 a35595b310..ebce9c2259 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 @@ -1,114 +1,36 @@ { "type": "File", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 44 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":44}}, "errors": [ "SyntaxError: Identifier 'foo' has already been declared (2:30)", "SyntaxError: `foo` has already been exported. Exported identifiers must be unique. (2:30)" ], "program": { "type": "Program", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 44 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":44}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" @@ -122,160 +44,47 @@ }, { "type": "ExportNamedDeclaration", - "start": 22, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 44 - } - }, + "start":22,"end":66,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":44}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 29, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 44 - } - }, + "start":29,"end":66,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":44}}, "declarations": [ { "type": "VariableDeclarator", - "start": 35, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 43 - } - }, + "start":35,"end":65,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":43}}, "id": { "type": "ArrayPattern", - "start": 35, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":35,"end":59,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":37}}, "elements": [ { "type": "Identifier", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "bar" - }, + "start":36,"end":39,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17},"identifierName":"bar"}, "name": "bar" }, { "type": "ArrayPattern", - "start": 41, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":41,"end":58,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":36}}, "elements": [ { "type": "ObjectPattern", - "start": 42, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":42,"end":57,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":35}}, "properties": [ { "type": "ObjectProperty", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25}}, "method": false, "key": { "type": "Identifier", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "baz" - }, + "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"baz"}, "name": "baz" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "baz" - }, + "start":44,"end":47,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"baz"}, "name": "baz" }, "extra": { @@ -284,33 +93,10 @@ }, { "type": "RestElement", - "start": 49, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":49,"end":55,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":33}}, "argument": { "type": "Identifier", - "start": 52, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 33 - }, - "identifierName": "foo" - }, + "start":52,"end":55,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":33},"identifierName":"foo"}, "name": "foo" } } @@ -322,19 +108,7 @@ }, "init": { "type": "Identifier", - "start": 62, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 40 - }, - "end": { - "line": 2, - "column": 43 - }, - "identifierName": "qux" - }, + "start":62,"end":65,"loc":{"start":{"line":2,"column":40},"end":{"line":2,"column":43},"identifierName":"qux"}, "name": "qux" } } 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 9a9ef92749..5f904177a7 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 @@ -1,109 +1,32 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid rest operator's argument (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "properties": [ { "type": "RestElement", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "argument": { "type": "ObjectPattern", - "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}}, "properties": [] } } @@ -111,18 +34,7 @@ }, "right": { "type": "ObjectExpression", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "properties": [] }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/2/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/2/output.json index 63ab7890b8..e55b048ed3 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/2/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/2/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ObjectPattern", - "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}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "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" }, "extra": { @@ -130,33 +40,10 @@ }, { "type": "RestElement", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "argument": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "y" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"y"}, "name": "y" } } @@ -164,19 +51,7 @@ }, "init": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "z" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"z"}, "name": "z" } } 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 09b6d303c4..53d79afbca 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 @@ -1,140 +1,40 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid rest operator's argument (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":1,"end":16,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":16}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 1, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, "properties": [ { "type": "RestElement", - "start": 2, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":2,"end":10,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":10}}, "argument": { "type": "AssignmentPattern", - "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": "x" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"x"}, "name": "x" }, "right": { "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" @@ -147,18 +47,7 @@ }, "right": { "type": "ObjectExpression", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "properties": [] }, "extra": { 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 2f80e29257..95a5979a01 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 @@ -1,109 +1,32 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid rest operator's argument (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "properties": [ { "type": "RestElement", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "argument": { "type": "ArrayPattern", - "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}}, "elements": [] } } @@ -111,18 +34,7 @@ }, "right": { "type": "ObjectExpression", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "properties": [] }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/3/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/3/output.json index 5ecd8287f4..5e3c5f7d22 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/3/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/3/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":1,"end":24,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":24}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 10, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19}}, "properties": [ { "type": "ObjectProperty", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "extra": { @@ -133,33 +43,10 @@ }, { "type": "RestElement", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}}, "argument": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "y" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"y"}, "name": "y" } } @@ -168,18 +55,7 @@ ], "body": { "type": "BlockStatement", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/4/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/4/output.json index 3cd19d4940..102243b3cb 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/4/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/4/output.json @@ -1,124 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "z" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"z"}, "name": "z" }, "init": { "type": "ObjectExpression", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}}, "properties": [ { "type": "SpreadElement", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "argument": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/5/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/5/output.json index d3f66418df..d02edb84bd 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/5/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/5/output.json @@ -1,144 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "z" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"z"}, "name": "z" }, "right": { "type": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "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" }, "extra": { @@ -147,33 +45,10 @@ }, { "type": "SpreadElement", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "argument": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "y" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"y"}, "name": "y" } } diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/6/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/6/output.json index 66bdc45dc9..12c936bbd4 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/6/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/6/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":1,"end":24,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":24}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "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" }, "extra": { @@ -115,85 +36,27 @@ }, { "type": "SpreadElement", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "argument": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "y" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"y"}, "name": "y" } }, { "type": "ObjectProperty", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a" }, "extra": { @@ -202,85 +65,27 @@ }, { "type": "SpreadElement", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}}, "argument": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "b" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"b"}, "name": "b" } }, { "type": "ObjectProperty", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "method": false, "key": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "c" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "c" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"c"}, "name": "c" }, "extra": { 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 c7ff07e0d0..507c8b34b2 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 @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ "SyntaxError: Unexpected trailing comma after rest element (1:16)" ], "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":4,"end":25,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":25}}, "id": { "type": "ObjectPattern", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "extra": { @@ -133,53 +43,18 @@ }, { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "y" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "y" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"y"}, "name": "y" }, "extra": { @@ -188,33 +63,10 @@ }, { "type": "RestElement", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "argument": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "z" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"z"}, "name": "z" } } @@ -225,19 +77,7 @@ }, "init": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "obj" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"obj"}, "name": "obj" } } diff --git a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread/output.json b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread/output.json index 2b3910bf3a..aa360d1055 100644 --- a/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread/output.json +++ b/packages/babel-parser/test/fixtures/es2018/object-rest-spread/comma-after-spread/output.json @@ -1,92 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "properties": [ { "type": "SpreadElement", - "start": 2, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":2,"end":6,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":6}}, "argument": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" } } 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 503c5e4d17..cce89e8969 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 @@ -1,63 +1,19 @@ { "type": "File", - "start": 0, - "end": 98, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 82 - } - }, + "start":0,"end":98,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":82}}, "program": { "type": "Program", - "start": 0, - "end": 98, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 82 - } - }, + "start":0,"end":98,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":82}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "value": { "type": "DirectiveLiteral", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "value": "before
after", "extra": { "raw": "\"before
after\"", @@ -68,18 +24,7 @@ { "type": "CommentLine", "value": " ^ That's a U+2028 LINE SEPARATOR UTF-16 char (between 'before' and 'after')", - "start": 16, - "end": 98, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 82 - } - } + "start":16,"end":98,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":82}} } ] } @@ -89,18 +34,7 @@ { "type": "CommentLine", "value": " ^ That's a U+2028 LINE SEPARATOR UTF-16 char (between 'before' and 'after')", - "start": 16, - "end": 98, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 82 - } - } + "start":16,"end":98,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":82}} } ] } \ No newline at end of file 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 ac843e7faa..2c98f41934 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 @@ -1,63 +1,19 @@ { "type": "File", - "start": 0, - "end": 103, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 87 - } - }, + "start":0,"end":103,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":87}}, "program": { "type": "Program", - "start": 0, - "end": 103, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 87 - } - }, + "start":0,"end":103,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":87}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "value": { "type": "DirectiveLiteral", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "value": "before
after", "extra": { "raw": "\"before
after\"", @@ -68,18 +24,7 @@ { "type": "CommentLine", "value": " ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char (between 'before' and 'after')", - "start": 16, - "end": 103, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 87 - } - } + "start":16,"end":103,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":87}} } ] } @@ -89,18 +34,7 @@ { "type": "CommentLine", "value": " ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char (between 'before' and 'after')", - "start": 16, - "end": 103, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 87 - } - } + "start":16,"end":103,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":87}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2019/json-strings/string-line-separator/output.json b/packages/babel-parser/test/fixtures/es2019/json-strings/string-line-separator/output.json index 9ac309222f..66e271be15 100644 --- a/packages/babel-parser/test/fixtures/es2019/json-strings/string-line-separator/output.json +++ b/packages/babel-parser/test/fixtures/es2019/json-strings/string-line-separator/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 101, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 83 - } - }, + "start":0,"end":101,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":83}}, "program": { "type": "Program", - "start": 0, - "end": 101, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 83 - } - }, + "start":0,"end":101,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":83}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "expression": { "type": "StringLiteral", - "start": 1, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":1,"end":15,"loc":{"start":{"line":1,"column":1},"end":{"line":2,"column":6}}, "extra": { "rawValue": "before
after", "raw": "\"before
after\"", @@ -69,18 +25,7 @@ { "type": "CommentLine", "value": " ^ That's a U+2028 LINE SEPARATOR UTF-16 char (between 'before' and 'after')", - "start": 18, - "end": 101, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 83 - } - } + "start":18,"end":101,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":83}} } ] } @@ -91,18 +36,7 @@ { "type": "CommentLine", "value": " ^ That's a U+2028 LINE SEPARATOR UTF-16 char (between 'before' and 'after')", - "start": 18, - "end": 101, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 83 - } - } + "start":18,"end":101,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":83}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2019/json-strings/string-paragraph-separator/output.json b/packages/babel-parser/test/fixtures/es2019/json-strings/string-paragraph-separator/output.json index edf8712a70..2db0f44e8b 100644 --- a/packages/babel-parser/test/fixtures/es2019/json-strings/string-paragraph-separator/output.json +++ b/packages/babel-parser/test/fixtures/es2019/json-strings/string-paragraph-separator/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 106, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 88 - } - }, + "start":0,"end":106,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":88}}, "program": { "type": "Program", - "start": 0, - "end": 106, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 88 - } - }, + "start":0,"end":106,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":88}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "expression": { "type": "StringLiteral", - "start": 1, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":1,"end":15,"loc":{"start":{"line":1,"column":1},"end":{"line":2,"column":6}}, "extra": { "rawValue": "before
after", "raw": "\"before
after\"", @@ -69,18 +25,7 @@ { "type": "CommentLine", "value": " ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char (between 'before' and 'after')", - "start": 18, - "end": 106, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 88 - } - } + "start":18,"end":106,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":88}} } ] } @@ -91,18 +36,7 @@ { "type": "CommentLine", "value": " ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char (between 'before' and 'after')", - "start": 18, - "end": 106, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 88 - } - } + "start":18,"end":106,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":88}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2019/json-strings/template-line-separator/output.json b/packages/babel-parser/test/fixtures/es2019/json-strings/template-line-separator/output.json index 603b0c53b6..b0b26b4e1e 100644 --- a/packages/babel-parser/test/fixtures/es2019/json-strings/template-line-separator/output.json +++ b/packages/babel-parser/test/fixtures/es2019/json-strings/template-line-separator/output.json @@ -1,78 +1,23 @@ { "type": "File", - "start": 0, - "end": 101, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 83 - } - }, + "start":0,"end":101,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":83}}, "program": { "type": "Program", - "start": 0, - "end": 101, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 83 - } - }, + "start":0,"end":101,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":83}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "expression": { "type": "TemplateLiteral", - "start": 1, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":1,"end":15,"loc":{"start":{"line":1,"column":1},"end":{"line":2,"column":6}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 2, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":2,"end":14,"loc":{"start":{"line":1,"column":2},"end":{"line":2,"column":5}}, "value": { "raw": "before
after", "cooked": "before
after" @@ -89,18 +34,7 @@ { "type": "CommentLine", "value": " ^ That's a U+2028 LINE SEPARATOR UTF-16 char (between 'before' and 'after')", - "start": 18, - "end": 101, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 83 - } - } + "start":18,"end":101,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":83}} } ] } @@ -111,18 +45,7 @@ { "type": "CommentLine", "value": " ^ That's a U+2028 LINE SEPARATOR UTF-16 char (between 'before' and 'after')", - "start": 18, - "end": 101, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 83 - } - } + "start":18,"end":101,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":83}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2019/json-strings/template-paragraph-separator/output.json b/packages/babel-parser/test/fixtures/es2019/json-strings/template-paragraph-separator/output.json index d1d7e83639..b3e8de1e9b 100644 --- a/packages/babel-parser/test/fixtures/es2019/json-strings/template-paragraph-separator/output.json +++ b/packages/babel-parser/test/fixtures/es2019/json-strings/template-paragraph-separator/output.json @@ -1,78 +1,23 @@ { "type": "File", - "start": 0, - "end": 106, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 88 - } - }, + "start":0,"end":106,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":88}}, "program": { "type": "Program", - "start": 0, - "end": 106, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 88 - } - }, + "start":0,"end":106,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":88}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "expression": { "type": "TemplateLiteral", - "start": 1, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":1,"end":15,"loc":{"start":{"line":1,"column":1},"end":{"line":2,"column":6}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 2, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":2,"end":14,"loc":{"start":{"line":1,"column":2},"end":{"line":2,"column":5}}, "value": { "raw": "before
after", "cooked": "before
after" @@ -89,18 +34,7 @@ { "type": "CommentLine", "value": " ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char (between 'before' and 'after')", - "start": 18, - "end": 106, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 88 - } - } + "start":18,"end":106,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":88}} } ] } @@ -111,18 +45,7 @@ { "type": "CommentLine", "value": " ^ That's a U+2029 PARAGRAPH SEPARATOR UTF-16 char (between 'before' and 'after')", - "start": 18, - "end": 106, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 88 - } - } + "start":18,"end":106,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":88}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/es2019/optional-catch-binding/no-binding-finally/output.json b/packages/babel-parser/test/fixtures/es2019/optional-catch-binding/no-binding-finally/output.json index 564ba035b4..4e4a913115 100644 --- a/packages/babel-parser/test/fixtures/es2019/optional-catch-binding/no-binding-finally/output.json +++ b/packages/babel-parser/test/fixtures/es2019/optional-catch-binding/no-binding-finally/output.json @@ -1,112 +1,35 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":1}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":9,"end":19,"loc":{"start":{"line":4,"column":0},"end":{"line":6,"column":1}}, "param": null, "body": { "type": "BlockStatement", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":15,"end":19,"loc":{"start":{"line":4,"column":6},"end":{"line":6,"column":1}}, "body": [], "directives": [] } }, "finalizer": { "type": "BlockStatement", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 7, - "column": 8 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":28,"end":34,"loc":{"start":{"line":7,"column":8},"end":{"line":9,"column":1}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2019/optional-catch-binding/no-binding/output.json b/packages/babel-parser/test/fixtures/es2019/optional-catch-binding/no-binding/output.json index 0948185b8e..e1a072d5ff 100644 --- a/packages/babel-parser/test/fixtures/es2019/optional-catch-binding/no-binding/output.json +++ b/packages/babel-parser/test/fixtures/es2019/optional-catch-binding/no-binding/output.json @@ -1,94 +1,28 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":1}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":9,"end":21,"loc":{"start":{"line":4,"column":0},"end":{"line":6,"column":1}}, "param": null, "body": { "type": "BlockStatement", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":15,"end":21,"loc":{"start":{"line":4,"column":6},"end":{"line":6,"column":1}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2020/bigint/decimal-as-property-name/output.json b/packages/babel-parser/test/fixtures/es2020/bigint/decimal-as-property-name/output.json index 0e89977f19..38dbce7274 100644 --- a/packages/babel-parser/test/fixtures/es2020/bigint/decimal-as-property-name/output.json +++ b/packages/babel-parser/test/fixtures/es2020/bigint/decimal-as-property-name/output.json @@ -1,92 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":3,"end":8,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":8}}, "method": false, "key": { "type": "BigIntLiteral", - "start": 3, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":3,"end":5,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":5}}, "extra": { "rawValue": "0", "raw": "0n" @@ -97,18 +31,7 @@ "shorthand": false, "value": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/es2020/bigint/hex-as-property-name/output.json b/packages/babel-parser/test/fixtures/es2020/bigint/hex-as-property-name/output.json index 6f4825b89b..02c95be55b 100644 --- a/packages/babel-parser/test/fixtures/es2020/bigint/hex-as-property-name/output.json +++ b/packages/babel-parser/test/fixtures/es2020/bigint/hex-as-property-name/output.json @@ -1,92 +1,26 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":1,"end":17,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":17}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":3,"end":15,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":15}}, "method": false, "key": { "type": "BigIntLiteral", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12}}, "extra": { "rawValue": "0xbeefba", "raw": "0xbeefban" @@ -97,18 +31,7 @@ "shorthand": false, "value": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-decimal/output.json b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-decimal/output.json index 26cbd02452..65fe5c762c 100644 --- a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-decimal/output.json +++ b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-decimal/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Invalid BigIntLiteral (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "BigIntLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": "1.0", "raw": "1.0n" diff --git a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-e/output.json b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-e/output.json index 527c532159..ece9adc5b9 100644 --- a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-e/output.json +++ b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-e/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Invalid BigIntLiteral (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "BigIntLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": "2e9", "raw": "2e9n" diff --git a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-non-octal-decimal-int/output.json b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-non-octal-decimal-int/output.json index 86220085cd..c7ff73f0e7 100644 --- a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-non-octal-decimal-int/output.json +++ b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-non-octal-decimal-int/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Invalid BigIntLiteral (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "BigIntLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": "089", "raw": "089n" diff --git a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-octal-legacy/output.json b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-octal-legacy/output.json index baa4133652..8f1e2836cd 100644 --- a/packages/babel-parser/test/fixtures/es2020/bigint/invalid-octal-legacy/output.json +++ b/packages/babel-parser/test/fixtures/es2020/bigint/invalid-octal-legacy/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid BigIntLiteral (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BigIntLiteral", - "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}}, "extra": { "rawValue": "016432", "raw": "016432n" diff --git a/packages/babel-parser/test/fixtures/es2020/bigint/valid-binary/output.json b/packages/babel-parser/test/fixtures/es2020/bigint/valid-binary/output.json index 2af634126e..ee97cc1620 100644 --- a/packages/babel-parser/test/fixtures/es2020/bigint/valid-binary/output.json +++ b/packages/babel-parser/test/fixtures/es2020/bigint/valid-binary/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BigIntLiteral", - "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": "0b101011101", "raw": "0b101011101n" diff --git a/packages/babel-parser/test/fixtures/es2020/bigint/valid-hex/output.json b/packages/babel-parser/test/fixtures/es2020/bigint/valid-hex/output.json index 220e289500..6439866551 100644 --- a/packages/babel-parser/test/fixtures/es2020/bigint/valid-hex/output.json +++ b/packages/babel-parser/test/fixtures/es2020/bigint/valid-hex/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BigIntLiteral", - "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}}, "extra": { "rawValue": "0xFFF123", "raw": "0xFFF123n" diff --git a/packages/babel-parser/test/fixtures/es2020/bigint/valid-large/output.json b/packages/babel-parser/test/fixtures/es2020/bigint/valid-large/output.json index 0839fb9bb6..2f6c43363a 100644 --- a/packages/babel-parser/test/fixtures/es2020/bigint/valid-large/output.json +++ b/packages/babel-parser/test/fixtures/es2020/bigint/valid-large/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BigIntLiteral", - "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}}, "extra": { "rawValue": "9223372036854775807", "raw": "9223372036854775807n" diff --git a/packages/babel-parser/test/fixtures/es2020/bigint/valid-octal-new/output.json b/packages/babel-parser/test/fixtures/es2020/bigint/valid-octal-new/output.json index 6267312764..509af20126 100644 --- a/packages/babel-parser/test/fixtures/es2020/bigint/valid-octal-new/output.json +++ b/packages/babel-parser/test/fixtures/es2020/bigint/valid-octal-new/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BigIntLiteral", - "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}}, "extra": { "rawValue": "0o16432", "raw": "0o16432n" diff --git a/packages/babel-parser/test/fixtures/es2020/bigint/valid-small/output.json b/packages/babel-parser/test/fixtures/es2020/bigint/valid-small/output.json index 1300d0c931..48429544d6 100644 --- a/packages/babel-parser/test/fixtures/es2020/bigint/valid-small/output.json +++ b/packages/babel-parser/test/fixtures/es2020/bigint/valid-small/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "BigIntLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": "100", "raw": "100n" diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/direct-calls-only/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/direct-calls-only/output.json index 07f26c50d8..c091e5986a 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/direct-calls-only/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/direct-calls-only/output.json @@ -1,67 +1,22 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Dynamic imports require a parameter: import('a.js') (2:9)", "SyntaxError: The only valid meta property for import is import.meta (2:16)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "failsParse" - }, + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19},"identifierName":"failsParse"}, "name": "failsParse" }, "generator": false, @@ -69,93 +24,25 @@ "params": [], "body": { "type": "BlockStatement", - "start": 22, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":22,"end":49,"loc":{"start":{"line":1,"column":22},"end":{"line":3,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 26, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":26,"end":47,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":23}}, "argument": { "type": "CallExpression", - "start": 33, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":33,"end":46,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":22}}, "callee": { "type": "MetaProperty", - "start": 33, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":33,"end":44,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":20}}, "meta": { "type": "Identifier", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "import" - }, + "start":33,"end":39,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15},"identifierName":"import"}, "name": "import" }, "property": { "type": "Identifier", - "start": 40, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "then" - }, + "start":40,"end":44,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":20},"identifierName":"then"}, "name": "then" } }, diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/generator/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/generator/output.json index 25391badd2..5c9dba006a 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/generator/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/generator/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "generator": true, @@ -65,92 +20,26 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":14,"end":41,"loc":{"start":{"line":1,"column":14},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":18,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":23}}, "expression": { "type": "YieldExpression", - "start": 18, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":18,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":22}}, "delegate": false, "argument": { "type": "CallExpression", - "start": 24, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":24,"end":38,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":22}}, "callee": { "type": "Import", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - } - } + "start":24,"end":30,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14}} }, "arguments": [ { "type": "StringLiteral", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":31,"end":37,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":21}}, "extra": { "rawValue": "http", "raw": "'http'" diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/inside-function/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/inside-function/output.json index 6cbd42871d..31948b6647 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/inside-function/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/inside-function/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "loadImport" - }, + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19},"identifierName":"loadImport"}, "name": "loadImport" }, "generator": false, @@ -65,129 +20,39 @@ "params": [ { "type": "Identifier", - "start": 20, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "file" - }, + "start":20,"end":24,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":24},"identifierName":"file"}, "name": "file" } ], "body": { "type": "BlockStatement", - "start": 26, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":26,"end":65,"loc":{"start":{"line":1,"column":26},"end":{"line":3,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 30, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":30,"end":63,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":35}}, "argument": { "type": "CallExpression", - "start": 37, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":37,"end":62,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":34}}, "callee": { "type": "Import", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":37,"end":43,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} }, "arguments": [ { "type": "TemplateLiteral", - "start": 44, - "end": 61, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":44,"end":61,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":33}}, "expressions": [ { "type": "Identifier", - "start": 52, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 28 - }, - "identifierName": "file" - }, + "start":52,"end":56,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":28},"identifierName":"file"}, "name": "file" } ], "quasis": [ { "type": "TemplateElement", - "start": 45, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":45,"end":50,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":22}}, "value": { "raw": "test/", "cooked": "test/" @@ -196,18 +61,7 @@ }, { "type": "TemplateElement", - "start": 57, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":57,"end":60,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":32}}, "value": { "raw": ".js", "cooked": ".js" diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-arguments-spread/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-arguments-spread/output.json index d6eaecc7e5..11c9e8f7db 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-arguments-spread/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-arguments-spread/output.json @@ -1,124 +1,36 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: ... is not allowed in import() (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "Import", - "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}} }, "arguments": [ { "type": "SpreadElement", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "argument": { "type": "ArrayExpression", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "elements": [ { "type": "NumericLiteral", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-new/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-new/output.json index a0b8467953..246d3d373c 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-new/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/invalid-new/output.json @@ -1,95 +1,29 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Cannot use new with import(...) (1:4)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "NewExpression", - "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}}, "callee": { "type": "Import", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - } + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}} }, "arguments": [ { "type": "StringLiteral", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" 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 fde34fb849..6e5fa83656 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 @@ -1,79 +1,24 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Trailing comma is disallowed inside import(...) arguments (1:12)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "Import", - "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}} }, "extra": { "trailingComma": 12 @@ -81,18 +26,7 @@ "arguments": [ { "type": "StringLiteral", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/multiple-args/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/multiple-args/output.json index f66dbbf228..46409dca7a 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/multiple-args/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/multiple-args/output.json @@ -1,95 +1,29 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ "SyntaxError: import() requires exactly one argument (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "callee": { "type": "Import", - "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}} }, "arguments": [ { "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": "hello", "raw": "'hello'" @@ -98,18 +32,7 @@ }, { "type": "StringLiteral", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":16,"end":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23}}, "extra": { "rawValue": "world", "raw": "'world'" diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/no-args/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/no-args/output.json index 9f50d0da24..fe2978c702 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/no-args/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/no-args/output.json @@ -1,79 +1,24 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: import() requires exactly one argument (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "Import", - "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}} }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-module/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-module/output.json index 2f8b72b91f..739eeadcdb 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-module/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/parses-module/output.json @@ -1,92 +1,26 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "Import", - "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}} }, "arguments": [ { "type": "StringLiteral", - "start": 7, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":7,"end":16,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":16}}, "extra": { "rawValue": "test.js", "raw": "'test.js'" 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 0d81d0ce2f..d6607373b7 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 @@ -1,92 +1,26 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 15, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":15,"end":33,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":18}}, "expression": { "type": "CallExpression", - "start": 15, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":15,"end":32,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":17}}, "callee": { "type": "Import", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 6 - } - } + "start":15,"end":21,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":6}} }, "arguments": [ { "type": "StringLiteral", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":22,"end":31,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":16}}, "extra": { "rawValue": "test.js", "raw": "'test.js'" @@ -100,32 +34,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/es2020/dynamic-import/return-value/output.json b/packages/babel-parser/test/fixtures/es2020/dynamic-import/return-value/output.json index 91a1706118..5fb7d58a8e 100644 --- a/packages/babel-parser/test/fixtures/es2020/dynamic-import/return-value/output.json +++ b/packages/babel-parser/test/fixtures/es2020/dynamic-import/return-value/output.json @@ -1,124 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":6,"end":38,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":38}}, "id": { "type": "Identifier", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "importResult" - }, + "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18},"identifierName":"importResult"}, "name": "importResult" }, "init": { "type": "CallExpression", - "start": 21, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":21,"end":38,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":38}}, "callee": { "type": "Import", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} }, "arguments": [ { "type": "StringLiteral", - "start": 28, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":28,"end":37,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":37}}, "extra": { "rawValue": "test.js", "raw": "'test.js'" 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 b28846ccce..af065bea07 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 @@ -1,92 +1,26 @@ { "type": "File", - "start": 0, - "end": 112, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 36 - } - }, + "start":0,"end":112,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 112, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 36 - } - }, + "start":0,"end":112,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "Import", - "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}} }, "arguments": [ { "type": "StringLiteral", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "extra": { "rawValue": "testing.js", "raw": "'testing.js'" @@ -98,64 +32,19 @@ }, { "type": "VariableDeclaration", - "start": 23, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":23,"end":44,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 29, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":29,"end":43,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":20}}, "id": { "type": "Identifier", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "test" - }, + "start":29,"end":33,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":10},"identifierName":"test"}, "name": "test" }, "init": { "type": "StringLiteral", - "start": 36, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":36,"end":43,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":20}}, "extra": { "rawValue": "hello", "raw": "'hello'" @@ -168,96 +57,29 @@ }, { "type": "ExpressionStatement", - "start": 45, - "end": 74, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":45,"end":74,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":29}}, "expression": { "type": "CallExpression", - "start": 45, - "end": 73, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 28 - } - }, + "start":45,"end":73,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":28}}, "callee": { "type": "Import", - "start": 45, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 6 - } - } + "start":45,"end":51,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":6}} }, "arguments": [ { "type": "TemplateLiteral", - "start": 52, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 27 - } - }, + "start":52,"end":72,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":27}}, "expressions": [ { "type": "Identifier", - "start": 63, - "end": 67, - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 22 - }, - "identifierName": "test" - }, + "start":63,"end":67,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":22},"identifierName":"test"}, "name": "test" } ], "quasis": [ { "type": "TemplateElement", - "start": 53, - "end": 61, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 16 - } - }, + "start":53,"end":61,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":16}}, "value": { "raw": "testing/", "cooked": "testing/" @@ -266,18 +88,7 @@ }, { "type": "TemplateElement", - "start": 68, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 23 - }, - "end": { - "line": 4, - "column": 26 - } - }, + "start":68,"end":71,"loc":{"start":{"line":4,"column":23},"end":{"line":4,"column":26}}, "value": { "raw": ".js", "cooked": ".js" @@ -291,90 +102,24 @@ }, { "type": "ExpressionStatement", - "start": 76, - "end": 112, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 36 - } - }, + "start":76,"end":112,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":36}}, "expression": { "type": "CallExpression", - "start": 76, - "end": 111, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 35 - } - }, + "start":76,"end":111,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":35}}, "callee": { "type": "MemberExpression", - "start": 76, - "end": 101, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 25 - } - }, + "start":76,"end":101,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":25}}, "object": { "type": "CallExpression", - "start": 76, - "end": 96, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 20 - } - }, + "start":76,"end":96,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":20}}, "callee": { "type": "Import", - "start": 76, - "end": 82, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 6 - } - } + "start":76,"end":82,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":6}} }, "arguments": [ { "type": "StringLiteral", - "start": 83, - "end": 95, - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 19 - } - }, + "start":83,"end":95,"loc":{"start":{"line":6,"column":7},"end":{"line":6,"column":19}}, "extra": { "rawValue": "testing.js", "raw": "'testing.js'" @@ -385,19 +130,7 @@ }, "property": { "type": "Identifier", - "start": 97, - "end": 101, - "loc": { - "start": { - "line": 6, - "column": 21 - }, - "end": { - "line": 6, - "column": 25 - }, - "identifierName": "then" - }, + "start":97,"end":101,"loc":{"start":{"line":6,"column":21},"end":{"line":6,"column":25},"identifierName":"then"}, "name": "then" }, "computed": false @@ -405,36 +138,14 @@ "arguments": [ { "type": "ArrowFunctionExpression", - "start": 102, - "end": 110, - "loc": { - "start": { - "line": 6, - "column": 26 - }, - "end": { - "line": 6, - "column": 34 - } - }, + "start":102,"end":110,"loc":{"start":{"line":6,"column":26},"end":{"line":6,"column":34}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 108, - "end": 110, - "loc": { - "start": { - "line": 6, - "column": 32 - }, - "end": { - "line": 6, - "column": 34 - } - }, + "start":108,"end":110,"loc":{"start":{"line":6,"column":32},"end":{"line":6,"column":34}}, "body": [], "directives": [] } 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 db84eef974..b631aff245 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 @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":35}}, "program": { "type": "Program", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":35}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":6,"end":29,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":29}}, "id": { "type": "Identifier", - "start": 6, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "testVarible" - }, + "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17},"identifierName":"testVarible"}, "name": "testVarible" }, "init": { "type": "StringLiteral", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":20,"end":29,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":29}}, "extra": { "rawValue": "test.js", "raw": "'test.js'" @@ -101,110 +34,31 @@ }, { "type": "ExpressionStatement", - "start": 31, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":31,"end":66,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":35}}, "expression": { "type": "CallExpression", - "start": 31, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":31,"end":65,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}}, "callee": { "type": "MemberExpression", - "start": 31, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":31,"end":55,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":24}}, "object": { "type": "CallExpression", - "start": 31, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":31,"end":50,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "callee": { "type": "Import", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - } + "start":31,"end":37,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}} }, "arguments": [ { "type": "Identifier", - "start": 38, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "testVarible" - }, + "start":38,"end":49,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":18},"identifierName":"testVarible"}, "name": "testVarible" } ] }, "property": { "type": "Identifier", - "start": 51, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "then" - }, + "start":51,"end":55,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":24},"identifierName":"then"}, "name": "then" }, "computed": false @@ -212,36 +66,14 @@ "arguments": [ { "type": "ArrowFunctionExpression", - "start": 56, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":56,"end":64,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":33}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 62, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 31 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":62,"end":64,"loc":{"start":{"line":2,"column":31},"end":{"line":2,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-and-named/output.json b/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-and-named/output.json index 0c6d340076..f4954b348f 100644 --- a/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-and-named/output.json +++ b/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-and-named/output.json @@ -1,145 +1,43 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "specifiers": [ { "type": "ExportNamespaceSpecifier", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "exported": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "foo" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"foo"}, "name": "foo" } }, { "type": "ExportSpecifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, "local": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "bar" - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"bar"}, "name": "bar" }, "exported": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "bar" - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"bar"}, "name": "bar" } } ], "source": { "type": "StringLiteral", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" diff --git a/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-default/output.json b/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-default/output.json index 3e9ebe6414..920b02e4e9 100644 --- a/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-default/output.json +++ b/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns-default/output.json @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "specifiers": [ { "type": "ExportNamespaceSpecifier", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "exported": { "type": "Identifier", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "default" - }, + "start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19},"identifierName":"default"}, "name": "default" } } ], "source": { "type": "StringLiteral", - "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}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns/output.json b/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns/output.json index 72403aff63..20dd04d14e 100644 --- a/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns/output.json +++ b/packages/babel-parser/test/fixtures/es2020/export-ns-from/ns/output.json @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "specifiers": [ { "type": "ExportNamespaceSpecifier", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "exported": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "A" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"A"}, "name": "A" } } ], "source": { "type": "StringLiteral", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}}, "extra": { "rawValue": "test", "raw": "'test'" diff --git a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/and-nullish/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/and-nullish/output.json index 31a372d44d..5a11d8ff2b 100644 --- a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/and-nullish/output.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/and-nullish/output.json @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "LogicalExpression", - "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}}, "left": { "type": "LogicalExpression", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "left": { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, "operator": "&&", "right": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "b" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"b"}, "name": "b" }, "extra": { @@ -114,19 +35,7 @@ "operator": "??", "right": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "c" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"c"}, "name": "c" } } diff --git a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/associativity/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/associativity/output.json index 6400590cf5..a6503f5fad 100644 --- a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/associativity/output.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/associativity/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "a" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"a"}, "name": "a" }, "operator": "??", "right": { "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": "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" } } diff --git a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/expression/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/expression/output.json index a73a582cf2..653f62c77c 100644 --- a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/expression/output.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/expression/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "LogicalExpression", - "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}}, "left": { "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" }, "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": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/multiline/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/multiline/output.json index c387800ff5..b164d4b5b6 100644 --- a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/multiline/output.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/multiline/output.json @@ -1,128 +1,37 @@ { "type": "File", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":7}}, "program": { "type": "Program", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":7}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":7}}, "expression": { "type": "LogicalExpression", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":6}}, "left": { "type": "LogicalExpression", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "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": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "b" - }, + "start":8,"end":9,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"b"}, "name": "b" } }, "operator": "??", "right": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "c" - }, + "start":15,"end":16,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":6},"identifierName":"c"}, "name": "c" } } diff --git a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-and/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-and/output.json index b01e3ccaf9..217d82a457 100644 --- a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-and/output.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-and/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "LogicalExpression", - "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}}, "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": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "left": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "b" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"b"}, "name": "b" }, "operator": "&&", "right": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "c" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"c"}, "name": "c" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-or/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-or/output.json index 6947e60978..50d17cbea2 100644 --- a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-or/output.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/nullish-or/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "LogicalExpression", - "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}}, "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": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "left": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "b" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"b"}, "name": "b" }, "operator": "||", "right": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "c" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"c"}, "name": "c" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/or-nullish/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/or-nullish/output.json index f2e2798e40..de43613492 100644 --- a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/or-nullish/output.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/or-nullish/output.json @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "LogicalExpression", - "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}}, "left": { "type": "LogicalExpression", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "left": { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, "operator": "||", "right": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "b" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"b"}, "name": "b" }, "extra": { @@ -114,19 +35,7 @@ "operator": "??", "right": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "c" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"c"}, "name": "c" } } diff --git a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/with-pipeline/output.json b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/with-pipeline/output.json index e17ba18882..3753b07984 100644 --- a/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/with-pipeline/output.json +++ b/packages/babel-parser/test/fixtures/es2020/nullish-coalescing-operator/with-pipeline/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "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": 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": "b" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"b"}, "name": "b" }, "operator": "??", "right": { "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" } } 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 9f59d5d3c2..705c98e5d1 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 @@ -1,108 +1,29 @@ { "type": "File", - "start": 0, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":0,"end":71,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":0,"end":71,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "OptionalMemberExpression", - "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": "OptionalMemberExpression", - "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": 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" }, "property": { "type": "Identifier", - "start": 5, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "class" - }, + "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10},"identifierName":"class"}, "name": "class" }, "computed": false, @@ -110,19 +31,7 @@ }, "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, @@ -131,78 +40,21 @@ }, { "type": "ExpressionStatement", - "start": 15, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":15,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "expression": { "type": "OptionalMemberExpression", - "start": 15, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":15,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "object": { "type": "OptionalMemberExpression", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":15,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "object": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3},"identifierName":"foo"}, "name": "foo" }, "property": { "type": "Identifier", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "function" - }, + "start":20,"end":28,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":13},"identifierName":"function"}, "name": "function" }, "computed": false, @@ -210,19 +62,7 @@ }, "property": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "bar" - }, + "start":29,"end":32,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -231,92 +71,24 @@ }, { "type": "ExpressionStatement", - "start": 33, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":33,"end":52,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":19}}, "expression": { "type": "OptionalMemberExpression", - "start": 33, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":33,"end":52,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":19}}, "object": { "type": "OptionalMemberExpression", - "start": 33, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":33,"end":48,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":15}}, "object": { "type": "OptionalMemberExpression", - "start": 33, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":33,"end":41,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":8}}, "object": { "type": "Identifier", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "foo" - }, + "start":33,"end":36,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3},"identifierName":"foo"}, "name": "foo" }, "property": { "type": "Identifier", - "start": 38, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "bar" - }, + "start":38,"end":41,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":8},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -324,19 +96,7 @@ }, "property": { "type": "Identifier", - "start": 43, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "class" - }, + "start":43,"end":48,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":15},"identifierName":"class"}, "name": "class" }, "computed": false, @@ -344,19 +104,7 @@ }, "property": { "type": "Identifier", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 19 - }, - "identifierName": "bar" - }, + "start":49,"end":52,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":19},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -365,78 +113,21 @@ }, { "type": "ExpressionStatement", - "start": 53, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":53,"end":71,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":18}}, "expression": { "type": "OptionalMemberExpression", - "start": 53, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":53,"end":71,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":18}}, "object": { "type": "OptionalMemberExpression", - "start": 53, - "end": 66, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":53,"end":66,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":13}}, "object": { "type": "Identifier", - "start": 53, - "end": 56, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - }, - "identifierName": "foo" - }, + "start":53,"end":56,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":3},"identifierName":"foo"}, "name": "foo" }, "property": { "type": "Identifier", - "start": 58, - "end": 66, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 13 - }, - "identifierName": "function" - }, + "start":58,"end":66,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":13},"identifierName":"function"}, "name": "function" }, "computed": false, @@ -444,19 +135,7 @@ }, "property": { "type": "Identifier", - "start": 68, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 18 - }, - "identifierName": "bar" - }, + "start":68,"end":71,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":18},"identifierName":"bar"}, "name": "bar" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/class-contructor-call/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/class-contructor-call/output.json index 8ecf52133d..c5497bf4eb 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/class-contructor-call/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/class-contructor-call/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: constructors in/after an Optional Chain are not allowed (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "OptionalMemberExpression", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "object": { "type": "OptionalMemberExpression", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "object": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "C" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"C"}, "name": "C" }, "property": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "b" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" }, "computed": false, @@ -127,19 +37,7 @@ }, "property": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "d" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"d"}, "name": "d" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/conditional-decimal/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/conditional-decimal/output.json index 537a8c44f7..3cdd7bc2cb 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/conditional-decimal/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/conditional-decimal/output.json @@ -1,92 +1,26 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":13}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "BooleanLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "value": true }, "consequent": { "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": 0.3, "raw": ".3" @@ -95,18 +29,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": 0, "raw": "0" @@ -117,62 +40,18 @@ }, { "type": "ExpressionStatement", - "start": 11, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":11,"end":24,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":13}}, "expression": { "type": "ConditionalExpression", - "start": 11, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":11,"end":24,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":13}}, "test": { "type": "BooleanLiteral", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":11,"end":15,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":4}}, "value": true }, "consequent": { "type": "NumericLiteral", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":18,"end":20,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":9}}, "extra": { "rawValue": 0.3, "raw": ".3" @@ -181,18 +60,7 @@ }, "alternate": { "type": "NumericLiteral", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":23,"end":24,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}}, "extra": { "rawValue": 0, "raw": "0" 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 0d52f30d9a..81a9ea975a 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 @@ -1,448 +1,139 @@ { "type": "File", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 10 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 10 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":10}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "OptionalCallExpression", - "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}}, "callee": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "func" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"func"}, "name": "func" }, - "arguments": [], - "optional": true + "optional": true, + "arguments": [] } }, { "type": "ExpressionStatement", - "start": 10, - "end": 22, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":10,"end":22,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "expression": { "type": "OptionalCallExpression", - "start": 10, - "end": 22, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":10,"end":22,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "callee": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "func" - }, + "start":10,"end":14,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":4},"identifierName":"func"}, "name": "func" }, + "optional": true, "arguments": [ { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "a" - }, + "start":17,"end":18,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "b" - }, + "start":20,"end":21,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"b"}, "name": "b" } - ], - "optional": true + ] } }, { "type": "ExpressionStatement", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":24,"end":35,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":11}}, "expression": { "type": "OptionalCallExpression", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":24,"end":35,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":11}}, "callee": { "type": "OptionalMemberExpression", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 7 - } - }, + "start":24,"end":31,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":7}}, "object": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - }, - "identifierName": "a" - }, + "start":24,"end":25,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":1},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 5, - "column": 3 - }, - "end": { - "line": 5, - "column": 7 - }, - "identifierName": "func" - }, + "start":27,"end":31,"loc":{"start":{"line":5,"column":3},"end":{"line":5,"column":7},"identifierName":"func"}, "name": "func" }, "computed": false, "optional": true }, - "arguments": [], - "optional": true + "optional": true, + "arguments": [] } }, { "type": "ExpressionStatement", - "start": 37, - "end": 52, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 15 - } - }, + "start":37,"end":52,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":15}}, "expression": { "type": "OptionalCallExpression", - "start": 37, - "end": 52, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 15 - } - }, + "start":37,"end":52,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":15}}, "callee": { "type": "OptionalMemberExpression", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 7 - } - }, + "start":37,"end":44,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":7}}, "object": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - }, - "identifierName": "a" - }, + "start":37,"end":38,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":1},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 40, - "end": 44, - "loc": { - "start": { - "line": 7, - "column": 3 - }, - "end": { - "line": 7, - "column": 7 - }, - "identifierName": "func" - }, + "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, "arguments": [ { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 7, - "column": 10 - }, - "end": { - "line": 7, - "column": 11 - }, - "identifierName": "a" - }, + "start":47,"end":48,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":11},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 14 - }, - "identifierName": "b" - }, + "start":50,"end":51,"loc":{"start":{"line":7,"column":13},"end":{"line":7,"column":14},"identifierName":"b"}, "name": "b" } - ], - "optional": true + ] } }, { "type": "ExpressionStatement", - "start": 54, - "end": 64, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 10 - } - }, + "start":54,"end":64,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":10}}, "expression": { "type": "OptionalCallExpression", - "start": 54, - "end": 64, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 10 - } - }, + "start":54,"end":64,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":10}}, "callee": { "type": "MemberExpression", - "start": 54, - "end": 60, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 6 - } - }, + "start":54,"end":60,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":6}}, "object": { "type": "Identifier", - "start": 54, - "end": 55, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - }, - "identifierName": "a" - }, + "start":54,"end":55,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":1},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 56, - "end": 60, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 6 - }, - "identifierName": "func" - }, + "start":56,"end":60,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":6},"identifierName":"func"}, "name": "func" }, "computed": false }, - "arguments": [], - "optional": true + "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 b93dd4b235..22f3e7a04f 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 @@ -1,94 +1,26 @@ { "type": "File", - "start": 0, - "end": 97, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 13 - } - }, + "start":0,"end":97,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 97, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 13 - } - }, + "start":0,"end":97,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":13}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "OptionalMemberExpression", - "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": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "obj" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"obj"}, "name": "obj" }, "property": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "expr" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"expr"}, "name": "expr" }, "computed": true, @@ -97,78 +29,21 @@ }, { "type": "ExpressionStatement", - "start": 13, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":13,"end":33,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":20}}, "expression": { "type": "OptionalMemberExpression", - "start": 13, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":13,"end":33,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":20}}, "object": { "type": "OptionalMemberExpression", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":13,"end":24,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":11}}, "object": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "obj" - }, + "start":13,"end":16,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3},"identifierName":"obj"}, "name": "obj" }, "property": { "type": "Identifier", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "expr" - }, + "start":19,"end":23,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":10},"identifierName":"expr"}, "name": "expr" }, "computed": true, @@ -176,19 +51,7 @@ }, "property": { "type": "Identifier", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 19 - }, - "identifierName": "other" - }, + "start":27,"end":32,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":19},"identifierName":"other"}, "name": "other" }, "computed": true, @@ -197,63 +60,18 @@ }, { "type": "ExpressionStatement", - "start": 35, - "end": 46, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":35,"end":46,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":11}}, "expression": { "type": "OptionalMemberExpression", - "start": 35, - "end": 46, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":35,"end":46,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":11}}, "object": { "type": "Identifier", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - }, - "identifierName": "obj" - }, + "start":35,"end":38,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":3},"identifierName":"obj"}, "name": "obj" }, "property": { "type": "BooleanLiteral", - "start": 41, - "end": 45, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":41,"end":45,"loc":{"start":{"line":5,"column":6},"end":{"line":5,"column":10}}, "value": true }, "computed": true, @@ -262,77 +80,21 @@ }, { "type": "ExpressionStatement", - "start": 48, - "end": 67, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 19 - } - }, + "start":48,"end":67,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":19}}, "expression": { "type": "OptionalMemberExpression", - "start": 48, - "end": 67, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 19 - } - }, + "start":48,"end":67,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":19}}, "object": { "type": "OptionalMemberExpression", - "start": 48, - "end": 59, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 11 - } - }, + "start":48,"end":59,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":11}}, "object": { "type": "Identifier", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 3 - }, - "identifierName": "obj" - }, + "start":48,"end":51,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":3},"identifierName":"obj"}, "name": "obj" }, "property": { "type": "BooleanLiteral", - "start": 54, - "end": 58, - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 10 - } - }, + "start":54,"end":58,"loc":{"start":{"line":7,"column":6},"end":{"line":7,"column":10}}, "value": true }, "computed": true, @@ -340,18 +102,7 @@ }, "property": { "type": "BooleanLiteral", - "start": 62, - "end": 66, - "loc": { - "start": { - "line": 7, - "column": 14 - }, - "end": { - "line": 7, - "column": 18 - } - }, + "start":62,"end":66,"loc":{"start":{"line":7,"column":14},"end":{"line":7,"column":18}}, "value": true }, "computed": true, @@ -360,97 +111,28 @@ }, { "type": "ExpressionStatement", - "start": 69, - "end": 82, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 13 - } - }, + "start":69,"end":82,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":13}}, "expression": { "type": "OptionalMemberExpression", - "start": 69, - "end": 82, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 13 - } - }, + "start":69,"end":82,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":13}}, "object": { "type": "MemberExpression", - "start": 69, - "end": 74, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 5 - } - }, + "start":69,"end":74,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":5}}, "object": { "type": "Identifier", - "start": 69, - "end": 72, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 3 - }, - "identifierName": "obj" - }, + "start":69,"end":72,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":3},"identifierName":"obj"}, "name": "obj" }, "property": { "type": "Identifier", - "start": 73, - "end": 74, - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 9, - "column": 5 - }, - "identifierName": "a" - }, + "start":73,"end":74,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":5},"identifierName":"a"}, "name": "a" }, "computed": false }, "property": { "type": "Identifier", - "start": 77, - "end": 81, - "loc": { - "start": { - "line": 9, - "column": 8 - }, - "end": { - "line": 9, - "column": 12 - }, - "identifierName": "expr" - }, + "start":77,"end":81,"loc":{"start":{"line":9,"column":8},"end":{"line":9,"column":12},"identifierName":"expr"}, "name": "expr" }, "computed": true, @@ -459,96 +141,28 @@ }, { "type": "ExpressionStatement", - "start": 84, - "end": 97, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 13 - } - }, + "start":84,"end":97,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":13}}, "expression": { "type": "OptionalMemberExpression", - "start": 84, - "end": 97, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 13 - } - }, + "start":84,"end":97,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":13}}, "object": { "type": "MemberExpression", - "start": 84, - "end": 89, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 5 - } - }, + "start":84,"end":89,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":5}}, "object": { "type": "Identifier", - "start": 84, - "end": 87, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 3 - }, - "identifierName": "obj" - }, + "start":84,"end":87,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":3},"identifierName":"obj"}, "name": "obj" }, "property": { "type": "Identifier", - "start": 88, - "end": 89, - "loc": { - "start": { - "line": 11, - "column": 4 - }, - "end": { - "line": 11, - "column": 5 - }, - "identifierName": "a" - }, + "start":88,"end":89,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":5},"identifierName":"a"}, "name": "a" }, "computed": false }, "property": { "type": "BooleanLiteral", - "start": 92, - "end": 96, - "loc": { - "start": { - "line": 11, - "column": 8 - }, - "end": { - "line": 11, - "column": 12 - } - }, + "start":92,"end":96,"loc":{"start":{"line":11,"column":8},"end":{"line":11,"column":12}}, "value": true }, "computed": 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 9232427dda..fcb6aa51b0 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 @@ -1,94 +1,26 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 12 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 12 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "OptionalMemberExpression", - "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}}, "object": { "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" }, "property": { "type": "Identifier", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "bar" - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -97,78 +29,21 @@ }, { "type": "ExpressionStatement", - "start": 10, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":10,"end":23,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":13}}, "expression": { "type": "OptionalMemberExpression", - "start": 10, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":10,"end":23,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":13}}, "object": { "type": "OptionalMemberExpression", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":10,"end":18,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":8}}, "object": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3},"identifierName":"foo"}, "name": "foo" }, "property": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "bar" - }, + "start":15,"end":18,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":8},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -176,19 +51,7 @@ }, "property": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "baz" - }, + "start":20,"end":23,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":13},"identifierName":"baz"}, "name": "baz" }, "computed": false, @@ -197,97 +60,28 @@ }, { "type": "ExpressionStatement", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 12 - } - }, + "start":25,"end":37,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":12}}, "expression": { "type": "OptionalMemberExpression", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 12 - } - }, + "start":25,"end":37,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":12}}, "object": { "type": "MemberExpression", - "start": 25, - "end": 32, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 7 - } - }, + "start":25,"end":32,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":7}}, "object": { "type": "Identifier", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - }, - "identifierName": "foo" - }, + "start":25,"end":28,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":3},"identifierName":"foo"}, "name": "foo" }, "property": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 7 - }, - "identifierName": "bar" - }, + "start":29,"end":32,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":7},"identifierName":"bar"}, "name": "bar" }, "computed": false }, "property": { "type": "Identifier", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 12 - }, - "identifierName": "baz" - }, + "start":34,"end":37,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":12},"identifierName":"baz"}, "name": "baz" }, "computed": false, 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 15435af4c4..64874e4b02 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 @@ -1,141 +1,39 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "OptionalCallExpression", - "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}}, "callee": { "type": "OptionalMemberExpression", - "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}}, "object": { "type": "MemberExpression", - "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}}, "object": { "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" }, "property": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "b" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"b"}, "name": "b" }, "computed": false }, "property": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "c" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"c"}, "name": "c" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-constructor/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-constructor/output.json index 6c643fbdd8..5039bd06d9 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-constructor/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-constructor/output.json @@ -1,80 +1,24 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: constructors in/after an Optional Chain are not allowed (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property-class/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property-class/output.json index 1f9545412a..dc31af9de3 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property-class/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property-class/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (3:15)" ], "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 7, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":7,"end":50,"loc":{"start":{"line":1,"column":7},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 13, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":13,"end":48,"loc":{"start":{"line":2,"column":4},"end":{"line":4,"column":5}}, "static": false, "key": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "b" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"b"}, "name": "b" }, "computed": false, @@ -119,77 +40,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":16,"end":48,"loc":{"start":{"line":2,"column":7},"end":{"line":4,"column":5}}, "body": [ { "type": "ReturnStatement", - "start": 26, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":26,"end":42,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":24}}, "argument": { "type": "OptionalMemberExpression", - "start": 33, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":33,"end":41,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":23}}, "object": { "type": "Super", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 20 - } - } + "start":33,"end":38,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":20}} }, "property": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 23 - }, - "identifierName": "b" - }, + "start":40,"end":41,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":23},"identifierName":"b"}, "name": "b" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property/output.json index 548b5c32d5..393e2fd745 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-super-property/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: super can only be used with function calls (i.e. super()) or in property accesses (i.e. super.prop or super[prop]) (3:15)" ], "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":6,"end":53,"loc":{"start":{"line":1,"column":6},"end":{"line":5,"column":1}}, "id": { "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" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":10,"end":53,"loc":{"start":{"line":1,"column":10},"end":{"line":5,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 16, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":16,"end":51,"loc":{"start":{"line":2,"column":4},"end":{"line":4,"column":5}}, "method": true, "key": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "b" - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"b"}, "name": "b" }, "computed": false, @@ -133,77 +43,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":19,"end":51,"loc":{"start":{"line":2,"column":7},"end":{"line":4,"column":5}}, "body": [ { "type": "ReturnStatement", - "start": 29, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":29,"end":45,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":24}}, "argument": { "type": "OptionalMemberExpression", - "start": 36, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":36,"end":44,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":23}}, "object": { "type": "Super", - "start": 36, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 20 - } - } + "start":36,"end":41,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":20}} }, "property": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 23 - }, - "identifierName": "c" - }, + "start":43,"end":44,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":23},"identifierName":"c"}, "name": "c" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-tagged-template-literals/output.json b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-tagged-template-literals/output.json index 9dff15f15e..344f3d26b6 100644 --- a/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-tagged-template-literals/output.json +++ b/packages/babel-parser/test/fixtures/es2020/optional-chaining/optional-tagged-template-literals/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Tagged Template Literals are not allowed in optionalChain (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "OptionalMemberExpression", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "object": { "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" }, "property": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "b" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"b"}, "name": "b" }, "computed": false, @@ -113,34 +34,12 @@ }, "quasi": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "value": { "raw": "foo", "cooked": "foo" 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 3c50e58ebc..fc353364c2 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 @@ -1,108 +1,29 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":15}}, "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":15}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "MemberExpression", - "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}}, "object": { "type": "OptionalMemberExpression", - "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}}, "object": { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "b" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"b"}, "name": "b" }, "computed": false, @@ -114,19 +35,7 @@ }, "property": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "c" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"c"}, "name": "c" }, "computed": false @@ -134,92 +43,24 @@ }, { "type": "ExpressionStatement", - "start": 11, - "end": 22, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":11,"end":22,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":11}}, "expression": { "type": "CallExpression", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":11,"end":21,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":10}}, "callee": { "type": "MemberExpression", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":11,"end":19,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":8}}, "object": { "type": "OptionalMemberExpression", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":12,"end":16,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":5}}, "object": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 2 - }, - "identifierName": "a" - }, + "start":12,"end":13,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":2},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "b" - }, + "start":15,"end":16,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"b"}, "name": "b" }, "computed": false, @@ -231,19 +72,7 @@ }, "property": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "c" - }, + "start":18,"end":19,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"c"}, "name": "c" }, "computed": false @@ -253,106 +82,27 @@ }, { "type": "ExpressionStatement", - "start": 24, - "end": 39, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":24,"end":39,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":15}}, "expression": { "type": "OptionalMemberExpression", - "start": 24, - "end": 38, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 14 - } - }, + "start":24,"end":38,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":14}}, "object": { "type": "OptionalMemberExpression", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":24,"end":35,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":11}}, "object": { "type": "OptionalMemberExpression", - "start": 24, - "end": 33, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 9 - } - }, + "start":24,"end":33,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":9}}, "object": { "type": "OptionalMemberExpression", - "start": 25, - "end": 29, - "loc": { - "start": { - "line": 5, - "column": 1 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":25,"end":29,"loc":{"start":{"line":5,"column":1},"end":{"line":5,"column":5}}, "object": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 5, - "column": 1 - }, - "end": { - "line": 5, - "column": 2 - }, - "identifierName": "a" - }, + "start":25,"end":26,"loc":{"start":{"line":5,"column":1},"end":{"line":5,"column":2},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - }, - "identifierName": "b" - }, + "start":28,"end":29,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":5},"identifierName":"b"}, "name": "b" }, "computed": false, @@ -364,19 +114,7 @@ }, "property": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 9 - }, - "identifierName": "c" - }, + "start":32,"end":33,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":9},"identifierName":"c"}, "name": "c" }, "computed": false, @@ -384,19 +122,7 @@ }, "property": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 11 - }, - "identifierName": "d" - }, + "start":34,"end":35,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":11},"identifierName":"d"}, "name": "d" }, "computed": false, @@ -404,19 +130,7 @@ }, "property": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 14 - }, - "identifierName": "e" - }, + "start":37,"end":38,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":14},"identifierName":"e"}, "name": "e" }, "computed": false, 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 b3c6c779d3..83b934aec1 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 @@ -1,150 +1,38 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "OptionalMemberExpression", - "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": "OptionalMemberExpression", - "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": "OptionalMemberExpression", - "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}}, "object": { "type": "OptionalMemberExpression", - "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}}, "object": { "type": "OptionalMemberExpression", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "object": { "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" }, "property": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "b" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"b"}, "name": "b" }, "computed": false, @@ -152,19 +40,7 @@ }, "property": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "c" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"c"}, "name": "c" }, "computed": false, @@ -172,19 +48,7 @@ }, "property": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "d" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"d"}, "name": "d" }, "computed": false, @@ -192,19 +56,7 @@ }, "property": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "e" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"e"}, "name": "e" }, "computed": false, @@ -212,19 +64,7 @@ }, "property": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "f" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"f"}, "name": "f" }, "computed": false, @@ -233,158 +73,44 @@ }, { "type": "ExpressionStatement", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":15,"end":27,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "expression": { "type": "OptionalMemberExpression", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":15,"end":27,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "object": { "type": "OptionalMemberExpression", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":15,"end":25,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":10}}, "object": { "type": "OptionalMemberExpression", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":15,"end":23,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":8}}, "object": { "type": "MemberExpression", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":15,"end":20,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":5}}, "object": { "type": "MemberExpression", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":15,"end":18,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3}}, "object": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":1},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "b" - }, + "start":17,"end":18,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"b"}, "name": "b" }, "computed": false }, "property": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "c" - }, + "start":19,"end":20,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"c"}, "name": "c" }, "computed": false }, "property": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "d" - }, + "start":22,"end":23,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"d"}, "name": "d" }, "computed": false, @@ -392,19 +118,7 @@ }, "property": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "e" - }, + "start":24,"end":25,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"e"}, "name": "e" }, "computed": false, @@ -412,19 +126,7 @@ }, "property": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 12 - }, - "identifierName": "f" - }, + "start":26,"end":27,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":12},"identifierName":"f"}, "name": "f" }, "computed": 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 890c6f2248..b0b4f5871f 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 @@ -1,127 +1,36 @@ { "type": "File", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"B"}, "name": "B" }, "body": { "type": "ClassBody", - "start": 18, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":18,"end":66,"loc":{"start":{"line":1,"column":18},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 24, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":24,"end":64,"loc":{"start":{"line":2,"column":4},"end":{"line":4,"column":5}}, "static": false, "key": { "type": "Identifier", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "constructor" - }, + "start":24,"end":35,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":15},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -132,93 +41,26 @@ "params": [], "body": { "type": "BlockStatement", - "start": 37, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":37,"end":64,"loc":{"start":{"line":2,"column":17},"end":{"line":4,"column":5}}, "body": [ { "type": "ExpressionStatement", - "start": 47, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":47,"end":58,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":19}}, "expression": { "type": "OptionalMemberExpression", - "start": 47, - "end": 57, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":47,"end":57,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":18}}, "object": { "type": "CallExpression", - "start": 47, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":47,"end":54,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":15}}, "callee": { "type": "Super", - "start": 47, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":47,"end":52,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":13}} }, "arguments": [] }, "property": { "type": "Identifier", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 18 - }, - "identifierName": "b" - }, + "start":56,"end":57,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":18},"identifierName":"b"}, "name": "b" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/output.json index 110a8a000b..2b437f1204 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0000/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "body": [ { "type": "ExpressionStatement", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "expression": { "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" } }, { "type": "ExpressionStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":4,"end":7,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "expression": { "type": "UpdateExpression", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":4,"end":7,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "operator": "++", "prefix": true, "argument": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "y" - }, + "start":6,"end":7,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"y"}, "name": "y" } } diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/output.json index 867fc3fc00..c289ddae85 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0001/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "body": [ { "type": "ExpressionStatement", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "expression": { "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" } }, { "type": "ExpressionStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":4,"end":7,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "expression": { "type": "UpdateExpression", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":4,"end":7,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "operator": "--", "prefix": true, "argument": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "y" - }, + "start":6,"end":7,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"y"}, "name": "y" } } diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/output.json index 412ba4db54..6ee561c3d4 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0002/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": null, @@ -80,18 +24,7 @@ { "type": "CommentBlock", "value": " comment ", - "start": 6, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}} } ] } @@ -105,18 +38,7 @@ { "type": "CommentBlock", "value": " comment ", - "start": 6, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/output.json index d4e339d66f..fb37cb7dd9 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0003/output.json @@ -1,109 +1,31 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":4}}, "body": [ { "type": "VariableDeclaration", - "start": 2, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":2,"end":19,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 14, "raw": "14" @@ -113,49 +35,15 @@ }, { "type": "VariableDeclarator", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "y" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"y"}, "name": "y" }, "init": { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 3, "raw": "3" @@ -168,33 +56,10 @@ }, { "type": "ExpressionStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":20,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "expression": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "z" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/output.json index ccd2a5557c..50691134a0 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0004/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":13,"end":32,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":8}}, "body": [ { "type": "ContinueStatement", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "label": null }, { "type": "ExpressionStatement", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":24,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "there" - }, + "start":24,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5},"identifierName":"there"}, "name": "there" } } diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/output.json index 3fcb48aa32..79fce2dd49 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0005/output.json @@ -1,160 +1,49 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":13,"end":43,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":8}}, "body": [ { "type": "ContinueStatement", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "label": null, "trailingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 24, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 34 - } - } + "start":24,"end":34,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":34}} } ] }, { "type": "ExpressionStatement", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":35,"end":41,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 35, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "there" - }, + "start":35,"end":40,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5},"identifierName":"there"}, "name": "there" }, "leadingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 24, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 34 - } - } + "start":24,"end":34,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":34}} } ] } @@ -169,18 +58,7 @@ { "type": "CommentLine", "value": " Comment", - "start": 24, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 34 - } - } + "start":24,"end":34,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":34}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/output.json index 395230285f..a496fcfd3a 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0006/output.json @@ -1,160 +1,49 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":13,"end":55,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":18}}, "body": [ { "type": "ContinueStatement", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "label": null, "trailingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 24, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":24,"end":47,"loc":{"start":{"line":1,"column":24},"end":{"line":2,"column":10}} } ] }, { "type": "ExpressionStatement", - "start": 47, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":47,"end":53,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}}, "expression": { "type": "Identifier", - "start": 47, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "there" - }, + "start":47,"end":52,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":15},"identifierName":"there"}, "name": "there" }, "leadingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 24, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":24,"end":47,"loc":{"start":{"line":1,"column":24},"end":{"line":2,"column":10}} } ] } @@ -169,18 +58,7 @@ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 24, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":24,"end":47,"loc":{"start":{"line":1,"column":24},"end":{"line":2,"column":10}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/output.json index 40442d2489..8e63588753 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0007/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":13,"end":29,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":8}}, "body": [ { "type": "BreakStatement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "label": null }, { "type": "ExpressionStatement", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":21,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "there" - }, + "start":21,"end":26,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5},"identifierName":"there"}, "name": "there" } } diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/output.json index 074c0c8bb6..db5aabc02b 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0008/output.json @@ -1,160 +1,49 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":13,"end":40,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":8}}, "body": [ { "type": "BreakStatement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "label": null, "trailingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 21, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":21,"end":31,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":31}} } ] }, { "type": "ExpressionStatement", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":32,"end":38,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 32, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "there" - }, + "start":32,"end":37,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5},"identifierName":"there"}, "name": "there" }, "leadingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 21, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":21,"end":31,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":31}} } ] } @@ -169,18 +58,7 @@ { "type": "CommentLine", "value": " Comment", - "start": 21, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":21,"end":31,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":31}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/output.json index f58cfb0778..07e673f84e 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0009/output.json @@ -1,160 +1,49 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":13,"end":52,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":18}}, "body": [ { "type": "BreakStatement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "label": null, "trailingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 21, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":21,"end":44,"loc":{"start":{"line":1,"column":21},"end":{"line":2,"column":10}} } ] }, { "type": "ExpressionStatement", - "start": 44, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":44,"end":50,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}}, "expression": { "type": "Identifier", - "start": 44, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "there" - }, + "start":44,"end":49,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":15},"identifierName":"there"}, "name": "there" }, "leadingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 21, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":21,"end":44,"loc":{"start":{"line":1,"column":21},"end":{"line":2,"column":10}} } ] } @@ -169,18 +58,7 @@ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 21, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":21,"end":44,"loc":{"start":{"line":1,"column":21},"end":{"line":2,"column":10}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/output.json index a6f087d5e2..90a7b471fe 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0010/output.json @@ -1,126 +1,37 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":1,"end":24,"loc":{"start":{"line":1,"column":1},"end":{"line":2,"column":4}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":11,"end":24,"loc":{"start":{"line":1,"column":11},"end":{"line":2,"column":4}}, "body": [ { "type": "ReturnStatement", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}}, "argument": null }, { "type": "ExpressionStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":20,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "expression": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/output.json index 205e7e5731..636d44f1ca 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0011/output.json @@ -1,162 +1,51 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":5}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":2,"column":4}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":11,"end":35,"loc":{"start":{"line":1,"column":11},"end":{"line":2,"column":4}}, "body": [ { "type": "ReturnStatement", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}}, "argument": null, "trailingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}} } ] }, { "type": "ExpressionStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":31,"end":33,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "expression": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "x" - }, + "start":31,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"x"}, "name": "x" }, "leadingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}} } ] } @@ -176,18 +65,7 @@ { "type": "CommentLine", "value": " Comment", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/output.json index 98570e79f9..a7c128bbeb 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0012/output.json @@ -1,162 +1,51 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":1,"end":46,"loc":{"start":{"line":1,"column":1},"end":{"line":2,"column":14}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":11,"end":46,"loc":{"start":{"line":1,"column":11},"end":{"line":2,"column":14}}, "body": [ { "type": "ReturnStatement", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}}, "argument": null, "trailingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 19, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":19,"end":42,"loc":{"start":{"line":1,"column":19},"end":{"line":2,"column":10}} } ] }, { "type": "ExpressionStatement", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":42,"end":44,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":12}}, "expression": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":42,"end":43,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" }, "leadingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 19, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":19,"end":42,"loc":{"start":{"line":1,"column":19},"end":{"line":2,"column":10}} } ] } @@ -176,18 +65,7 @@ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 19, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":19,"end":42,"loc":{"start":{"line":1,"column":19},"end":{"line":2,"column":10}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/output.json index aed9954aa3..e6e9eaa784 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0013/output.json @@ -1,110 +1,31 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "body": [ { "type": "ThrowStatement", - "start": 2, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":2,"end":13,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":13}}, "argument": { "type": "Identifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "error" - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"error"}, "name": "error" } }, { "type": "ExpressionStatement", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":14,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "error" - }, + "start":14,"end":19,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5},"identifierName":"error"}, "name": "error" } } diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/output.json index ab8810f09c..5929da115c 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0014/output.json @@ -1,146 +1,45 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "body": [ { "type": "ThrowStatement", - "start": 2, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":2,"end":13,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":13}}, "argument": { "type": "Identifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "error" - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"error"}, "name": "error" }, "trailingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":13,"end":23,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":23}} } ] }, { "type": "ExpressionStatement", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":24,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "error" - }, + "start":24,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5},"identifierName":"error"}, "name": "error" }, "leadingComments": [ { "type": "CommentLine", "value": " Comment", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":13,"end":23,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":23}} } ] } @@ -154,18 +53,7 @@ { "type": "CommentLine", "value": " Comment", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":13,"end":23,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":23}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/output.json b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/output.json index 183a587ddc..97e46379c3 100644 --- a/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/output.json +++ b/packages/babel-parser/test/fixtures/esprima/automatic-semicolon-insertion/migrated_0015/output.json @@ -1,146 +1,45 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "body": [ { "type": "ThrowStatement", - "start": 2, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":2,"end":13,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":13}}, "argument": { "type": "Identifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "error" - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"error"}, "name": "error" }, "trailingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 13, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":13,"end":36,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":10}} } ] }, { "type": "ExpressionStatement", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":36,"end":42,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}}, "expression": { "type": "Identifier", - "start": 36, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "error" - }, + "start":36,"end":41,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":15},"identifierName":"error"}, "name": "error" }, "leadingComments": [ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 13, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":13,"end":36,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":10}} } ] } @@ -154,18 +53,7 @@ { "type": "CommentBlock", "value": " Multiline\nComment ", - "start": 13, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":13,"end":36,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":10}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-const/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-const/migrated_0000/output.json index db86a852e1..396a6c89cb 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-const/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-const/migrated_0000/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-const/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-const/migrated_0001/output.json index 691def9334..656b96520e 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-const/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-const/migrated_0001/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "VariableDeclaration", - "start": 2, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":2,"end":14,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, "init": { "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/fixtures/esprima/declaration-const/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-const/migrated_0002/output.json index 41c281d3dc..3c23758758 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-const/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-const/migrated_0002/output.json @@ -1,109 +1,31 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "body": [ { "type": "VariableDeclaration", - "start": 2, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":2,"end":31,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":31}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, "init": { "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": 14, "raw": "14" @@ -113,49 +35,15 @@ }, { "type": "VariableDeclarator", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "y" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"y"}, "name": "y" }, "init": { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "extra": { "rawValue": 3, "raw": "3" @@ -165,49 +53,15 @@ }, { "type": "VariableDeclarator", - "start": 23, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":23,"end":31,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "z" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"z"}, "name": "z" }, "init": { "type": "NumericLiteral", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31}}, "extra": { "rawValue": 1977, "raw": "1977" 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 aa4301697c..94ce8601ab 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Argument name clash (1:14)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,83 +23,26 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":17,"end":32,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":32}}, "body": [], "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0000/output.json index d5cdac1d36..352ffb6fc1 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0000/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -65,62 +20,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "expression": { "type": "CallExpression", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}}, "callee": { "type": "Identifier", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "sayHi" - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24},"identifierName":"sayHi"}, "name": "sayHi" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0001/output.json index 3104ab9ccf..91afc6eae0 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0001/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "eval" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -65,18 +20,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0002/output.json index d26abaf0e3..e14cc06b04 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0002/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "arguments" - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18},"identifierName":"arguments"}, "name": "arguments" }, "generator": false, @@ -65,18 +20,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0003/output.json index db77094d78..02b469112a 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0003/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "test" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"test"}, "name": "test" }, "generator": false, @@ -65,53 +20,18 @@ "params": [ { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "t" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"t"}, "name": "t" }, { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "t" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"t"}, "name": "t" } ], "body": { "type": "BlockStatement", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0004/output.json index 1d7e31b526..518d4ff517 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0004/output.json @@ -1,77 +1,21 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":1,"end":24,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "test" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"test"}, "name": "test" }, "generator": false, @@ -79,53 +23,18 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "t" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"t"}, "name": "t" }, { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "t" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"t"}, "name": "t" } ], "body": { "type": "BlockStatement", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24}}, "body": [], "directives": [] }, 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 77acd2e88e..68368affc1 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "eval" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -65,48 +20,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":16,"end":53,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":53}}, "body": [ { "type": "FunctionDeclaration", - "start": 18, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":18,"end":51,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":51}}, "id": { "type": "Identifier", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "inner" - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32},"identifierName":"inner"}, "name": "inner" }, "generator": false, @@ -114,48 +35,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 35, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":35,"end":51,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":51}}, "body": [], "directives": [ { "type": "Directive", - "start": 37, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":37,"end":49,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":49}}, "value": { "type": "DirectiveLiteral", - "start": 37, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":37,"end":49,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":49}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0006/output.json index a0915a8bde..058bf6f3e4 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0006/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -65,80 +20,23 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "expression": { "type": "CallExpression", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27}}, "callee": { "type": "Identifier", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "sayHi" - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"sayHi"}, "name": "sayHi" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0007/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0007/output.json index 4a6668b95a..2c224fe253 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0007/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0007/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -65,97 +20,28 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "b" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"b"}, "name": "b" } ], "body": { "type": "BlockStatement", - "start": 21, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, "body": [ { "type": "ExpressionStatement", - "start": 23, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":23,"end":31,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":31}}, "expression": { "type": "CallExpression", - "start": 23, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":23,"end":30,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":30}}, "callee": { "type": "Identifier", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "sayHi" - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28},"identifierName":"sayHi"}, "name": "sayHi" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0008/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0008/output.json index ad99f992e1..834ffa769d 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0008/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0008/output.json @@ -1,156 +1,44 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":4,"end":31,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "hi" - }, + "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6},"identifierName":"hi"}, "name": "hi" }, "init": { "type": "FunctionExpression", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "body": [ { "type": "ExpressionStatement", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29}}, "expression": { "type": "CallExpression", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29}}, "callee": { "type": "Identifier", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "sayHi" - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27},"identifierName":"sayHi"}, "name": "sayHi" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0009/output.json index c6c506d544..902977b899 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0009/output.json @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":4,"end":28,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "hi" - }, + "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6},"identifierName":"hi"}, "name": "hi" }, "init": { "type": "FunctionExpression", - "start": 9, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":9,"end":28,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "eval" - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -111,18 +32,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":25,"end":28,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":28}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0010/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0010/output.json index 2c6c0d75a8..695e91aedd 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0010/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0010/output.json @@ -1,109 +1,30 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":4,"end":33,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "hi" - }, + "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6},"identifierName":"hi"}, "name": "hi" }, "init": { "type": "FunctionExpression", - "start": 9, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "arguments" - }, + "start":18,"end":27,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":27},"identifierName":"arguments"}, "name": "arguments" }, "generator": false, @@ -111,18 +32,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":30,"end":33,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0011/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0011/output.json index 7f0a025696..26b3458197 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0011/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0011/output.json @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":4,"end":37,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "hello" - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9},"identifierName":"hello"}, "name": "hello" }, "init": { "type": "FunctionExpression", - "start": 12, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":12,"end":37,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "hi" - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23},"identifierName":"hi"}, "name": "hi" }, "generator": false, @@ -111,62 +32,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 26, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":26,"end":37,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":37}}, "body": [ { "type": "ExpressionStatement", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35}}, "expression": { "type": "CallExpression", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35}}, "callee": { "type": "Identifier", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "sayHi" - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33},"identifierName":"sayHi"}, "name": "sayHi" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0012/output.json index aefb638ad9..cbd2d18d22 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0012/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0013/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0013/output.json index 275ac41e93..89092f9529 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0013/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0013/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "universe" - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"universe"}, "name": "universe" }, "generator": false, @@ -65,36 +20,13 @@ "params": [ { "type": "Identifier", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "__proto__" - }, + "start":18,"end":27,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":27},"identifierName":"__proto__"}, "name": "__proto__" } ], "body": { "type": "BlockStatement", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":29,"end":32,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":32}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0014/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0014/output.json index 71f1b8bd18..227aa82719 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0014/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-function/migrated_0014/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "test" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"test"}, "name": "test" }, "generator": false, @@ -65,61 +20,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":16,"end":38,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":38}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":18,"end":36,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":36}}, "expression": { "type": "BinaryExpression", - "start": 18, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":18,"end":35,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":35}}, "left": { "type": "StringLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "extra": { "rawValue": "use strict", "raw": "\"use strict\"" @@ -129,18 +40,7 @@ "operator": "+", "right": { "type": "NumericLiteral", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0000/output.json index d1a07b1d64..b68ff2e27c 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0000/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0001/output.json index b1b3dddbea..fa8fbdd963 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0001/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "VariableDeclaration", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0002/output.json index 477b83093b..744b22efd0 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0002/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "VariableDeclaration", - "start": 2, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":2,"end":12,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0003/output.json index 532e5a2d6a..0c7546766c 100644 --- a/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/declaration-let/migrated_0003/output.json @@ -1,109 +1,31 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "body": [ { "type": "VariableDeclaration", - "start": 2, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":2,"end":29,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":29}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 14, "raw": "14" @@ -113,49 +35,15 @@ }, { "type": "VariableDeclarator", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "y" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"y"}, "name": "y" }, "init": { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 3, "raw": "3" @@ -165,49 +53,15 @@ }, { "type": "VariableDeclarator", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "z" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"z"}, "name": "z" }, "init": { "type": "NumericLiteral", - "start": 25, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":25,"end":29,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":29}}, "extra": { "rawValue": 1977, "raw": "1977" 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 69d467e3c9..d9f6fda13c 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 @@ -1,172 +1,50 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":1,"end":45,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":45}}, "callee": { "type": "FunctionExpression", - "start": 1, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":1,"end":43,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":43}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":13,"end":43,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":43}}, "body": [ { "type": "WithStatement", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":32,"end":41,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":41}}, "object": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "i" - }, + "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39},"identifierName":"i"}, "name": "i" }, "body": { "type": "EmptyStatement", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - } - } + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41}} } } ], "directives": [ { "type": "Directive", - "start": 15, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":15,"end":31,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 15, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":15,"end":30,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":30}}, "value": "use\\x20strict", "extra": { "raw": "'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 fc292877c8..b2aee3e01f 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 @@ -1,172 +1,50 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":1,"end":43,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":43}}, "callee": { "type": "FunctionExpression", - "start": 1, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":1,"end":41,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":41}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":13,"end":41,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":41}}, "body": [ { "type": "WithStatement", - "start": 30, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":30,"end":39,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":39}}, "object": { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "i" - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37},"identifierName":"i"}, "name": "i" }, "body": { "type": "EmptyStatement", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - } - } + "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39}} } } ], "directives": [ { "type": "Directive", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":15,"end":29,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":29}}, "value": { "type": "DirectiveLiteral", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "value": "use\\nstrict", "extra": { "raw": "'use\\nstrict'", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/output.json index b15acf390f..9e31dda059 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-01/output.json @@ -1,96 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ArrayPattern", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "elements": [ { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" } ] @@ -98,33 +31,11 @@ ], "body": { "type": "ArrayExpression", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "elements": [ { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/output.json index 189fe30109..a603fe1d07 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-02/output.json @@ -1,113 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ArrayPattern", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "elements": [ { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "b" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"b"}, "name": "b" } ] @@ -115,18 +36,7 @@ ], "body": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/output.json index fca15c38d6..5642bc19a1 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-03/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ArrayPattern", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "elements": [ { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "argument": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "b" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" } } @@ -130,18 +40,7 @@ ], "body": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/output.json index 49e718ed82..fdba048fd7 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/array-binding-pattern-empty/output.json @@ -1,97 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": [ { "type": "ArrayPattern", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "elements": [] } ], "body": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/elision/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/elision/output.json index 2f49a3a77d..4c9cd14a8d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/elision/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/elision/output.json @@ -1,103 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ArrayPattern", - "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": { + "trailingComma": 3 }, "elements": [ null, null - ], - "extra": { - "trailingComma": 3 - } + ] } ], "body": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/output.json index 09552b591b..cd41333b8b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-binding-pattern/invalid-dup-param/output.json @@ -1,164 +1,51 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Argument name clash (1:11)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ArrayPattern", - "start": 1, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, "elements": [ { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, { "type": "ArrayPattern", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "elements": [ { "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" } ] }, { "type": "RestElement", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "argument": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "b" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"b"}, "name": "b" } } @@ -167,18 +54,7 @@ ], "body": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" 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 57442d5cb4..2bcffbf3a4 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "errors": [ "SyntaxError: Argument name clash (2:14)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":14,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":20}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "a" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,51 +23,16 @@ "params": [ { "type": "ArrayPattern", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":25,"end":30,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":16}}, "elements": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "a" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "a" - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"a"}, "name": "a" } ] @@ -120,18 +40,7 @@ ], "body": { "type": "BlockStatement", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":31,"end":34,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":20}}, "body": [], "directives": [] } @@ -140,32 +49,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 4242da8e09..cc0e0ad645 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":23}}, "errors": [ "SyntaxError: Argument name clash (2:17)" ], "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":14,"end":37,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "a" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,65 +23,19 @@ "params": [ { "type": "ArrayPattern", - "start": 25, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":25,"end":33,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":19}}, "elements": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "a" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "start": 28, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":28,"end":32,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":18}}, "argument": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "a" - }, + "start":31,"end":32,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"a"}, "name": "a" } } @@ -135,18 +44,7 @@ ], "body": { "type": "BlockStatement", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":34,"end":37,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23}}, "body": [], "directives": [] } @@ -155,32 +53,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 00b0c28f58..22f0d17046 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "errors": [ "SyntaxError: Argument name clash (2:19)" ], "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":14,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":25}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "a" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,83 +23,26 @@ "params": [ { "type": "ArrayPattern", - "start": 25, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":25,"end":35,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":21}}, "elements": [ { "type": "ObjectPattern", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":26,"end":29,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15}}, "properties": [ { "type": "ObjectProperty", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "a" - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "a" - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"a"}, "name": "a" }, "extra": { @@ -155,33 +53,10 @@ }, { "type": "RestElement", - "start": 30, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":30,"end":34,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":20}}, "argument": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "a" - }, + "start":33,"end":34,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20},"identifierName":"a"}, "name": "a" } } @@ -190,18 +65,7 @@ ], "body": { "type": "BlockStatement", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":36,"end":39,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25}}, "body": [], "directives": [] } @@ -210,32 +74,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/elision/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/elision/output.json index 0fc500c1c0..04b0ddfa02 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/elision/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/elision/output.json @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ArrayPattern", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "elements": [ { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" } ] }, "init": { "type": "NumericLiteral", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/output.json index 91b8476699..cae989f540 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-catch-param/output.json @@ -1,109 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "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}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":8,"end":21,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":21}}, "param": { "type": "ArrayPattern", - "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}}, "elements": [] }, "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/output.json index cfdc0f3edd..2864855b50 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-fn/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -65,35 +20,13 @@ "params": [ { "type": "ArrayPattern", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "elements": [] } ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/output.json index f4cd58a853..5ad2528dac 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-lexical/output.json @@ -1,93 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ArrayPattern", - "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}}, "elements": [] }, "init": { "type": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-var/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-var/output.json index 4541489a96..0e6ad4f2d2 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-var/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/empty-pattern-var/output.json @@ -1,93 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "id": { "type": "ArrayPattern", - "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}}, "elements": [] }, "init": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/hole/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/hole/output.json index a8823231e5..d9f6ce38a0 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/hole/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/hole/output.json @@ -1,129 +1,39 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ArrayPattern", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "elements": [ { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, null, { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "b" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"b"}, "name": "b" } ] }, "init": { "type": "NumericLiteral", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/nested-pattern/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/nested-pattern/output.json index 800161b949..fb9d0dae8a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/nested-pattern/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/nested-pattern/output.json @@ -1,110 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "id": { "type": "ArrayPattern", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "elements": [ { "type": "ArrayPattern", - "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}}, "elements": [] } ] }, "init": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/patterned-catch/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/patterned-catch/output.json index 48dd0332f9..88ca34bec2 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/patterned-catch/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/patterned-catch/output.json @@ -1,192 +1,56 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "block": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 7, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":7,"end":49,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":49}}, "param": { "type": "ArrayPattern", - "start": 14, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":14,"end":45,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":45}}, "elements": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "b" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"b"}, "name": "b" }, { "type": "ObjectPattern", - "start": 20, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":20,"end":44,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":44}}, "properties": [ { "type": "ObjectProperty", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}}, "method": false, "key": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "c" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "c" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"c"}, "name": "c" }, "extra": { @@ -195,83 +59,26 @@ }, { "type": "ObjectProperty", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "d" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"d"}, "name": "d" }, "computed": false, "shorthand": false, "value": { "type": "AssignmentPattern", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29}}, "left": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "e" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"e"}, "name": "e" }, "right": { "type": "NumericLiteral", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29}}, "extra": { "rawValue": 0, "raw": "0" @@ -282,83 +89,26 @@ }, { "type": "ObjectProperty", - "start": 31, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":31,"end":38,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":38}}, "method": false, "computed": true, "key": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "f" - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"f"}, "name": "f" }, "shorthand": false, "value": { "type": "AssignmentPattern", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":35,"end":38,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":38}}, "left": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "g" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"g"}, "name": "g" }, "right": { "type": "NumericLiteral", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":37,"end":38,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":38}}, "extra": { "rawValue": 0, "raw": "0" @@ -369,84 +119,26 @@ }, { "type": "ObjectProperty", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":40,"end":43,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":43}}, "method": false, "key": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "h" - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"h"}, "name": "h" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":40,"end":43,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":43}}, "left": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "h" - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"h"}, "name": "h" }, "right": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "i" - }, + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"i"}, "name": "i" } }, @@ -460,18 +152,7 @@ }, "body": { "type": "BlockStatement", - "start": 47, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":47,"end":49,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":49}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/rest/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/rest/output.json index b454e3f7a1..ddaa8680e6 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/rest/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/rest/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "ArrayPattern", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "elements": [ { "type": "RestElement", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "argument": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"a"}, "name": "a" } } @@ -109,18 +31,7 @@ }, "init": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/tailing-hold/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/tailing-hold/output.json index 09cb074e0e..ef60dd713e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/tailing-hold/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/tailing-hold/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, null @@ -95,18 +28,7 @@ }, "init": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/output.json index 3ea9eda80f..044fb5c7b4 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/with-default-catch-param/output.json @@ -1,139 +1,39 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":8,"end":27,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":27}}, "param": { "type": "ArrayPattern", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22}}, "elements": [ { "type": "AssignmentPattern", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "left": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a" }, "right": { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "extra": { "rawValue": 0, "raw": "0" @@ -145,18 +45,7 @@ }, "body": { "type": "BlockStatement", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/with-default-fn/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/with-default-fn/output.json index a507e6b1af..e4ab30e9fc 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/with-default-fn/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/with-default-fn/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -65,64 +20,19 @@ "params": [ { "type": "ArrayPattern", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "elements": [ { "type": "AssignmentPattern", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15}}, "left": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "a" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"a"}, "name": "a" }, "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": 0, "raw": "0" @@ -135,18 +45,7 @@ ], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/output.json index f1dbff4cc8..0f3b7a515f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-array-pattern/with-object-pattern/output.json @@ -1,142 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "ObjectPattern", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "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" }, "extra": { @@ -149,18 +48,7 @@ }, "init": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/output.json index 05e544a731..3254ae4d7a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/arrow-with-multiple-arg-and-rest/output.json @@ -1,147 +1,45 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "b" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"b"}, "name": "b" }, { "type": "RestElement", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "argument": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "c" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"c"}, "name": "c" } } ], "body": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/output.json index 28ed0df0c3..e10f67b1df 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/arrow-with-only-rest/output.json @@ -1,113 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "RestElement", - "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}}, "argument": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" } } ], "body": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/output.json index 34fec64966..dfab13123c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/complex-rest-in-arrow-not-allowed/output.json @@ -1,130 +1,40 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Argument name clash (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "start": 3, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":3,"end":9,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":9}}, "argument": { "type": "ArrayPattern", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9}}, "elements": [ { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" } ] @@ -133,18 +43,7 @@ ], "body": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/output.json index 5456b40fe8..54a0b8dc46 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/invalid-duplicated-params/output.json @@ -1,119 +1,39 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Argument name clash (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "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" }, { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" } ], "body": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "y" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"y"}, "name": "y" } } 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 1daa964b52..3dcc69133b 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 @@ -1,131 +1,42 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BlockStatement", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":22}}, "body": [], "directives": [ { "type": "Directive", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":21}}, "value": { "type": "DirectiveLiteral", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":21}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0000/output.json index c59ac797ad..c14b141b09 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0000/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "StringLiteral", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "extra": { "rawValue": "test", "raw": "\"test\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0001/output.json index 728dfb4051..9618fdfb2c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0001/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "e" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"e"}, "name": "e" } ], "body": { "type": "StringLiteral", - "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}}, "extra": { "rawValue": "test", "raw": "\"test\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0002/output.json index c2375ef25d..0d0d28d7f1 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0002/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "e" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"e"}, "name": "e" } ], "body": { "type": "StringLiteral", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "extra": { "rawValue": "test", "raw": "\"test\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0003/output.json index dda3533215..dfe12266a2 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0003/output.json @@ -1,115 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "b" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"b"}, "name": "b" } ], "body": { "type": "StringLiteral", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}}, "extra": { "rawValue": "test", "raw": "\"test\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0004/output.json index 1c6e09f83b..b16741cd69 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0004/output.json @@ -1,127 +1,38 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "e" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"e"}, "name": "e" } ], "body": { "type": "BlockStatement", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "body": [ { "type": "ExpressionStatement", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "expression": { "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/fixtures/esprima/es2015-arrow-function/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0005/output.json index b38e5d2c1b..d62ccc4896 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0005/output.json @@ -1,147 +1,46 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "e" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"e"}, "name": "e" } ], "body": { "type": "ObjectExpression", - "start": 6, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":6,"end":22,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":8,"end":20,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "property" - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16},"identifierName":"property"}, "name": "property" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0006/output.json index aeaacfb4d4..00e4c4cd68 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0006/output.json @@ -1,141 +1,41 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "e" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"e"}, "name": "e" } ], "body": { "type": "BlockStatement", - "start": 5, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":5,"end":18,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":18}}, "body": [ { "type": "LabeledStatement", - "start": 7, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":7,"end":16,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":16}}, "body": { "type": "ExpressionStatement", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "expression": { "type": "NumericLiteral", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "extra": { "rawValue": 42, "raw": "42" @@ -145,19 +45,7 @@ }, "label": { "type": "Identifier", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "label" - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12},"identifierName":"label"}, "name": "label" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0007/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0007/output.json index 3283c962d6..e9089f70a5 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0007/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0007/output.json @@ -1,144 +1,43 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "b" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"b"}, "name": "b" } ], "body": { "type": "BlockStatement", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "body": [ { "type": "ExpressionStatement", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15}}, "expression": { "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/fixtures/esprima/es2015-arrow-function/migrated_0008/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0008/output.json index e60231ec6c..b2f75a4c1c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0008/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0008/output.json @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "left": { "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" }, "right": { "type": "NumericLiteral", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4}}, "extra": { "rawValue": 1, "raw": "1" @@ -116,51 +38,16 @@ ], "body": { "type": "BinaryExpression", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "left": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "operator": "*", "right": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0009/output.json index 8f40c2b9e5..8f63cdd60d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0009/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0010/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0010/output.json index 13a6a64d03..d33e35056a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0010/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0010/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "NumericLiteral", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0011/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0011/output.json index 6ae12c62e3..72ab3ece36 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0011/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0011/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" } ], "body": { "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": 0, "raw": "00" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0012/output.json index fd7a891d8c..ed7c52c299 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0012/output.json @@ -1,115 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "eval" - }, + "start":1,"end":5,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":5},"identifierName":"eval"}, "name": "eval" }, { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" } ], "body": { "type": "NumericLiteral", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0013/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0013/output.json index a51e793b44..d13b273267 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0013/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0013/output.json @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, "left": { "type": "Identifier", - "start": 1, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "eval" - }, + "start":1,"end":5,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":5},"identifierName":"eval"}, "name": "eval" }, "right": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": 10, "raw": "10" @@ -116,18 +38,7 @@ ], "body": { "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/fixtures/esprima/es2015-arrow-function/migrated_0014/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0014/output.json index 114403aa5e..d3c143b18e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0014/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0014/output.json @@ -1,128 +1,38 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "eval" - }, + "start":1,"end":5,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":5},"identifierName":"eval"}, "name": "eval" }, { "type": "AssignmentPattern", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "left": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, "right": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "extra": { "rawValue": 10, "raw": "10" @@ -133,18 +43,7 @@ ], "body": { "type": "NumericLiteral", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0015/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0015/output.json index cd821a586b..245d1b011a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0015/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0015/output.json @@ -1,99 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0016/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0016/output.json index 9250f449ee..c513497671 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0016/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0016/output.json @@ -1,134 +1,44 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "ArrowFunctionExpression", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0017/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0017/output.json index cdd0d45ece..91ad2d7f7a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0017/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0017/output.json @@ -1,201 +1,63 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":8,"end":27,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":27}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "y" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"y"}, "name": "y" }, { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "z" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"z"}, "name": "z" } ], "body": { "type": "SequenceExpression", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}}, "expressions": [ { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "x" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"x"}, "name": "x" }, { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "y" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"y"}, "name": "y" }, { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "z" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"z"}, "name": "z" } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0018/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0018/output.json index fb2194b635..1d6b874fa0 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0018/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0018/output.json @@ -1,112 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0019/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0019/output.json index c075ce9f91..d8574a83a9 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0019/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0019/output.json @@ -1,147 +1,45 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "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": "ArrowFunctionExpression", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": null, "generator": false, "async": false, "params": [ { "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" }, { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "y" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"y"}, "name": "y" } ], "body": { "type": "BlockStatement", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0020/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0020/output.json index 089ace58b0..796d5e9f1f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0020/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/migrated_0020/output.json @@ -1,99 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "sun" - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"sun"}, "name": "sun" } ], "body": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "earth" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"earth"}, "name": "earth" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-01/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-01/output.json index 04622ffb5e..9e8e266f2d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-01/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-01/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 1, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":1,"end":20,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "extra": { @@ -133,84 +43,26 @@ }, { "type": "ObjectProperty", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "method": false, "key": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "b" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "b" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"b"}, "name": "b" }, "right": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "b" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"b"}, "name": "b" } }, @@ -220,120 +72,39 @@ }, { "type": "ObjectProperty", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "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" } }, { "type": "ObjectProperty", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19}}, "method": false, "computed": true, "key": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a" }, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}}, "elements": [ { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "d" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"d"}, "name": "d" } ] @@ -344,18 +115,7 @@ ], "body": { "type": "NumericLiteral", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-empty/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-empty/output.json index 6a745736a1..3e49f877b6 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-empty/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-empty/output.json @@ -1,97 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": [ { "type": "ObjectPattern", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "properties": [] } ], "body": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json index 9e88587776..2bdcc96c2d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-member-expr/output.json @@ -1,163 +1,51 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding member expression (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":2,"end":8,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":8}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "MemberExpression", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "object": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "b" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"b"}, "name": "b" }, "property": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" @@ -172,18 +60,7 @@ ], "body": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/output.json index d391e09c2d..55af574054 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-method-in-pattern/output.json @@ -1,114 +1,36 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Object pattern can't contain getter or setter (1:6)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 1, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, "properties": [ { "type": "ObjectMethod", - "start": 2, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":2,"end":11,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":11}}, "method": false, "key": { "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" }, "computed": false, @@ -119,18 +41,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } @@ -140,18 +51,7 @@ ], "body": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json index a0f4f6168d..cb2922c87c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-nested-param/output.json @@ -1,463 +1,131 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "errors": [ "SyntaxError: Binding member expression (1:24)" ], "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ArrayPattern", - "start": 1, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":1,"end":49,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":49}}, "elements": [ { "type": "ArrayPattern", - "start": 2, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":2,"end":48,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":48}}, "elements": [ { "type": "ArrayPattern", - "start": 3, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":3,"end":47,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":47}}, "elements": [ { "type": "ArrayPattern", - "start": 4, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":4,"end":46,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":46}}, "elements": [ { "type": "ArrayPattern", - "start": 5, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":5,"end":45,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":45}}, "elements": [ { "type": "ArrayPattern", - "start": 6, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":6,"end":44,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":44}}, "elements": [ { "type": "ArrayPattern", - "start": 7, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":7,"end":43,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":43}}, "elements": [ { "type": "ArrayPattern", - "start": 8, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":8,"end":42,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":42}}, "elements": [ { "type": "ArrayPattern", - "start": 9, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":9,"end":41,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":41}}, "elements": [ { "type": "ArrayPattern", - "start": 10, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":10,"end":40,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":40}}, "elements": [ { "type": "ArrayPattern", - "start": 11, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":11,"end":39,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":39}}, "elements": [ { "type": "ArrayPattern", - "start": 12, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":12,"end":38,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":38}}, "elements": [ { "type": "ArrayPattern", - "start": 13, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":13,"end":37,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":37}}, "elements": [ { "type": "ArrayPattern", - "start": 14, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":14,"end":36,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":36}}, "elements": [ { "type": "ArrayPattern", - "start": 15, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":15,"end":35,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":35}}, "elements": [ { "type": "ArrayPattern", - "start": 16, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":16,"end":34,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":34}}, "elements": [ { "type": "ArrayPattern", - "start": 17, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":17,"end":33,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":33}}, "elements": [ { "type": "ArrayPattern", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "elements": [ { "type": "ArrayPattern", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "elements": [ { "type": "ArrayPattern", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "elements": [ { "type": "ObjectPattern", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "properties": [ { "type": "ObjectProperty", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":22,"end":28,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":28}}, "method": false, "key": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "a" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "MemberExpression", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":24,"end":28,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":28}}, "object": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "b" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"b"}, "name": "b" }, "property": { "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": 0, "raw": "0" @@ -512,18 +180,7 @@ ], "body": { "type": "NumericLiteral", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":52,"end":53,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":53}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-rest-in-object-pattern/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-rest-in-object-pattern/output.json index 7061f23c0f..eae114c7ae 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-rest-in-object-pattern/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-invalid-rest-in-object-pattern/output.json @@ -1,130 +1,40 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "extra": { @@ -133,33 +43,10 @@ }, { "type": "RestElement", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "argument": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "b" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" } } @@ -168,18 +55,7 @@ ], "body": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-nested-cover-grammar/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-nested-cover-grammar/output.json index 81e10cda57..f61835740a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-nested-cover-grammar/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-arrow-function/object-binding-pattern-nested-cover-grammar/output.json @@ -1,461 +1,128 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ArrayPattern", - "start": 1, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":1,"end":46,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":46}}, "elements": [ { "type": "ArrayPattern", - "start": 2, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":2,"end":45,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":45}}, "elements": [ { "type": "ArrayPattern", - "start": 3, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":3,"end":44,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":44}}, "elements": [ { "type": "ArrayPattern", - "start": 4, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":4,"end":43,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":43}}, "elements": [ { "type": "ArrayPattern", - "start": 5, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":5,"end":42,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":42}}, "elements": [ { "type": "ArrayPattern", - "start": 6, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":6,"end":41,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":41}}, "elements": [ { "type": "ArrayPattern", - "start": 7, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":7,"end":40,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":40}}, "elements": [ { "type": "ArrayPattern", - "start": 8, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":8,"end":39,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":39}}, "elements": [ { "type": "ArrayPattern", - "start": 9, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":9,"end":38,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":38}}, "elements": [ { "type": "ArrayPattern", - "start": 10, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":10,"end":37,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":37}}, "elements": [ { "type": "ArrayPattern", - "start": 11, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":11,"end":36,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":36}}, "elements": [ { "type": "ArrayPattern", - "start": 12, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":12,"end":35,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":35}}, "elements": [ { "type": "ArrayPattern", - "start": 13, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":13,"end":34,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":34}}, "elements": [ { "type": "ArrayPattern", - "start": 14, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":14,"end":33,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":33}}, "elements": [ { "type": "ArrayPattern", - "start": 15, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":15,"end":32,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":32}}, "elements": [ { "type": "ArrayPattern", - "start": 16, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":16,"end":31,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":31}}, "elements": [ { "type": "ArrayPattern", - "start": 17, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":17,"end":30,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":30}}, "elements": [ { "type": "ArrayPattern", - "start": 18, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":18,"end":29,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":29}}, "elements": [ { "type": "ArrayPattern", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":19,"end":28,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":28}}, "elements": [ { "type": "ArrayPattern", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27}}, "elements": [ { "type": "ObjectPattern", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26}}, "properties": [ { "type": "ObjectProperty", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "method": false, "key": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "a" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "left": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "a" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"a"}, "name": "a" }, "right": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "b" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"b"}, "name": "b" } }, @@ -508,18 +175,7 @@ ], "body": { "type": "NumericLiteral", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":49,"end":50,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":50}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0000/output.json index c252371102..3190f75a5f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0000/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0b0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0001/output.json index 4cf5cc60df..ce6d2c2cf9 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0001/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 1, "raw": "0b1" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0002/output.json index 9a7364a78a..2b17ce385b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0002/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 2, "raw": "0b10" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0003/output.json index 33bb1b2a0a..c0f3390f5c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0003/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0B0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0004/output.json index 39761f3e94..cba05164a5 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0004/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 1, "raw": "0B1" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0005/output.json index ea337678ef..db98ac55e2 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-binary-integer-literal/migrated_0005/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 2, "raw": "0B10" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0000/output.json index e0a1cd35bf..60e9af2048 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0000/output.json @@ -1,80 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0001/output.json index e9f7e48176..6b4cbe003a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0001/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -82,18 +26,7 @@ }, "body": { "type": "ClassBody", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0002/output.json index affcbae430..7620949ebb 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0002/output.json @@ -1,80 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0003/output.json index c9662fc16e..a0317edfc8 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0003/output.json @@ -1,80 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0004/output.json index f8723468bd..2bfde2ea57 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0004/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "static": false, "key": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0005/output.json index d1b7ccb7f8..4af9a18128 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0005/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":8,"end":20,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":20}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "static": false, "key": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "b" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"b"}, "name": "b" }, "computed": false, @@ -172,18 +59,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0006/output.json index 05b83780eb..0d6a432ca7 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0006/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":8,"end":21,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":21}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "static": false, "key": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "static": false, "key": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "b" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"b"}, "name": "b" }, "computed": false, @@ -172,18 +59,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0007/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0007/output.json index ad258e9505..c8e915a8b0 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0007/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0007/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":22}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "static": false, "key": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "static": false, "key": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "b" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"b"}, "name": "b" }, "computed": false, @@ -172,18 +59,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0008/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0008/output.json index cfe130ffbf..333db551c2 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0008/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0008/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":8,"end":23,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":23}}, "body": [ { "type": "ClassMethod", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "static": false, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "static": false, "key": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "b" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"b"}, "name": "b" }, "computed": false, @@ -172,18 +59,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0009/output.json index 883a08030f..174b9e59a0 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0009/output.json @@ -1,112 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":8,"end":21,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":21}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19}}, "kind": "method", "computed": false, "key": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "static" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"static"}, "name": "static" }, "static": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0010/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0010/output.json index 29a9d118b4..d45546f7fa 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0010/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0010/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":8,"end":31,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":31}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "static": false, "key": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 19, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":19,"end":29,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":29}}, "static": false, "key": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "b" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"b"}, "name": "b" }, "computed": false, @@ -172,36 +59,13 @@ "params": [ { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "c" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"c"}, "name": "c" } ], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0011/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0011/output.json index 9e63dfdcd6..5f649b7d17 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0011/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0011/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":8,"end":58,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":58}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":21}}, "static": true, "key": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 22, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":22,"end":38,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":38}}, "static": true, "key": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "a" - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -172,52 +59,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 39, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":39,"end":56,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":56}}, "static": true, "key": { "type": "Identifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "a" - }, + "start":50,"end":51,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":51},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -228,36 +81,13 @@ "params": [ { "type": "Identifier", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 53 - }, - "identifierName": "b" - }, + "start":52,"end":53,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":53},"identifierName":"b"}, "name": "b" } ], "body": { "type": "BlockStatement", - "start": 54, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":54,"end":56,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":56}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0012/output.json index 7f90fed606..986bcdfa2b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0012/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":8,"end":23,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":23}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":21}}, "static": true, "key": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0013/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0013/output.json index 0d381454d5..32100b8de3 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0013/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0013/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":8,"end":25,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":25}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "static": true, "computed": true, "key": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "a" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"a"}, "name": "a" }, "kind": "method", @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0014/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0014/output.json index 99de476125..ac3916d370 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0014/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0014/output.json @@ -1,112 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":8,"end":38,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":38}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "static": true, "computed": true, "key": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a" }, "kind": "method", @@ -116,53 +37,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 24, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":24,"end":37,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":37}}, "static": true, "computed": true, "key": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "b" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"b"}, "name": "b" }, "kind": "method", @@ -172,18 +59,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":35,"end":37,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":37}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0015/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0015/output.json index 44b77f49f1..5914e8c363 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0015/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0015/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":8,"end":28,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":28}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":9,"end":26,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":26}}, "static": true, "key": { "type": "Identifier", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "static" - }, + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22},"identifierName":"static"}, "name": "static" }, "computed": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0016/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0016/output.json index ef8d19db22..3accea1303 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0016/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0016/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "ClassExpression", - "start": 8, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":8,"end":27,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "superClass": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}}, "extra": { "rawValue": 0, "raw": "0" @@ -128,18 +38,7 @@ }, "body": { "type": "ClassBody", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0017/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0017/output.json index b873f53f35..7f4c674fde 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0017/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0017/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":8,"end":23,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":23}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "static": false, "key": { "type": "Identifier", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "prototype" - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18},"identifierName":"prototype"}, "name": "prototype" }, "computed": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0018/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0018/output.json index 3d629ecba3..2f5ad3c907 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0018/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0018/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":8,"end":25,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":25}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}}, "static": false, "key": { "type": "Identifier", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "constructor" - }, + "start":9,"end":20,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":20},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0019/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0019/output.json index 2f04a27ec7..450831a85d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0019/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0019/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":8,"end":47,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":47}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":9,"end":26,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":26}}, "static": false, "key": { "type": "StringLiteral", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "extra": { "rawValue": "constructor", "raw": "\"constructor\"" @@ -119,52 +41,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "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}}, "static": false, "computed": true, "key": { "type": "StringLiteral", - "start": 28, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":28,"end":41,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":41}}, "extra": { "rawValue": "constructor", "raw": "\"constructor\"" @@ -178,18 +67,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":44,"end":46,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":46}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0020/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0020/output.json index d9e0aedd6a..14b2ac281f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0020/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0020/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":8,"end":55,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":55}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, "static": true, "key": { "type": "Identifier", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "constructor" - }, + "start":16,"end":27,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":27},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -116,52 +37,18 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 32, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":32,"end":54,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":54}}, "static": true, "key": { "type": "Identifier", - "start": 39, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 50 - }, - "identifierName": "constructor" - }, + "start":39,"end":50,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":50},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -172,18 +59,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 52, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":52,"end":54,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":54}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0021/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0021/output.json index 6467ddd1af..88d0ad2a09 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0021/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0021/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":8,"end":34,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":34}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33}}, "static": true, "computed": true, "key": { "type": "StringLiteral", - "start": 17, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":17,"end":28,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":28}}, "extra": { "rawValue": "prototype", "raw": "\"prototype\"" @@ -119,18 +41,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0022/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0022/output.json index 6eda12df85..3e4845f7a6 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0022/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0022/output.json @@ -1,78 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ClassExpression", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "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}}, "body": [] }, "extra": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0023/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0023/output.json index 6d0f936901..583264386a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0023/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0023/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ClassExpression", - "start": 1, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, "id": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "A" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "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}}, "body": [] }, "extra": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0024/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0024/output.json index 954a44205f..1ac9ff2484 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0024/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0024/output.json @@ -1,77 +1,22 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "ClassExpression", - "start": 1, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":1,"end":18,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":18}}, "id": null, "superClass": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 0, "raw": "0" @@ -80,18 +25,7 @@ }, "body": { "type": "ClassBody", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [] }, "extra": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0025/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0025/output.json index 3a18f87634..7ce7952ccb 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0025/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-class/migrated_0025/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ClassExpression", - "start": 1, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":1,"end":20,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "A" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"A"}, "name": "A" }, "superClass": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 0, "raw": "0" @@ -96,18 +29,7 @@ }, "body": { "type": "ClassBody", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [] }, "extra": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/output.json index 14f737f82b..9f560c227f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-default-parameter-value/migrated_0000/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "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": "FunctionExpression", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18}}, "left": { "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" }, "right": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 1, "raw": "1" @@ -148,18 +47,7 @@ ], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/output.json index bd6597aab1..4e22aa2182 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-default-parameter-value/migrated_0001/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,49 +20,15 @@ "params": [ { "type": "AssignmentPattern", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "left": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a" }, "right": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 1, "raw": "1" @@ -118,18 +39,7 @@ ], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/output.json index 9f5973150f..ecbb4f3faf 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-default-parameter-value/migrated_0002/output.json @@ -1,192 +1,57 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "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": "ObjectExpression", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":6,"end":25,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":25}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "f" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"f"}, "name": "f" }, "computed": false, "shorthand": false, "value": { "type": "FunctionExpression", - "start": 9, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":9,"end":25,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":25}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "left": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "a" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"a"}, "name": "a" }, "right": { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "extra": { "rawValue": 1, "raw": "1" @@ -197,18 +62,7 @@ ], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/output.json index 957dd5070e..dba74d3f06 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/dup-assignment/output.json @@ -1,142 +1,40 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "a" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, "name": "a" }, null, { "type": "RestElement", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10}}, "argument": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" } } @@ -144,18 +42,7 @@ }, "right": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/output.json index 6032e42c2b..3ad3009e10 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/elision/output.json @@ -1,99 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrayPattern", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, + "extra": { + "trailingComma": 2 }, "elements": [ null, null - ], - "extra": { - "trailingComma": 2 - } + ] }, "right": { "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" 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 512019e9c7..c22df6a3de 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 @@ -1,137 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "RestElement", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "argument": { "type": "MemberExpression", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "object": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "property": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" @@ -145,18 +45,7 @@ }, "right": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 0, "raw": "0" 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 b80f1cb77f..6a8e67cf93 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 @@ -1,140 +1,39 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "operator": "=", "left": { "type": "ArrayPattern", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "elements": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "AssignmentPattern", - "start": 3, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":3,"end":6,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":6}}, "left": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "b" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"b"}, "name": "b" }, "right": { "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" @@ -144,109 +43,30 @@ }, { "type": "AssignmentPattern", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "left": { "type": "ArrayPattern", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "elements": [ { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "c" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"c"}, "name": "c" }, { "type": "RestElement", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "argument": { "type": "MemberExpression", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17}}, "object": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a" }, "property": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 0, "raw": "0" @@ -260,18 +80,7 @@ }, "right": { "type": "ObjectExpression", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "properties": [] } } @@ -279,18 +88,7 @@ }, "right": { "type": "NumericLiteral", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/output.json index cbf81a2877..287266bfe5 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/nested-cover-grammar/output.json @@ -1,173 +1,49 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "AssignmentExpression", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, "left": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "b" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"b"}, "name": "b" } }, @@ -179,18 +55,7 @@ }, "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/output.json index 18babe6d83..952d1864c5 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-array-pattern/simple-assignment/output.json @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrayPattern", - "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}}, "elements": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" } ] }, "right": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/output.json index 78326d2bf3..0d18228ad5 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-destructuring-assignment-object-pattern/empty-object-pattern-assignment/output.json @@ -1,93 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "properties": [] }, "right": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" 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 b71ec1a701..41ad542d8b 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 @@ -1,147 +1,47 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in object destructuring pattern (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":2,"end":8,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":8}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ThisExpression", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - } + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}} } } ] }, "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": 0, "raw": "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 0282d2b2a5..7c1957004b 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 @@ -1,147 +1,47 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in object destructuring pattern (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":1,"end":14,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":14}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ThisExpression", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - } + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}} } } ] }, "right": { "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": 0, "raw": "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 4f63aa8f3c..9ad5276de4 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 @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Object pattern can't contain methods (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "properties": [ { "type": "ObjectMethod", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "method": true, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -116,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } @@ -136,18 +47,7 @@ }, "right": { "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": 0, "raw": "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 cbc63e56e1..a57907e16d 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 @@ -1,488 +1,133 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "operator": "=", "left": { "type": "ArrayPattern", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "elements": [ { "type": "ArrayPattern", - "start": 1, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":1,"end":47,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":47}}, "elements": [ { "type": "ArrayPattern", - "start": 2, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":2,"end":46,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":46}}, "elements": [ { "type": "ArrayPattern", - "start": 3, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":3,"end":45,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":45}}, "elements": [ { "type": "ArrayPattern", - "start": 4, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":4,"end":44,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":44}}, "elements": [ { "type": "ArrayPattern", - "start": 5, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":5,"end":43,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":43}}, "elements": [ { "type": "ArrayPattern", - "start": 6, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":6,"end":42,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":42}}, "elements": [ { "type": "ArrayPattern", - "start": 7, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":7,"end":41,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":41}}, "elements": [ { "type": "ArrayPattern", - "start": 8, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":8,"end":40,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":40}}, "elements": [ { "type": "ArrayPattern", - "start": 9, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":9,"end":39,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":39}}, "elements": [ { "type": "ArrayPattern", - "start": 10, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":10,"end":38,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":38}}, "elements": [ { "type": "ArrayPattern", - "start": 11, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":11,"end":37,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":37}}, "elements": [ { "type": "ArrayPattern", - "start": 12, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":12,"end":36,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":36}}, "elements": [ { "type": "ArrayPattern", - "start": 13, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":13,"end":35,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":35}}, "elements": [ { "type": "ArrayPattern", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":14,"end":34,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":34}}, "elements": [ { "type": "ArrayPattern", - "start": 15, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":15,"end":33,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":33}}, "elements": [ { "type": "ArrayPattern", - "start": 16, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":16,"end":32,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":32}}, "elements": [ { "type": "ArrayPattern", - "start": 17, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":17,"end":31,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":31}}, "elements": [ { "type": "ArrayPattern", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "elements": [ { "type": "ArrayPattern", - "start": 19, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":19,"end":29,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":29}}, "elements": [ { "type": "ObjectPattern", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "properties": [ { "type": "ObjectProperty", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}}, "method": false, "key": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "a" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}}, "left": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "a" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"a"}, "name": "a" }, "right": { "type": "MemberExpression", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27}}, "object": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "b" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"b"}, "name": "b" }, "property": { "type": "NumericLiteral", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}}, "extra": { "rawValue": 0, "raw": "0" @@ -540,18 +185,7 @@ }, "right": { "type": "NumericLiteral", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":49,"end":50,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":50}}, "extra": { "rawValue": 0, "raw": "0" 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 60b6c5f4b4..bc2ea21636 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 @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 7 - } - }, + "start":0,"end":85,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":7}}, "program": { "type": "Program", - "start": 0, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 7 - } - }, + "start":0,"end":85,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":7}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 7 - } - }, + "start":0,"end":85,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":7}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 8, - "column": 5 - } - }, + "start":1,"end":83,"loc":{"start":{"line":1,"column":1},"end":{"line":8,"column":5}}, "operator": "=", "left": { "type": "ObjectPattern", - "start": 1, - "end": 79, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":1,"end":79,"loc":{"start":{"line":1,"column":1},"end":{"line":8,"column":1}}, "properties": [ { "type": "ObjectProperty", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":7,"end":8,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"}, "name": "a" }, "extra": { @@ -130,238 +40,76 @@ }, { "type": "ObjectProperty", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":14,"end":17,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7}}, "method": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "a" - }, + "start":14,"end":15,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "a" - }, + "start":16,"end":17,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7},"identifierName":"a"}, "name": "a" } }, { "type": "ObjectProperty", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":23,"end":28,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":9}}, "method": false, "key": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "a" - }, + "start":23,"end":24,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":5},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "AssignmentPattern", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":25,"end":28,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":9}}, "left": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "a" - }, + "start":25,"end":26,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":7},"identifierName":"a"}, "name": "a" }, "right": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 9 - }, - "identifierName": "a" - }, + "start":27,"end":28,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":9},"identifierName":"a"}, "name": "a" } } }, { "type": "ObjectProperty", - "start": 34, - "end": 41, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":34,"end":41,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":11}}, "method": false, "computed": true, "key": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 6 - }, - "identifierName": "a" - }, + "start":35,"end":36,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":6},"identifierName":"a"}, "name": "a" }, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 38, - "end": 41, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":38,"end":41,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":11}}, "properties": [ { "type": "ObjectProperty", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":39,"end":40,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":10}}, "method": false, "key": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 10 - }, - "identifierName": "a" - }, + "start":39,"end":40,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":10},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 10 - }, - "identifierName": "a" - }, + "start":39,"end":40,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":10},"identifierName":"a"}, "name": "a" }, "extra": { @@ -373,100 +121,31 @@ }, { "type": "ObjectProperty", - "start": 47, - "end": 63, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 20 - } - }, + "start":47,"end":63,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 5 - }, - "identifierName": "a" - }, + "start":47,"end":48,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":5},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "MemberExpression", - "start": 49, - "end": 63, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 20 - } - }, + "start":49,"end":63,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":20}}, "object": { "type": "CallExpression", - "start": 49, - "end": 60, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":49,"end":60,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":17}}, "callee": { "type": "Identifier", - "start": 49, - "end": 58, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 15 - }, - "identifierName": "some_call" - }, + "start":49,"end":58,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":15},"identifierName":"some_call"}, "name": "some_call" }, "arguments": [] }, "property": { "type": "Identifier", - "start": 61, - "end": 62, - "loc": { - "start": { - "line": 6, - "column": 18 - }, - "end": { - "line": 6, - "column": 19 - }, - "identifierName": "a" - }, + "start":61,"end":62,"loc":{"start":{"line":6,"column":18},"end":{"line":6,"column":19},"identifierName":"a"}, "name": "a" }, "computed": true @@ -474,82 +153,25 @@ }, { "type": "ObjectProperty", - "start": 69, - "end": 77, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":69,"end":77,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 69, - "end": 70, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 5 - }, - "identifierName": "a" - }, + "start":69,"end":70,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":5},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "MemberExpression", - "start": 71, - "end": 77, - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":71,"end":77,"loc":{"start":{"line":7,"column":6},"end":{"line":7,"column":12}}, "object": { "type": "ThisExpression", - "start": 71, - "end": 75, - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 10 - } - } + "start":71,"end":75,"loc":{"start":{"line":7,"column":6},"end":{"line":7,"column":10}} }, "property": { "type": "Identifier", - "start": 76, - "end": 77, - "loc": { - "start": { - "line": 7, - "column": 11 - }, - "end": { - "line": 7, - "column": 12 - }, - "identifierName": "a" - }, + "start":76,"end":77,"loc":{"start":{"line":7,"column":11},"end":{"line":7,"column":12},"identifierName":"a"}, "name": "a" }, "computed": false @@ -559,18 +181,7 @@ }, "right": { "type": "NumericLiteral", - "start": 82, - "end": 83, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 5 - } - }, + "start":82,"end":83,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":5}}, "extra": { "rawValue": 0, "raw": "0" 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 02c9109988..7f8cd55c22 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 @@ -1,114 +1,35 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:1)", "SyntaxError: Invalid left-hand side in assignment expression (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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": "=", "left": { "type": "SequenceExpression", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "expressions": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "b" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"b"}, "name": "b" } ], @@ -119,51 +40,16 @@ }, "right": { "type": "SequenceExpression", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "expressions": [ { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "c" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"c"}, "name": "c" }, { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "d" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"d"}, "name": "d" } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-const-number/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-const-number/output.json index 99ed085c71..718eae62c7 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-const-number/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-const-number/output.json @@ -1,110 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-array/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-array/output.json index ebdcfd3b6c..cbc61f434e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-array/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-array/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "declaration": { "type": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-class/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-class/output.json index a6431fd6f6..502e479af6 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-class/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-class/output.json @@ -1,78 +1,23 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "declaration": { "type": "ClassDeclaration", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-expression/output.json index 5a4e8daa8b..5cc2cc85e6 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-expression/output.json @@ -1,76 +1,21 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "declaration": { "type": "BinaryExpression", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "left": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 1, "raw": "1" @@ -80,18 +25,7 @@ "operator": "+", "right": { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-function/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-function/output.json index 52f9f4e1dc..1689c32a0d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-function/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-function/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "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}}, "declaration": { "type": "FunctionDeclaration", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":15,"end":29,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":29}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-named-function/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-named-function/output.json index 66eb1ea4c6..3409ea6ea2 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-named-function/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-named-function/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "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}}, "declaration": { "type": "FunctionDeclaration", - "start": 15, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":15,"end":32,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":32}}, "id": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "foo" - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -79,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":30,"end":32,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":32}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-number/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-number/output.json index 7f633802f8..bc86254ee3 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-number/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-number/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "declaration": { "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/fixtures/esprima/es2015-export-declaration/export-default-object/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-object/output.json index 5161d7a26e..7957d21d96 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-object/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-object/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "declaration": { "type": "ObjectExpression", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":15,"end":25,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":25}}, "properties": [ { "type": "ObjectProperty", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}}, "method": false, "key": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-value/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-value/output.json index 3793b07201..cb66622883 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-value/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-default-value/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "declaration": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-batch/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-batch/output.json index 2ab38b87e8..c45fef74fd 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-batch/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-batch/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportAllDeclaration", - "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}}, "source": { "type": "StringLiteral", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-default/output.json index 7d6db627a4..c6a98d9941 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-default/output.json @@ -1,120 +1,41 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, - "declaration": null, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15}}, "local": { "type": "Identifier", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "default" - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15},"identifierName":"default"}, "name": "default" }, "exported": { "type": "Identifier", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "default" - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15},"identifierName":"default"}, "name": "default" } } ], "source": { "type": "StringLiteral", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" }, "value": "foo" - } + }, + "declaration": null } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/output.json index fef0983ec6..c99efd2f17 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-default/output.json @@ -1,120 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 35 - } - }, - "declaration": null, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":35}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":22}}, "local": { "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" }, "exported": { "type": "Identifier", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "default" - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22},"identifierName":"default"}, "name": "default" } } ], "source": { "type": "StringLiteral", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":29,"end":34,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":34}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" }, "value": "foo" - } + }, + "declaration": null } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/output.json index 16bafeb6e9..471a4c152d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifier/output.json @@ -1,120 +1,41 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "declaration": null, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":8,"end":18,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":18}}, "local": { "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" }, "exported": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "bar" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"bar"}, "name": "bar" } } ], "source": { "type": "StringLiteral", - "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}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" }, "value": "foo" - } + }, + "declaration": null } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/output.json index 6e865059d6..fd31ae512c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-named-as-specifiers/output.json @@ -1,169 +1,55 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, - "declaration": null, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":22}}, "local": { "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" }, "exported": { "type": "Identifier", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "default" - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22},"identifierName":"default"}, "name": "default" } }, { "type": "ExportSpecifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27}}, "local": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "bar" - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27},"identifierName":"bar"}, "name": "bar" }, "exported": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "bar" - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27},"identifierName":"bar"}, "name": "bar" } } ], "source": { "type": "StringLiteral", - "start": 34, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":34,"end":39,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":39}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" }, "value": "foo" - } + }, + "declaration": null } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-specifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-specifier/output.json index 6a4e6615ad..eb3aad5725 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-specifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-specifier/output.json @@ -1,120 +1,41 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, - "declaration": null, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "local": { "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" }, "exported": { "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" } } ], "source": { "type": "StringLiteral", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" }, "value": "foo" - } + }, + "declaration": null } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/output.json index 4f1af1fb8a..0036679388 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-from-specifiers/output.json @@ -1,169 +1,55 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 29 - } - }, - "declaration": null, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":29}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "local": { "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" }, "exported": { "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" } }, { "type": "ExportSpecifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16}}, "local": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "bar" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"bar"}, "name": "bar" }, "exported": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "bar" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"bar"}, "name": "bar" } } ], "source": { "type": "StringLiteral", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" }, "value": "foo" - } + }, + "declaration": null } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-function-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-function-declaration/output.json index 17164deb23..c119a1a11b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-function-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-function-declaration/output.json @@ -1,79 +1,23 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "foo" - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -81,18 +25,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } @@ -100,32 +33,10 @@ }, { "type": "ExpressionStatement", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}}, "expression": { "type": "BooleanLiteral", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}}, "value": false } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-function/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-function/output.json index 7ff223f9b3..987044663f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-function/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-function/output.json @@ -1,79 +1,23 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "foo" - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -81,18 +25,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-let-number/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-let-number/output.json index d6ca5e1061..53d9b742e1 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-let-number/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-let-number/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-as-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-as-default/output.json index ab9dd47bd5..c9ca89ea27 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-as-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-as-default/output.json @@ -1,95 +1,27 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":22}}, "local": { "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" }, "exported": { "type": "Identifier", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "default" - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22},"identifierName":"default"}, "name": "default" } } @@ -99,48 +31,14 @@ }, { "type": "VariableDeclaration", - "start": 25, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":25,"end":33,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}}, "declarations": [ { "type": "VariableDeclarator", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":29,"end":32,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}}, "id": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "foo" - }, + "start":29,"end":32,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"foo"}, "name": "foo" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/output.json index 0b8670ce2e..410a834f42 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifier/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "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" }, "init": null }, { "type": "VariableDeclarator", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "bar" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"bar"}, "name": "bar" }, "init": null @@ -115,65 +36,19 @@ }, { "type": "ExportNamedDeclaration", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":14,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":20}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 22, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":22,"end":32,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":18}}, "local": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11},"identifierName":"foo"}, "name": "foo" }, "exported": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "bar" - }, + "start":29,"end":32,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/output.json index 2a876f042e..25f7c6ea30 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-as-specifiers/output.json @@ -1,144 +1,41 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":22}}, "local": { "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" }, "exported": { "type": "Identifier", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "default" - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22},"identifierName":"default"}, "name": "default" } }, { "type": "ExportSpecifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27}}, "local": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "bar" - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27},"identifierName":"bar"}, "name": "bar" }, "exported": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "bar" - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27},"identifierName":"bar"}, "name": "bar" } } @@ -148,81 +45,24 @@ }, { "type": "VariableDeclaration", - "start": 30, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":30,"end":43,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "declarations": [ { "type": "VariableDeclarator", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":34,"end":37,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}}, "id": { "type": "Identifier", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "foo" - }, + "start":34,"end":37,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"foo"}, "name": "foo" }, "init": null }, { "type": "VariableDeclarator", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":39,"end":42,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12}}, "id": { "type": "Identifier", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "bar" - }, + "start":39,"end":42,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"bar"}, "name": "bar" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-empty/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-empty/output.json index 192d9b03ac..87c7c45448 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-empty/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-empty/output.json @@ -1,51 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "declaration": null, + "start":0,"end":10,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":10}}, "specifiers": [], - "source": null + "source": null, + "declaration": null } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-specifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-specifier/output.json index 4faa60a28f..52c7e7e5ec 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-specifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-specifier/output.json @@ -1,78 +1,22 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "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" }, "init": null @@ -82,65 +26,19 @@ }, { "type": "ExportNamedDeclaration", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":9,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11}}, "local": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11},"identifierName":"foo"}, "name": "foo" }, "exported": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11},"identifierName":"foo"}, "name": "foo" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/output.json index 3616570c15..1fba409df4 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers-comma/output.json @@ -1,78 +1,22 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":8}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "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" }, "init": null @@ -82,114 +26,33 @@ }, { "type": "ExportNamedDeclaration", - "start": 9, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":9,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11}}, "local": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11},"identifierName":"foo"}, "name": "foo" }, "exported": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11},"identifierName":"foo"}, "name": "foo" } }, { "type": "ExportSpecifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16}}, "local": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "bar" - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16},"identifierName":"bar"}, "name": "bar" }, "exported": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "bar" - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16},"identifierName":"bar"}, "name": "bar" } } @@ -199,48 +62,14 @@ }, { "type": "VariableDeclaration", - "start": 29, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":29,"end":37,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":8}}, "declarations": [ { "type": "VariableDeclarator", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":33,"end":36,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7}}, "id": { "type": "Identifier", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "foo" - }, + "start":33,"end":36,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"foo"}, "name": "foo" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/output.json index 51d2d56a1f..e5ffeb5b04 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-named-specifiers/output.json @@ -1,78 +1,22 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":8}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "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" }, "init": null @@ -82,114 +26,33 @@ }, { "type": "ExportNamedDeclaration", - "start": 9, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":9,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11}}, "local": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11},"identifierName":"foo"}, "name": "foo" }, "exported": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11},"identifierName":"foo"}, "name": "foo" } }, { "type": "ExportSpecifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16}}, "local": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "bar" - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16},"identifierName":"bar"}, "name": "bar" }, "exported": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "bar" - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16},"identifierName":"bar"}, "name": "bar" } } @@ -199,48 +62,14 @@ }, { "type": "VariableDeclaration", - "start": 28, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":28,"end":36,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":8}}, "declarations": [ { "type": "VariableDeclarator", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":32,"end":35,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7}}, "id": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "bar" - }, + "start":32,"end":35,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"bar"}, "name": "bar" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/output.json index 23fac0d03d..252bc32b2e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-var-anonymous-function/output.json @@ -1,128 +1,39 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":7,"end":32,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":32}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":11,"end":31,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "FunctionExpression", - "start": 17, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":17,"end":31,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":31}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-var-number/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-var-number/output.json index cb95fa84a1..d59a3ac4cc 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-var-number/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-var-number/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-var/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-var/output.json index ae44c64129..bb61a86de4 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-var/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/export-var/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "id": { "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" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json index 0b3a95c256..8d53b1d889 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-export-declaration/invalid-export-named-default/output.json @@ -1,99 +1,31 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'default' (1:8)", "SyntaxError: Export 'default' is not defined (1:8)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15}}, "local": { "type": "Identifier", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "default" - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15},"identifierName":"default"}, "name": "default" }, "exported": { "type": "Identifier", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "default" - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15},"identifierName":"default"}, "name": "default" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/output.json index c05eb9cca9..197b3818fc 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-array-pattern-let/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "await": false, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":5,"end":15,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":15}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "id": { "type": "ArrayPattern", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "elements": [ { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "p" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"p"}, "name": "p" }, { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "q" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"q"}, "name": "q" } ] @@ -131,35 +41,12 @@ }, "right": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "r" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"r"}, "name": "r" }, "body": { "type": "EmptyStatement", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/output.json index 4f401a2e09..ff6db0c808 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-array-pattern/output.json @@ -1,131 +1,40 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "await": false, "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "p" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"p"}, "name": "p" }, { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "q" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"q"}, "name": "q" } ] }, "right": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "r" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"r"}, "name": "r" }, "body": { "type": "EmptyStatement", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/output.json index 8d59901e29..c38f51d39c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-object-pattern-const/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "await": false, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":5,"end":17,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":17}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "id": { "type": "ObjectPattern", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "properties": [ { "type": "ObjectProperty", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "method": false, "key": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" }, "extra": { @@ -145,53 +44,18 @@ }, { "type": "ObjectProperty", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "y" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "y" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"y"}, "name": "y" }, "extra": { @@ -207,35 +71,12 @@ }, "right": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "z" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"z"}, "name": "z" }, "body": { "type": "EmptyStatement", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/output.json index 8bdd5bd10e..663ab85c8f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-object-pattern/output.json @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "await": false, "left": { "type": "ObjectPattern", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "extra": { @@ -116,53 +37,18 @@ }, { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "y" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "y" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"y"}, "name": "y" }, "extra": { @@ -173,35 +59,12 @@ }, "right": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "z" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"z"}, "name": "z" }, "body": { "type": "EmptyStatement", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-with-const/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-with-const/output.json index 6e16548c21..62a4545231 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-with-const/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-with-const/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "await": false, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "y" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"y"}, "name": "y" }, "init": null @@ -97,35 +30,12 @@ }, "right": { "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "list" - }, + "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"list"}, "name": "list" }, "body": { "type": "EmptyStatement", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-with-let/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-with-let/output.json index 9d64e35ce8..a8974a6dfd 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-with-let/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-with-let/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "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}}, "await": false, "left": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "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" }, "init": null @@ -97,35 +30,12 @@ }, "right": { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "list" - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"list"}, "name": "list" }, "body": { "type": "EmptyStatement", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-with-var/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-with-var/output.json index c8b1fbfd96..b338da14db 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-with-var/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of-with-var/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "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}}, "await": false, "left": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "init": null @@ -97,35 +30,12 @@ }, "right": { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "list" - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"list"}, "name": "list" }, "body": { "type": "EmptyStatement", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of/output.json index 11ce457a83..ea41120a3e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/for-of/output.json @@ -1,97 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "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}}, "await": false, "left": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "p" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"p"}, "name": "p" }, "right": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "q" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"q"}, "name": "q" }, "body": { "type": "EmptyStatement", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/output.json index 9addc13c95..6ddebf2093 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-const-init/output.json @@ -1,112 +1,34 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ "SyntaxError: for-of loop variable declaration may not have an initializer (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "await": false, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 1, "raw": "1" @@ -119,35 +41,12 @@ }, "right": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "y" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"y"}, "name": "y" }, "body": { "type": "EmptyStatement", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/output.json index e7720b3497..a98d3e9a56 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-let-init/output.json @@ -1,112 +1,34 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: for-of loop variable declaration may not have an initializer (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "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}}, "await": false, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":5,"end":14,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "init": { "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": 1, "raw": "1" @@ -119,35 +41,12 @@ }, "right": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "y" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"y"}, "name": "y" }, "body": { "type": "EmptyStatement", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/output.json index bdb80af26d..e48c18d4d1 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-lhs-init/output.json @@ -1,98 +1,31 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Invalid left-hand side in for-of statement (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "await": false, "left": { "type": "ThisExpression", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - } + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}} }, "right": { "type": "Identifier", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "that" - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17},"identifierName":"that"}, "name": "that" }, "body": { "type": "EmptyStatement", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/output.json index 5c95e7b341..9c90d03acc 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/invalid-var-init/output.json @@ -1,112 +1,34 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: for-of loop variable declaration may not have an initializer (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "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}}, "await": false, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":5,"end":14,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "init": { "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": 1, "raw": "1" @@ -119,35 +41,12 @@ }, "right": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "y" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"y"}, "name": "y" }, "body": { "type": "EmptyStatement", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/let-of-of/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/let-of-of/output.json index da544e66fa..176eeaabd3 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-for-of/let-of-of/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-for-of/let-of-of/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForOfStatement", - "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}}, "await": false, "left": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "of" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"of"}, "name": "of" }, "init": null @@ -97,35 +30,12 @@ }, "right": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "xyz" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"xyz"}, "name": "xyz" }, "body": { "type": "EmptyStatement", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/output.json index 91ec774a75..c525c475d0 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration-with-params/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,70 +20,23 @@ "params": [ { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" }, { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "y" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"y"}, "name": "y" }, { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "z" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"z"}, "name": "z" } ], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/output.json index 0436a729d4..222f1fe293 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield-delegate/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,62 +20,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":16,"end":29,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":29}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":18,"end":27,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":27}}, "expression": { "type": "YieldExpression", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "delegate": true, "argument": { "type": "NumericLiteral", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}}, "extra": { "rawValue": 3, "raw": "3" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/output.json index 0b14ec63dd..8dba9139bc 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration-with-yield/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,62 +20,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "expression": { "type": "YieldExpression", - "start": 18, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":18,"end":25,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":25}}, "delegate": false, "argument": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}}, "extra": { "rawValue": 3, "raw": "3" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration/output.json index 8a6d8362f0..b8d0ba2285 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-declaration/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,18 +20,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-rest-param/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-rest-param/output.json index 5b70bb51c5..eeb0e8d87a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-rest-param/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-rest-param/output.json @@ -1,113 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":1,"end":19,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":19}}, "id": null, "generator": true, "async": false, "params": [ { "type": "RestElement", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15}}, "argument": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" } } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-with-params/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-with-params/output.json index 3ef0daf02c..90facc9d5c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-with-params/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-with-params/output.json @@ -1,132 +1,41 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":1,"end":22,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":22}}, "id": null, "generator": true, "async": false, "params": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "y" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"y"}, "name": "y" }, { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "z" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"z"}, "name": "z" } ], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/output.json index 9d5919d1e5..4171fb619c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-with-yield-delegate/output.json @@ -1,177 +1,52 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, "id": null, "generator": true, "async": false, "params": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "y" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"y"}, "name": "y" }, { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "z" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"z"}, "name": "z" } ], "body": { "type": "BlockStatement", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":20,"end":33,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":33}}, "body": [ { "type": "ExpressionStatement", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31}}, "expression": { "type": "YieldExpression", - "start": 22, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":22,"end":30,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":30}}, "delegate": true, "argument": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "x" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-with-yield/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-with-yield/output.json index 97e5459597..27892c16d3 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-with-yield/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression-with-yield/output.json @@ -1,124 +1,36 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":1,"end":25,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":25}}, "id": null, "generator": true, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":13,"end":25,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":25}}, "body": [ { "type": "ExpressionStatement", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "expression": { "type": "YieldExpression", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22}}, "delegate": false, "argument": { "type": "NumericLiteral", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}}, "extra": { "rawValue": 3, "raw": "3" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression/output.json index 866b55c382..c0bd452fc4 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-expression/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":1,"end":15,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":15}}, "id": null, "generator": true, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-computed-name/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-computed-name/output.json index 2da9d7230a..775e150a30 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-computed-name/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-computed-name/output.json @@ -1,156 +1,45 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":1,"end":50,"loc":{"start":{"line":1,"column":1},"end":{"line":3,"column":1}}, "id": null, "generator": true, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":13,"end":50,"loc":{"start":{"line":1,"column":13},"end":{"line":3,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 19, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":19,"end":48,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":33}}, "argument": { "type": "ObjectExpression", - "start": 26, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":26,"end":48,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":33}}, "properties": [ { "type": "ObjectMethod", - "start": 28, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":28,"end":46,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":31}}, "method": true, "computed": true, "key": { "type": "YieldExpression", - "start": 30, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":30,"end":40,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":25}}, "delegate": false, "argument": { "type": "Identifier", - "start": 36, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "iter" - }, + "start":36,"end":40,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":25},"identifierName":"iter"}, "name": "iter" } }, @@ -161,18 +50,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":44,"end":46,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":31}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-params/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-params/output.json index 9ae0c2e522..11f4540942 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-params/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-params/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":1,"end":21,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":21}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":3,"end":19,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":19}}, "method": true, "key": { "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, @@ -98,70 +31,23 @@ "params": [ { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "y" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"y"}, "name": "y" }, { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "z" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"z"}, "name": "z" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/output.json index 977b214148..8e4f99d303 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield-delegate/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":1,"end":25,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":25}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":3,"end":23,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":23}}, "method": true, "key": { "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, @@ -98,62 +31,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 10, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":10,"end":23,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":23}}, "body": [ { "type": "ExpressionStatement", - "start": 12, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":12,"end":21,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":21}}, "expression": { "type": "YieldExpression", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "delegate": true, "argument": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 3, "raw": "3" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/output.json index d1fc512f80..901a4601f9 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield-expression/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":1,"end":24,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":24}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":3,"end":22,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":22}}, "method": true, "key": { "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, @@ -98,62 +31,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 10, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":10,"end":22,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":22}}, "body": [ { "type": "ExpressionStatement", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "expression": { "type": "YieldExpression", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19}}, "delegate": false, "argument": { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 3, "raw": "3" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/output.json index b26adc4fcb..ced9d493b2 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield-line-terminator/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 4 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 4 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 4 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":4}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":1,"end":28,"loc":{"start":{"line":1,"column":1},"end":{"line":4,"column":3}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":3,"end":26,"loc":{"start":{"line":1,"column":3},"end":{"line":4,"column":1}}, "method": true, "key": { "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, @@ -98,79 +31,24 @@ "params": [], "body": { "type": "BlockStatement", - "start": 10, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":10,"end":26,"loc":{"start":{"line":1,"column":10},"end":{"line":4,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":15,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7}}, "expression": { "type": "YieldExpression", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":15,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7}}, "delegate": false, "argument": null } }, { "type": "ExpressionStatement", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":23,"end":24,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3}}, "expression": { "type": "NumericLiteral", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":23,"end":24,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3}}, "extra": { "rawValue": 3, "raw": "3" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield/output.json index d05afab8aa..f678eced09 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method-with-yield/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":1,"end":22,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":3,"end":20,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":20}}, "method": true, "key": { "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, @@ -98,47 +31,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "body": [ { "type": "ExpressionStatement", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}}, "expression": { "type": "YieldExpression", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17}}, "delegate": false, "argument": null } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method/output.json index 280504bbdf..23c182d532 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/generator-method/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":1,"end":14,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":14}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12}}, "method": true, "key": { "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, @@ -98,18 +31,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/output.json index 6bcafdb4a8..79238865f3 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/static-generator-method-with-computed-name/output.json @@ -1,113 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":10,"end":32,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":32}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":12,"end":30,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":30}}, "static": true, "kind": "method", "computed": true, "key": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "foo" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"foo"}, "name": "foo" }, "id": null, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-generator/static-generator-method/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-generator/static-generator-method/output.json index 86d54a693d..1660aced2c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-generator/static-generator-method/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-generator/static-generator-method/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":10,"end":30,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":30}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":12,"end":28,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":28}}, "static": true, "kind": "method", "key": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/output.json index 68f1fb8a06..8c6994bb9e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/dakuten_handakuten/output.json @@ -1,95 +1,27 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "゛" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"゛"}, "name": "゛" }, "operator": "+", "right": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "゜" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"゜"}, "name": "゜" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_all/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_all/output.json index e92dc30494..332fba83c5 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_all/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_all/output.json @@ -1,78 +1,22 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "ABC" - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22},"identifierName":"ABC"}, "name": "ABC" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_alef/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_alef/output.json index 6bdccdd72d..e011a9c048 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_alef/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_alef/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "𞸀" - }, + "start":4,"end":13,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":13},"identifierName":"𞸀"}, "name": "𞸀" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/output.json index edb32771b7..dbf7415fa1 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_dal_part/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "_𞸃" - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14},"identifierName":"_𞸃"}, "name": "_𞸃" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/output.json index f724a3b10e..ac11e2a59f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_kaf_lam/output.json @@ -1,78 +1,22 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "𞸊𞸋" - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22},"identifierName":"𞸊𞸋"}, "name": "𞸊𞸋" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/output.json index facd3e367d..07fb3606db 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_math_zain_start/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "𞸆_$" - }, + "start":4,"end":15,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":15},"identifierName":"𞸆_$"}, "name": "𞸆_$" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_part/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_part/output.json index 9570a48b50..a680603d0e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_part/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_part/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "ABC" - }, + "start":4,"end":12,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":12},"identifierName":"ABC"}, "name": "ABC" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_start/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_start/output.json index 9570a48b50..a680603d0e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_start/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/escaped_start/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "ABC" - }, + "start":4,"end":12,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":12},"identifierName":"ABC"}, "name": "ABC" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/estimated/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/estimated/output.json index 811527d5f4..25f930eef3 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/estimated/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/estimated/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "℮" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"℮"}, "name": "℮" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/ethiopic_digits/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/ethiopic_digits/output.json index 26a11aeee6..4d508df917 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/ethiopic_digits/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/ethiopic_digits/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "_፩፪፫፬፭፮፯፰፱" - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14},"identifierName":"_፩፪፫፬፭፮፯፰፱"}, "name": "_፩፪፫፬፭፮፯፰፱" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/output.json index 111d8eb97b..c59f2314f4 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_escaped_surrogate_pairs/output.json @@ -1,82 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid Unicode escape (1:4)", "SyntaxError: Invalid Unicode escape (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "𞸀" - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16},"identifierName":"𞸀"}, "name": "𞸀" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/output.json index a6d558c93e..3b41003b98 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_expression_await/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ "SyntaxError: 'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":7,"end":30,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":30}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":11,"end":29,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":29}}, "id": { "type": "Identifier", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "answer" - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17},"identifierName":"answer"}, "name": "answer" }, "init": { "type": "BinaryExpression", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":20,"end":29,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":29}}, "left": { "type": "Identifier", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "await" - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"await"}, "name": "await" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/output.json index 514e8e0f0a..8b141a65c3 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_var_await/output.json @@ -1,97 +1,30 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: 'import' and 'export' may appear only with 'sourceType: \"module\"' (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":7,"end":17,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":17}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "await" - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"await"}, "name": "await" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_alef/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_alef/output.json index 17c60d705e..9b4532561e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_alef/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_alef/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "𞸀" - }, + "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6},"identifierName":"𞸀"}, "name": "𞸀" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_dal_part/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_dal_part/output.json index 34b916d50e..61e8ddec8d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_dal_part/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_dal_part/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "_𞸃" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"_𞸃"}, "name": "_𞸃" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_kaf_lam/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_kaf_lam/output.json index 126731813b..386c605c07 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_kaf_lam/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_kaf_lam/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "id": { "type": "Identifier", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "𞸊𞸋" - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8},"identifierName":"𞸊𞸋"}, "name": "𞸊𞸋" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_zain_start/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_zain_start/output.json index 17798e62e1..6377988b05 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_zain_start/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/math_zain_start/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "id": { "type": "Identifier", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "𞸆_$" - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8},"identifierName":"𞸆_$"}, "name": "𞸆_$" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/module_await/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/module_await/output.json index 76431bad3d..be14db709b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/module_await/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/module_await/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "await" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"await"}, "name": "await" }, "right": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/valid_await/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/valid_await/output.json index 0b5cfe9866..1205ffb679 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/valid_await/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/valid_await/output.json @@ -1,78 +1,22 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "await" - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9},"identifierName":"await"}, "name": "await" }, "init": null @@ -82,33 +26,10 @@ }, { "type": "ExpressionStatement", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19}}, "expression": { "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "await" - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17},"identifierName":"await"}, "name": "await", "extra": { "parenthesized": true, diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/weierstrass/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/weierstrass/output.json index 2388da9114..7463d2925b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/weierstrass/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/weierstrass/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "℘" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"℘"}, "name": "℘" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/output.json index 76c4522a69..9c3c2c6b1a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-identifier/weierstrass_weierstrass/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "℘℘" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"℘℘"}, "name": "℘℘" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/output.json index 13a5ef7f4a..05f4b187ee 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default-and-named-specifiers/output.json @@ -1,145 +1,43 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "local": { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "foo" - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"foo"}, "name": "foo" } }, { "type": "ImportSpecifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16}}, "imported": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "bar" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"bar"}, "name": "bar" }, "local": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "bar" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"bar"}, "name": "bar" } } ], "source": { "type": "StringLiteral", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/output.json index 0458b69aea..9985ba0bfa 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default-and-namespace-specifiers/output.json @@ -1,128 +1,38 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "local": { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "foo" - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"foo"}, "name": "foo" } }, { "type": "ImportNamespaceSpecifier", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "local": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "bar" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"bar"}, "name": "bar" } } ], "source": { "type": "StringLiteral", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default-as/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default-as/output.json index 347b3be444..b14f5cdb95 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default-as/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default-as/output.json @@ -1,113 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":22}}, "imported": { "type": "Identifier", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "default" - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15},"identifierName":"default"}, "name": "default" }, "local": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "foo" - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"foo"}, "name": "foo" } } ], "source": { "type": "StringLiteral", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":29,"end":34,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":34}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default/output.json index 5a75f863c5..22597cae7c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-default/output.json @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "local": { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "foo" - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"foo"}, "name": "foo" } } ], "source": { "type": "StringLiteral", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-jquery/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-jquery/output.json index 30cae98f64..3e36b1ca77 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-jquery/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-jquery/output.json @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "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}}, "local": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "$" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"$"}, "name": "$" } } ], "source": { "type": "StringLiteral", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":14,"end":22,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":22}}, "extra": { "rawValue": "jquery", "raw": "\"jquery\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-module/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-module/output.json index 329db7b046..95736fdee6 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-module/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-module/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [], "source": { "type": "StringLiteral", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/output.json index 7051af9018..cf9dd503a4 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifier/output.json @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":8,"end":18,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":18}}, "imported": { "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" }, "local": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "baz" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"baz"}, "name": "baz" } } ], "source": { "type": "StringLiteral", - "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}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/output.json index bad31cd608..6bcc40f19b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-as-specifiers/output.json @@ -1,162 +1,48 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":8,"end":18,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":18}}, "imported": { "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" }, "local": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "baz" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"baz"}, "name": "baz" } }, { "type": "ImportSpecifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23}}, "imported": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "xyz" - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23},"identifierName":"xyz"}, "name": "xyz" }, "local": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "xyz" - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23},"identifierName":"xyz"}, "name": "xyz" } } ], "source": { "type": "StringLiteral", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-empty/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-empty/output.json index b149b8db92..b5f711497e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-empty/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-empty/output.json @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [], "source": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-specifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-specifier/output.json index 3a62a458d6..a54a3104a7 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-specifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-specifier/output.json @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "imported": { "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" }, "local": { "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" } } ], "source": { "type": "StringLiteral", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/output.json index ec9898e4ef..388349480d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers-comma/output.json @@ -1,162 +1,48 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "imported": { "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" }, "local": { "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" } }, { "type": "ImportSpecifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16}}, "imported": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "baz" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"baz"}, "name": "baz" }, "local": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "baz" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"baz"}, "name": "baz" } } ], "source": { "type": "StringLiteral", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/output.json index cc54edc053..88915ea022 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-named-specifiers/output.json @@ -1,162 +1,48 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "imported": { "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" }, "local": { "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" } }, { "type": "ImportSpecifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16}}, "imported": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "baz" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"baz"}, "name": "baz" }, "local": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "baz" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"baz"}, "name": "baz" } } ], "source": { "type": "StringLiteral", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/output.json index 9c4d87ac49..3d082bcf7a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-namespace-specifier/output.json @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "specifiers": [ { "type": "ImportNamespaceSpecifier", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "local": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "foo" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"foo"}, "name": "foo" } } ], "source": { "type": "StringLiteral", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/output.json index d589597abf..0c902bf05c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-import-declaration/import-null-as-nil/output.json @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":9,"end":20,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":20}}, "imported": { "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" }, "local": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "nil" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"nil"}, "name": "nil" } } ], "source": { "type": "StringLiteral", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/output.json index fe814362c2..a6a8254f88 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_complex_binding_without_init/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Complex binding patterns require an initialization value (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ArrayPattern", - "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}}, "elements": [] }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/output.json index f2fe5561bb..8ed4dab050 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_const_forin/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 0, "raw": "0" @@ -118,35 +40,12 @@ }, "right": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "y" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"y"}, "name": "y" }, "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/output.json index 3a3a8f1230..4602d099aa 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/invalid_let_forin/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: for-in loop variable declaration may not have an initializer (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":5,"end":14,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "init": { "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": 0, "raw": "0" @@ -118,35 +40,12 @@ }, "right": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "y" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"y"}, "name": "y" }, "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/output.json index 0d2a9ed4dc..4af86db4bc 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-lexical-declaration/migrated_0000/output.json @@ -1,141 +1,40 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "discriminant": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "answer" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"answer"}, "name": "answer" }, "cases": [ { "type": "SwitchCase", - "start": 18, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":18,"end":45,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":45}}, "consequent": [ { "type": "VariableDeclaration", - "start": 27, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":27,"end":38,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":38}}, "declarations": [ { "type": "VariableDeclarator", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":31,"end":37,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "t" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"t"}, "name": "t" }, "init": { "type": "NumericLiteral", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":35,"end":37,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":37}}, "extra": { "rawValue": 42, "raw": "42" @@ -148,35 +47,13 @@ }, { "type": "BreakStatement", - "start": 39, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":39,"end":45,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":45}}, "label": null } ], "test": { "type": "NumericLiteral", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/assign-new-target/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/assign-new-target/output.json index 02f31aba69..6cab0ec83d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/assign-new-target/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/assign-new-target/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,111 +20,31 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":13,"end":40,"loc":{"start":{"line":1,"column":13},"end":{"line":3,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 19, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":19,"end":38,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 23, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":23,"end":37,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":22}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"x"}, "name": "x" }, "init": { "type": "MetaProperty", - "start": 27, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":27,"end":37,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":22}}, "meta": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "new" - }, + "start":27,"end":30,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "target" - }, + "start":31,"end":37,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":22},"identifierName":"target"}, "name": "target" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json index e02e90a31d..d5f6e644d7 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/invalid-new-target/output.json @@ -1,129 +1,38 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: new.target can only be used in functions (1:8)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":4,"end":18,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "MetaProperty", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":8,"end":18,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":18}}, "meta": { "type": "Identifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "new" - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "target" - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18},"identifierName":"target"}, "name": "target" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-new-target/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-new-target/output.json index 506e791dd0..3acee47b0c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-new-target/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-new-target/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,93 +20,25 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":13,"end":36,"loc":{"start":{"line":1,"column":13},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":19,"end":34,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":19}}, "expression": { "type": "NewExpression", - "start": 19, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":19,"end":33,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":18}}, "callee": { "type": "MetaProperty", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":23,"end":33,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":18}}, "meta": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "new" - }, + "start":23,"end":26,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "target" - }, + "start":27,"end":33,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":18},"identifierName":"target"}, "name": "target" } }, diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-declaration/output.json index 6f4a4a11e9..72fa8218ca 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-declaration/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,79 +20,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":13,"end":32,"loc":{"start":{"line":1,"column":13},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":19,"end":30,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":15}}, "expression": { "type": "MetaProperty", - "start": 19, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":19,"end":29,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":14}}, "meta": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "new" - }, + "start":19,"end":22,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "target" - }, + "start":23,"end":29,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14},"identifierName":"target"}, "name": "target" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-expression/output.json index 0fc069591e..d3a7ed6fe7 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-expression/output.json @@ -1,173 +1,49 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":4,"end":34,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "init": { "type": "FunctionExpression", - "start": 8, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":8,"end":34,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":34}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":19,"end":34,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":34}}, "body": [ { "type": "ExpressionStatement", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "expression": { "type": "MetaProperty", - "start": 21, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":21,"end":31,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":31}}, "meta": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "new" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "target" - }, + "start":25,"end":31,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":31},"identifierName":"target"}, "name": "target" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-invoke/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-invoke/output.json index 0cfa3ce2b5..1f12694d2c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-invoke/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-invoke/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,93 +20,25 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":13,"end":34,"loc":{"start":{"line":1,"column":13},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":19,"end":32,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":17}}, "expression": { "type": "CallExpression", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":19,"end":31,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}}, "callee": { "type": "MetaProperty", - "start": 19, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":19,"end":29,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":14}}, "meta": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "new" - }, + "start":19,"end":22,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "target" - }, + "start":23,"end":29,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14},"identifierName":"target"}, "name": "target" } }, diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-precedence/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-precedence/output.json index ca5e20d823..136a010baa 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-precedence/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/new-target-precedence/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,107 +20,28 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":13,"end":40,"loc":{"start":{"line":1,"column":13},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":19,"end":38,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":23}}, "expression": { "type": "CallExpression", - "start": 19, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":19,"end":37,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":22}}, "callee": { "type": "NewExpression", - "start": 19, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":19,"end":35,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":20}}, "callee": { "type": "MetaProperty", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":23,"end":33,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":18}}, "meta": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "new" - }, + "start":23,"end":26,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "target" - }, + "start":27,"end":33,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":18},"identifierName":"target"}, "name": "target" } }, diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/output.json index 4bcbca3b0d..61fc62e13a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-meta-property/unknown-property/output.json @@ -1,176 +1,52 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "errors": [ "SyntaxError: The only valid meta property for new is new.target (1:25)" ], "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":4,"end":44,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "init": { "type": "FunctionExpression", - "start": 8, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":8,"end":44,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":44}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":19,"end":44,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":44}}, "body": [ { "type": "ExpressionStatement", - "start": 21, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":21,"end":42,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":42}}, "expression": { "type": "MetaProperty", - "start": 21, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":21,"end":41,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":41}}, "meta": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "new" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 25, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "unknown_property" - }, + "start":25,"end":41,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":41},"identifierName":"unknown_property"}, "name": "unknown_property" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0000/output.json index f21c6941d4..5a3a57f142 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0000/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, "method": true, "key": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "method" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"method"}, "name": "method" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0001/output.json index c81975172d..69bfad8eae 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0001/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "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": "ObjectExpression", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":6,"end":22,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":22}}, "method": true, "key": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "method" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"method"}, "name": "method" }, "computed": false, @@ -130,36 +40,13 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "test" - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17},"identifierName":"test"}, "name": "test" } ], "body": { "type": "BlockStatement", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0002/output.json index 1b04fa1a9e..9458f1abae 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0002/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "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": "ObjectExpression", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":6,"end":20,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":20}}, "method": true, "key": { "type": "StringLiteral", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "extra": { "rawValue": "method", "raw": "'method'" @@ -133,18 +44,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0003/output.json index b741ed8e8c..e4fe6bae92 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0003/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "method": true, "key": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "get" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"get"}, "name": "get" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0004/output.json index dcc857d36a..501eec0d1d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-method-definition/migrated_0004/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "method": true, "key": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "set" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"set"}, "name": "set" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15}}, "body": [], "directives": [] } 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 8316c5f97f..ff24f91951 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 @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ "SyntaxError: Redefinition of __proto__ property (1:39)" ], "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":1,"end":57,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":57}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":3,"end":18,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "__proto" - }, + "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14},"identifierName":"__proto"}, "name": "__proto" }, "computed": false, @@ -101,51 +34,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [], "directives": [] } }, { "type": "ObjectProperty", - "start": 20, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":20,"end":37,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":37}}, "method": false, "key": { "type": "StringLiteral", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "extra": { "rawValue": "__proto__", "raw": "\"__proto__\"" @@ -156,68 +56,23 @@ "shorthand": false, "value": { "type": "NullLiteral", - "start": 33, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37}} } }, { "type": "ObjectProperty", - "start": 39, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":39,"end":54,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":54}}, "method": false, "key": { "type": "Identifier", - "start": 39, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "__proto__" - }, + "start":39,"end":48,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":48},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NullLiteral", - "start": 50, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 54 - } - } + "start":50,"end":54,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":54}} } } ], 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 5e3da9129e..036a85e2ef 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 @@ -1,145 +1,45 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ "SyntaxError: Redefinition of __proto__ property (1:20)" ], "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":1,"end":39,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":39}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":3,"end":18,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NullLiteral", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}} } }, { "type": "ObjectProperty", - "start": 20, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":20,"end":37,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":37}}, "method": false, "key": { "type": "StringLiteral", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "extra": { "rawValue": "__proto__", "raw": "\"__proto__\"" @@ -150,18 +50,7 @@ "shorthand": false, "value": { "type": "NullLiteral", - "start": 33, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37}} } } ], 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 f0884a922d..cea3f48035 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 @@ -1,164 +1,52 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Redefinition of __proto__ property (1:20)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":1,"end":37,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":37}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":3,"end":18,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NullLiteral", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}} } }, { "type": "ObjectProperty", - "start": 20, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":20,"end":35,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":35}}, "method": false, "key": { "type": "Identifier", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "__proto__" - }, + "start":20,"end":29,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":29},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NullLiteral", - "start": 31, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":31,"end":35,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":35}} } } ], 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 7b8c0af892..f8a8b6f0e0 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 @@ -1,95 +1,29 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ "SyntaxError: Redefinition of __proto__ property (1:22)" ], "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":1,"end":39,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":39}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":3,"end":20,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "StringLiteral", - "start": 3, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":3,"end":14,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":14}}, "extra": { "rawValue": "__proto__", "raw": "\"__proto__\"" @@ -100,68 +34,23 @@ "shorthand": false, "value": { "type": "NullLiteral", - "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}} } }, { "type": "ObjectProperty", - "start": 22, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":22,"end":37,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":37}}, "method": false, "key": { "type": "Identifier", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "__proto__" - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NullLiteral", - "start": 33, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37}} } } ], 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 a9e0e52b80..6c50c95aa2 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 @@ -1,95 +1,29 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "errors": [ "SyntaxError: Redefinition of __proto__ property (1:22)" ], "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":1,"end":41,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":41}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":3,"end":20,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "StringLiteral", - "start": 3, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":3,"end":14,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":14}}, "extra": { "rawValue": "__proto__", "raw": "\"__proto__\"" @@ -100,49 +34,16 @@ "shorthand": false, "value": { "type": "NullLiteral", - "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}} } }, { "type": "ObjectProperty", - "start": 22, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":22,"end":39,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":39}}, "method": false, "key": { "type": "StringLiteral", - "start": 22, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":22,"end":33,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":33}}, "extra": { "rawValue": "__proto__", "raw": "'__proto__'" @@ -153,18 +54,7 @@ "shorthand": false, "value": { "type": "NullLiteral", - "start": 35, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 39 - } - } + "start":35,"end":39,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":39}} } } ], 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 1a77efa6de..9ee4dd7e6a 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 @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "errors": [ "SyntaxError: Redefinition of __proto__ property (1:42)" ], "program": { "type": "Program", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":1,"end":60,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":60}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":3,"end":21,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":21}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "__proto__" - }, + "start":7,"end":16,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":16},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, @@ -101,69 +34,24 @@ "params": [ { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"x"}, "name": "x" } ], "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } }, { "type": "ObjectProperty", - "start": 23, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":23,"end":40,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":40}}, "method": false, "key": { "type": "StringLiteral", - "start": 23, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":23,"end":34,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":34}}, "extra": { "rawValue": "__proto__", "raw": "\"__proto__\"" @@ -174,68 +62,23 @@ "shorthand": false, "value": { "type": "NullLiteral", - "start": 36, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 40 - } - } + "start":36,"end":40,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":40}} } }, { "type": "ObjectProperty", - "start": 42, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":42,"end":57,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":57}}, "method": false, "key": { "type": "Identifier", - "start": 42, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "__proto__" - }, + "start":42,"end":51,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":51},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NullLiteral", - "start": 53, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 57 - } - } + "start":53,"end":57,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":57}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/output.json index f462e8df71..a8ceef6250 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter-setter/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":60}}, "program": { "type": "Program", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":60}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":60}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":1,"end":59,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":59}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":3,"end":18,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NullLiteral", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}} } }, { "type": "ObjectMethod", - "start": 20, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":20,"end":37,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":37}}, "method": false, "key": { "type": "Identifier", - "start": 24, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "__proto__" - }, + "start":24,"end":33,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":33},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, @@ -148,52 +47,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":35,"end":37,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":37}}, "body": [], "directives": [] } }, { "type": "ObjectMethod", - "start": 39, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":39,"end":57,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":57}}, "method": false, "key": { "type": "Identifier", - "start": 43, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 52 - }, - "identifierName": "__proto__" - }, + "start":43,"end":52,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":52},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, @@ -204,36 +69,13 @@ "params": [ { "type": "Identifier", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 54 - }, - "identifierName": "x" - }, + "start":53,"end":54,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":54},"identifierName":"x"}, "name": "x" } ], "body": { "type": "BlockStatement", - "start": 55, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":55,"end":57,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":57}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/output.json index d628d7fbf9..2c7e4152b4 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-getter/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":1,"end":39,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":39}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":3,"end":18,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NullLiteral", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}} } }, { "type": "ObjectMethod", - "start": 20, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":20,"end":37,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":37}}, "method": false, "key": { "type": "Identifier", - "start": 24, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "__proto__" - }, + "start":24,"end":33,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":33},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, @@ -148,18 +47,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":35,"end":37,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":37}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/output.json index 76754ed85d..efdf56efcc 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-method/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":1,"end":36,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":36}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":3,"end":18,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NullLiteral", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}} } }, { "type": "ObjectMethod", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":20,"end":33,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":33}}, "method": true, "key": { "type": "Identifier", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "__proto__" - }, + "start":20,"end":29,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":29},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, @@ -148,18 +47,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/output.json index 2c2439583c..c161a16c9d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-setter/output.json @@ -1,143 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":3,"end":18,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NullLiteral", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}} } }, { "type": "ObjectMethod", - "start": 20, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":20,"end":38,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":38}}, "method": false, "key": { "type": "Identifier", - "start": 24, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "__proto__" - }, + "start":24,"end":33,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":33},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, @@ -148,36 +47,13 @@ "params": [ { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"x"}, "name": "x" } ], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-shorthand/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-shorthand/output.json index 20867c4f1d..5c58609e4b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-shorthand/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-identifier-shorthand/output.json @@ -1,162 +1,49 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":1,"end":31,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":31}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":3,"end":18,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NullLiteral", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}} } }, { "type": "ObjectProperty", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":20,"end":29,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "__proto__" - }, + "start":20,"end":29,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":29},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "__proto__" - }, + "start":20,"end":29,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":29},"identifierName":"__proto__"}, "name": "__proto__" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/output.json index 78db3aba0b..94da8534c5 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter-setter/output.json @@ -1,92 +1,26 @@ { "type": "File", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "program": { "type": "Program", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":1,"end":61,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":61}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":3,"end":20,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "StringLiteral", - "start": 3, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":3,"end":14,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":14}}, "extra": { "rawValue": "__proto__", "raw": "\"__proto__\"" @@ -97,50 +31,16 @@ "shorthand": false, "value": { "type": "NullLiteral", - "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}} } }, { "type": "ObjectMethod", - "start": 22, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":22,"end":39,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":39}}, "method": false, "key": { "type": "Identifier", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "__proto__" - }, + "start":26,"end":35,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":35},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, @@ -151,52 +51,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":37,"end":39,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":39}}, "body": [], "directives": [] } }, { "type": "ObjectMethod", - "start": 41, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":41,"end":59,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":59}}, "method": false, "key": { "type": "Identifier", - "start": 45, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 54 - }, - "identifierName": "__proto__" - }, + "start":45,"end":54,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":54},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, @@ -207,36 +73,13 @@ "params": [ { "type": "Identifier", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 56 - }, - "identifierName": "x" - }, + "start":55,"end":56,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":56},"identifierName":"x"}, "name": "x" } ], "body": { "type": "BlockStatement", - "start": 57, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":57,"end":59,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":59}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/output.json index 6dc20f542b..bc0b2f3ecc 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-getter/output.json @@ -1,92 +1,26 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":1,"end":41,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":41}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":3,"end":20,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "StringLiteral", - "start": 3, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":3,"end":14,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":14}}, "extra": { "rawValue": "__proto__", "raw": "\"__proto__\"" @@ -97,50 +31,16 @@ "shorthand": false, "value": { "type": "NullLiteral", - "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}} } }, { "type": "ObjectMethod", - "start": 22, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":22,"end":39,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":39}}, "method": false, "key": { "type": "Identifier", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "__proto__" - }, + "start":26,"end":35,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":35},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, @@ -151,18 +51,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":37,"end":39,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":39}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/output.json index cd0e7970ca..7c3e91646b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-method/output.json @@ -1,92 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":3,"end":20,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "StringLiteral", - "start": 3, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":3,"end":14,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":14}}, "extra": { "rawValue": "__proto__", "raw": "\"__proto__\"" @@ -97,50 +31,16 @@ "shorthand": false, "value": { "type": "NullLiteral", - "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}} } }, { "type": "ObjectMethod", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":22,"end":35,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":35}}, "method": true, "key": { "type": "Identifier", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "__proto__" - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, @@ -151,18 +51,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/output.json index b9973f0450..786fd46e74 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-setter/output.json @@ -1,92 +1,26 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":3,"end":20,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "StringLiteral", - "start": 3, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":3,"end":14,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":14}}, "extra": { "rawValue": "__proto__", "raw": "\"__proto__\"" @@ -97,50 +31,16 @@ "shorthand": false, "value": { "type": "NullLiteral", - "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}} } }, { "type": "ObjectMethod", - "start": 22, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":22,"end":40,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":40}}, "method": false, "key": { "type": "Identifier", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "__proto__" - }, + "start":26,"end":35,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":35},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, @@ -151,36 +51,13 @@ "params": [ { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "x" - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37},"identifierName":"x"}, "name": "x" } ], "body": { "type": "BlockStatement", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":38,"end":40,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":40}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-shorthand/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-shorthand/output.json index 43f28e81ab..f74df79bf8 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-shorthand/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-literal-shorthand/output.json @@ -1,92 +1,26 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":3,"end":20,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "StringLiteral", - "start": 3, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":3,"end":14,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":14}}, "extra": { "rawValue": "__proto__", "raw": "\"__proto__\"" @@ -97,69 +31,23 @@ "shorthand": false, "value": { "type": "NullLiteral", - "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}} } }, { "type": "ObjectProperty", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31}}, "method": false, "key": { "type": "Identifier", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "__proto__" - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "__proto__" - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31},"identifierName":"__proto__"}, "name": "__proto__" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-shorthand-identifier/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-shorthand-identifier/output.json index 28fc9127cd..2dd25f6587 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-shorthand-identifier/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-shorthand-identifier/output.json @@ -1,112 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":1,"end":31,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":31}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "extra": { @@ -115,52 +36,18 @@ }, { "type": "ObjectProperty", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "__proto__" - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NullLiteral", - "start": 25, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 29 - } - } + "start":25,"end":29,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":29}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-shorthand-literal/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-shorthand-literal/output.json index 5bfefd1a39..c667c59f9a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-shorthand-literal/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-shorthand-literal/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "extra": { @@ -115,33 +36,11 @@ }, { "type": "ObjectProperty", - "start": 14, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":14,"end":31,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":31}}, "method": false, "key": { "type": "StringLiteral", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":14,"end":25,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":25}}, "extra": { "rawValue": "__proto__", "raw": "\"__proto__\"" @@ -152,18 +51,7 @@ "shorthand": false, "value": { "type": "NullLiteral", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-shorthands/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-shorthands/output.json index 23f3d43707..1b1324a6d4 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-shorthands/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-initialiser/proto-shorthands/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":1,"end":25,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":25}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "__proto__" - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12},"identifierName":"__proto__"}, "name": "__proto__" }, "extra": { @@ -115,53 +36,18 @@ }, { "type": "ObjectProperty", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}}, "method": false, "key": { "type": "Identifier", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "__proto__" - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "__proto__" - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23},"identifierName":"__proto__"}, "name": "__proto__" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/output.json index 4d782bacf3..d3c16c2f9e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-literal-property-value-shorthand/migrated_0000/output.json @@ -1,144 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "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" }, "extra": { @@ -147,53 +45,18 @@ }, { "type": "ObjectProperty", - "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}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "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" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/elision/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/elision/output.json index 243668c0d0..05304c5be1 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/elision/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/elision/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ObjectPattern", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "extra": { @@ -135,18 +45,7 @@ }, "init": { "type": "NumericLiteral", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-catch-param/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-catch-param/output.json index 528fb144b2..c558c55697 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-catch-param/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-catch-param/output.json @@ -1,109 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "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}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":8,"end":21,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":21}}, "param": { "type": "ObjectPattern", - "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}}, "properties": [] }, "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-fn/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-fn/output.json index eff1ea1fd4..1bca4ed97b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-fn/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-fn/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -65,35 +20,13 @@ "params": [ { "type": "ObjectPattern", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "properties": [] } ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/output.json index 4a05632608..44eb28b6aa 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-for-lex/output.json @@ -1,91 +1,25 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "left": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ObjectPattern", - "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}}, "properties": [] }, "init": null @@ -95,18 +29,7 @@ }, "right": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 0, "raw": "0" @@ -115,18 +38,7 @@ }, "body": { "type": "EmptyStatement", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-lexical/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-lexical/output.json index d154c58b00..50c06e1b75 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-lexical/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-lexical/output.json @@ -1,93 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "id": { "type": "ObjectPattern", - "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}}, "properties": [] }, "init": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-var/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-var/output.json index ab870af50e..cf0391f09f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-var/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/empty-var/output.json @@ -1,93 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "id": { "type": "ObjectPattern", - "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}}, "properties": [] }, "init": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/nested/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/nested/output.json index 995c478e84..3c7f97dae6 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/nested/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/nested/output.json @@ -1,126 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "ObjectPattern", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "properties": [ { "type": "ObjectProperty", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "method": false, "key": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "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}}, "properties": [] } } @@ -128,18 +39,7 @@ }, "init": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/properties/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/properties/output.json index ee694093e2..8a00d0c2d9 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/properties/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-object-pattern/properties/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":4,"end":31,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":31}}, "id": { "type": "ObjectPattern", - "start": 4, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":4,"end":29,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":29}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "extra": { @@ -130,83 +40,26 @@ }, { "type": "ObjectProperty", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "b" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "left": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "b" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" }, "right": { "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": 0, "raw": "0" @@ -220,135 +73,43 @@ }, { "type": "ObjectProperty", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "c" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "d" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"d"}, "name": "d" } }, { "type": "ObjectProperty", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "e" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"e"}, "name": "e" }, "computed": false, "shorthand": false, "value": { "type": "AssignmentPattern", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "left": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "f" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"f"}, "name": "f" }, "right": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 0, "raw": "0" @@ -359,68 +120,22 @@ }, { "type": "ObjectProperty", - "start": 21, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":21,"end":28,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":28}}, "method": false, "computed": true, "key": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "g" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"g"}, "name": "g" }, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":25,"end":28,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":28}}, "elements": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "h" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"h"}, "name": "h" } ] @@ -430,18 +145,7 @@ }, "init": { "type": "NumericLiteral", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0000/output.json index b1465d1f54..fbed9f8857 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0000/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "00" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0001/output.json index ba347ead99..69b1fc0dba 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0001/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0o0" 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 d5fe344096..61be53c7f1 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "test" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"test"}, "name": "test" }, "generator": false, @@ -65,47 +20,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":16,"end":37,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":37}}, "body": [ { "type": "ExpressionStatement", - "start": 31, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":31,"end":35,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":35}}, "expression": { "type": "NumericLiteral", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":31,"end":34,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":34}}, "extra": { "rawValue": 0, "raw": "0o0" @@ -117,32 +39,10 @@ "directives": [ { "type": "Directive", - "start": 17, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":17,"end":30,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":30}}, "value": { "type": "DirectiveLiteral", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0003/output.json index 83bb02767b..8e667f20e7 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0003/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 2, "raw": "0o2" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0004/output.json index b6a8fbeae7..cb18be5923 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0004/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 10, "raw": "0o12" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0005/output.json index 28ed794187..88aa9ec11b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-octal-integer-literal/migrated_0005/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0O0" 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 c8c90942d5..055a0e3f11 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "test" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"test"}, "name": "test" }, "generator": false, @@ -65,47 +20,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":16,"end":37,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":37}}, "body": [ { "type": "ExpressionStatement", - "start": 31, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":31,"end":35,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":35}}, "expression": { "type": "NumericLiteral", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":31,"end":34,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":34}}, "extra": { "rawValue": 0, "raw": "0O0" @@ -117,32 +39,10 @@ "directives": [ { "type": "Directive", - "start": 17, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":17,"end":30,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":30}}, "value": { "type": "DirectiveLiteral", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "value": "use strict", "extra": { "raw": "'use strict'", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/function-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/function-declaration/output.json index 6d5be94768..572ab04a24 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/function-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/function-declaration/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,68 +20,22 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}}, "argument": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "b" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"b"}, "name": "b" } } ], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/function-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/function-expression/output.json index 292e5947e0..efed9fb6b3 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/function-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/function-expression/output.json @@ -1,162 +1,49 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "right": { "type": "FunctionExpression", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "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}}, "argument": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "b" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"b"}, "name": "b" } } ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/object-method/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/object-method/output.json index 2a7cf33842..b47cdbe229 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/object-method/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/object-method/output.json @@ -1,211 +1,64 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "o" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"o"}, "name": "o" }, "right": { "type": "ObjectExpression", - "start": 4, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":4,"end":31,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":31}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":6,"end":29,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "f" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"f"}, "name": "f" }, "computed": false, "shorthand": false, "value": { "type": "FunctionExpression", - "start": 9, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":9,"end":29,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":29}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "a" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "start": 21, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":21,"end":25,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":25}}, "argument": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "b" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"b"}, "name": "b" } } ], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/output.json index 2b0e6f95c3..0e1543e81b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-rest-parameter/object-shorthand-method/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "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": "ObjectExpression", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":6,"end":25,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":25}}, "method": true, "key": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "method" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"method"}, "name": "method" }, "computed": false, @@ -130,51 +40,17 @@ "params": [ { "type": "RestElement", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "argument": { "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "test" - }, + "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"test"}, "name": "test" } } ], "body": { "type": "BlockStatement", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-multi-spread/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-multi-spread/output.json index 7f2e414d39..03a2baa187 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-multi-spread/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-multi-spread/output.json @@ -1,173 +1,48 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "callee": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "SpreadElement", - "start": 2, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":2,"end":6,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":6}}, "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" } }, { "type": "SpreadElement", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "argument": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "y" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"y"}, "name": "y" } }, { "type": "SpreadElement", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}}, "argument": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "z" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread-default/output.json index d184a82649..7be40e5809 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread-default/output.json @@ -1,158 +1,44 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "g" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"g"}, "name": "g" }, { "type": "SpreadElement", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}}, "argument": { "type": "AssignmentExpression", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "operator": "=", "left": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "h" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"h"}, "name": "h" }, "right": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "i" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"i"}, "name": "i" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread-first/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread-first/output.json index dd7f63dd59..843b7d41c9 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread-first/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread-first/output.json @@ -1,144 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "SpreadElement", - "start": 2, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":2,"end":6,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":6}}, "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" } }, { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "y" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"y"}, "name": "y" }, { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "z" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"z"}, "name": "z" } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread-number/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread-number/output.json index 616ce67a70..954d701bc5 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread-number/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread-number/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "SpreadElement", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "argument": { "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": 0.5, "raw": ".5" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread/output.json index da2f1ba24c..5db111120b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/call-spread/output.json @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "SpreadElement", - "start": 2, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":2,"end":6,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":6}}, "argument": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "g" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"g"}, "name": "g" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-multi-spread/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-multi-spread/output.json index 57dc83daf3..ebd1a9ff4a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-multi-spread/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-multi-spread/output.json @@ -1,173 +1,48 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "NewExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "callee": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "SpreadElement", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10}}, "argument": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" } }, { "type": "SpreadElement", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "argument": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "y" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"y"}, "name": "y" } }, { "type": "SpreadElement", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "argument": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "z" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread-default/output.json index 5a8f135f23..4d96ec0b3b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread-default/output.json @@ -1,158 +1,44 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "NewExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "callee": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "g" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"g"}, "name": "g" }, { "type": "SpreadElement", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "argument": { "type": "AssignmentExpression", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17}}, "operator": "=", "left": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "h" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"h"}, "name": "h" }, "right": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "i" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"i"}, "name": "i" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread-first/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread-first/output.json index caa4e829ed..89a6fa7161 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread-first/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread-first/output.json @@ -1,144 +1,41 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "NewExpression", - "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}}, "callee": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "SpreadElement", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10}}, "argument": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" } }, { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "y" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"y"}, "name": "y" }, { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "z" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"z"}, "name": "z" } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread-number/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread-number/output.json index abac9752fc..e2e970159f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread-number/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread-number/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "SpreadElement", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "argument": { "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": 0.5, "raw": ".5" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread/output.json index 31dcf569b5..5461886da3 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-spread-element/new-spread/output.json @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "SpreadElement", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10}}, "argument": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "g" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"g"}, "name": "g" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/arrow_super/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/arrow_super/output.json index dd71fe58b8..6482545dee 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/arrow_super/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/arrow_super/output.json @@ -1,127 +1,36 @@ { "type": "File", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"B"}, "name": "B" }, "body": { "type": "ClassBody", - "start": 18, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":18,"end":69,"loc":{"start":{"line":1,"column":18},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 24, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":24,"end":67,"loc":{"start":{"line":2,"column":4},"end":{"line":4,"column":5}}, "static": false, "key": { "type": "Identifier", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "constructor" - }, + "start":24,"end":35,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":15},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -132,79 +41,24 @@ "params": [], "body": { "type": "BlockStatement", - "start": 38, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":38,"end":67,"loc":{"start":{"line":2,"column":18},"end":{"line":4,"column":5}}, "body": [ { "type": "ExpressionStatement", - "start": 48, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":48,"end":61,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":21}}, "expression": { "type": "ArrowFunctionExpression", - "start": 48, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":48,"end":61,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":21}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "CallExpression", - "start": 54, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":54,"end":61,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":21}}, "callee": { "type": "Super", - "start": 54, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 19 - } - } + "start":54,"end":59,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":19}} }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/constructor_super/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/constructor_super/output.json index 3e043c1b39..6cde1b39d6 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/constructor_super/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/constructor_super/output.json @@ -1,127 +1,36 @@ { "type": "File", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"B"}, "name": "B" }, "body": { "type": "ClassBody", - "start": 18, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":18,"end":64,"loc":{"start":{"line":1,"column":18},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 24, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":24,"end":62,"loc":{"start":{"line":2,"column":4},"end":{"line":4,"column":5}}, "static": false, "key": { "type": "Identifier", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "constructor" - }, + "start":24,"end":35,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":15},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -132,61 +41,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 38, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":38,"end":62,"loc":{"start":{"line":2,"column":18},"end":{"line":4,"column":5}}, "body": [ { "type": "ExpressionStatement", - "start": 48, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":48,"end":56,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":16}}, "expression": { "type": "CallExpression", - "start": 48, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":48,"end":55,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":15}}, "callee": { "type": "Super", - "start": 48, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":48,"end":53,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":13}} }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/output.json index 94b7917cd3..581568e109 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-super-property/invalid_super_not_inside_function/output.json @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (1:8)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "CallExpression", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15}}, "callee": { "type": "Super", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}} }, "arguments": [] } 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 5390082800..7f6068365f 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 @@ -1,127 +1,36 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"B"}, "name": "B" }, "body": { "type": "ClassBody", - "start": 18, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":18,"end":63,"loc":{"start":{"line":1,"column":18},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 24, - "end": 61, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":24,"end":61,"loc":{"start":{"line":2,"column":4},"end":{"line":4,"column":5}}, "static": false, "key": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "foo" - }, + "start":24,"end":27,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -132,91 +41,24 @@ "params": [], "body": { "type": "BlockStatement", - "start": 30, - "end": 61, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":30,"end":61,"loc":{"start":{"line":2,"column":10},"end":{"line":4,"column":5}}, "body": [ { "type": "ExpressionStatement", - "start": 40, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":40,"end":55,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":23}}, "expression": { "type": "NewExpression", - "start": 40, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":40,"end":55,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":23}}, "callee": { "type": "MemberExpression", - "start": 44, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":44,"end":53,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":21}}, "object": { "type": "Super", - "start": 44, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 17 - } - } + "start":44,"end":49,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":17}} }, "property": { "type": "Identifier", - "start": 50, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 21 - }, - "identifierName": "bar" - }, + "start":50,"end":53,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":21},"identifierName":"bar"}, "name": "bar" }, "computed": false 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 8489fd9886..948a5de374 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 @@ -1,127 +1,36 @@ { "type": "File", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"B"}, "name": "B" }, "body": { "type": "ClassBody", - "start": 18, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":18,"end":61,"loc":{"start":{"line":1,"column":18},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 24, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":24,"end":59,"loc":{"start":{"line":2,"column":4},"end":{"line":4,"column":5}}, "static": false, "key": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "X" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"X"}, "name": "X" }, "computed": false, @@ -132,76 +41,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":28,"end":59,"loc":{"start":{"line":2,"column":8},"end":{"line":4,"column":5}}, "body": [ { "type": "ReturnStatement", - "start": 38, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":38,"end":53,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":23}}, "argument": { "type": "MemberExpression", - "start": 45, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":45,"end":53,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":23}}, "object": { "type": "Super", - "start": 45, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 20 - } - } + "start":45,"end":50,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":20}} }, "property": { "type": "NumericLiteral", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":51,"end":52,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":22}}, "extra": { "rawValue": 1, "raw": "1" 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 cae838de0a..1c2d10dbfc 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 @@ -1,127 +1,36 @@ { "type": "File", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"B"}, "name": "B" }, "body": { "type": "ClassBody", - "start": 18, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":18,"end":60,"loc":{"start":{"line":1,"column":18},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 24, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":24,"end":58,"loc":{"start":{"line":2,"column":4},"end":{"line":4,"column":5}}, "static": false, "key": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "X" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"X"}, "name": "X" }, "computed": false, @@ -132,77 +41,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":28,"end":58,"loc":{"start":{"line":2,"column":8},"end":{"line":4,"column":5}}, "body": [ { "type": "ReturnStatement", - "start": 38, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":38,"end":52,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":22}}, "argument": { "type": "MemberExpression", - "start": 45, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":45,"end":52,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":22}}, "object": { "type": "Super", - "start": 45, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 20 - } - } + "start":45,"end":50,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":20}} }, "property": { "type": "Identifier", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 22 - }, - "identifierName": "y" - }, + "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-template-literals/dollar-sign/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/dollar-sign/output.json index 4e9b217cb0..9b2b86cb1b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/dollar-sign/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/dollar-sign/output.json @@ -1,78 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "$", "cooked": "$" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/escape-sequences/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/escape-sequences/output.json index 27c7864d33..dd0d55ac7e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/escape-sequences/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/escape-sequences/output.json @@ -1,78 +1,23 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":1,"end":29,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":29}}, "value": { "raw": "\\\\n\\\\r\\\\b\\\\v\\\\t\\\\f\\\\\\n\\\\\\r\\n", "cooked": "\\n\\r\\b\\v\\t\\f\\\n\\\r\n" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/output.json index 3f3cd65969..6218e2b715 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/invalid-escape/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "value": { "raw": "\\1", "cooked": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/line-terminators/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/line-terminators/output.json index 3987e50bf7..06a0ed65ac 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/line-terminators/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/line-terminators/output.json @@ -1,78 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "value": { "raw": "\\n\\r\\n", "cooked": "\n\r\n" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/output.json index 5aa224c4df..c887127419 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/literal-escape-sequences/output.json @@ -1,78 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":1,"end":34,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":34}}, "value": { "raw": "\\\\u{000042}\\\\u0042\\\\x42\\\\u0\\\\A\\\\0", "cooked": "\\u{000042}\\u0042\\x42\\u0\\A\\0" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/new-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/new-expression/output.json index 646a2349df..0189e907f5 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/new-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/new-expression/output.json @@ -1,123 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "raw" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"raw"}, "name": "raw" }, "quasi": { "type": "TemplateLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "value": { "raw": "42", "cooked": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/output.json index a036ba998f..d54c1eadf6 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/tagged-interpolation/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "tag": { "type": "Identifier", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "raw" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"raw"}, "name": "raw" }, "quasi": { "type": "TemplateLiteral", - "start": 3, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":3,"end":18,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":18}}, "expressions": [ { "type": "Identifier", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "name" - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16},"identifierName":"name"}, "name": "name" } ], "quasis": [ { "type": "TemplateElement", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "value": { "raw": "hello ", "cooked": "hello " @@ -130,18 +40,7 @@ }, { "type": "TemplateElement", - "start": 17, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":17,"end":17,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":17}}, "value": { "raw": "", "cooked": "" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/output.json index 48aa72ea2d..812808de9f 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/tagged-nested-with-object-literal/output.json @@ -1,153 +1,42 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "tag": { "type": "Identifier", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "raw" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"raw"}, "name": "raw" }, "quasi": { "type": "TemplateLiteral", - "start": 3, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":3,"end":44,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":44}}, "expressions": [ { "type": "TemplateLiteral", - "start": 12, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":12,"end":42,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":42}}, "expressions": [ { "type": "BinaryExpression", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":22,"end":35,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":35}}, "left": { "type": "TemplateLiteral", - "start": 22, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":22,"end":30,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":30}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":23,"end":29,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":29}}, "value": { "raw": "deeply", "cooked": "deeply" @@ -159,18 +48,7 @@ "operator": "+", "right": { "type": "ObjectExpression", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "properties": [] } } @@ -178,18 +56,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "value": { "raw": "nested ", "cooked": "nested " @@ -198,18 +65,7 @@ }, { "type": "TemplateElement", - "start": 36, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":36,"end":41,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":41}}, "value": { "raw": " blah", "cooked": " blah" @@ -222,18 +78,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "value": { "raw": "token ", "cooked": "token " @@ -242,18 +87,7 @@ }, { "type": "TemplateElement", - "start": 43, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":43,"end":43,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":43}}, "value": { "raw": "", "cooked": "" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/tagged/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/tagged/output.json index 9ea44c8e0c..afff23398c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/tagged/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/tagged/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "raw" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"raw"}, "name": "raw" }, "quasi": { "type": "TemplateLiteral", - "start": 3, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":3,"end":7,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":7}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "42", "cooked": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/untagged/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/untagged/output.json index 1709e7f7be..29c7dc50af 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/untagged/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-template-literals/untagged/output.json @@ -1,78 +1,23 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "value": { "raw": "42", "cooked": "42" 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 6cf40d9662..5e53dbc37a 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 @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\\\u{714E}\\\\u{8336}", "extra": { "raw": "\"\\\\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 3f3b343908..7f865efa66 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 @@ -1,63 +1,19 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "value": { "type": "DirectiveLiteral", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "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}\"", 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 4331e2b8c3..f32f1372bd 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 @@ -1,63 +1,19 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "value": { "type": "DirectiveLiteral", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "value": "\\\\u{00000000034}", "extra": { "raw": "\"\\\\u{00000000034}\"", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/output.json index 93f2966708..4081ebee04 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-default/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (1:21)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -68,111 +23,33 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":14,"end":38,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":38}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":16,"end":36,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":36}}, "expression": { "type": "ArrowFunctionExpression", - "start": 16, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":16,"end":36,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":36}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "left": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"x"}, "name": "x" }, "right": { "type": "YieldExpression", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "delegate": false, "argument": { "type": "NumericLiteral", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "extra": { "rawValue": 42, "raw": "42" @@ -184,18 +61,7 @@ ], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json index dfdc04d3c4..2ef911f256 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameter/output.json @@ -1,67 +1,22 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (1:16)", "SyntaxError: Binding invalid left-hand side in function parameter list (1:16)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -69,83 +24,28 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":13,"end":30,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":30}}, "body": [ { "type": "ExpressionStatement", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "expression": { "type": "ArrowFunctionExpression", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "id": null, "generator": false, "async": false, "params": [ { "type": "YieldExpression", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "delegate": false, "argument": null } ], "body": { "type": "NumericLiteral", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json index 6bf7ee0d61..5656f98e99 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-arrow-parameters/output.json @@ -1,67 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (1:25)", "SyntaxError: Binding invalid left-hand side in function parameter list (1:25)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -69,134 +24,43 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":13,"end":39,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":39}}, "body": [ { "type": "ExpressionStatement", - "start": 15, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":15,"end":37,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":37}}, "expression": { "type": "ArrowFunctionExpression", - "start": 15, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":15,"end":37,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":37}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "b" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"b"}, "name": "b" }, { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "c" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"c"}, "name": "c" }, { "type": "YieldExpression", - "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}}, "delegate": false, "argument": null } ], "body": { "type": "NumericLiteral", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":35,"end":37,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":37}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/output.json index 638788f440..02857ebe4b 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-catch/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:30)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -68,95 +23,28 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":14,"end":41,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":41}}, "body": [ { "type": "TryStatement", - "start": 16, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":16,"end":39,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":39}}, "block": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 23, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":23,"end":39,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":39}}, "param": { "type": "Identifier", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "yield" - }, + "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35},"identifierName":"yield"}, "name": "yield" }, "body": { "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":37,"end":39,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":39}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/output.json index 30846cf742..bbdafe45b1 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-declaration/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:26)" ], "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":14,"end":37,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":37}}, "body": [ { "type": "FunctionDeclaration", - "start": 16, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":16,"end":35,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":35}}, "id": { "type": "Identifier", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "yield" - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31},"identifierName":"yield"}, "name": "yield" }, "generator": true, @@ -117,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/output.json index 273c4fcdf0..03ac7846dc 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-export-default/output.json @@ -1,80 +1,24 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (1:25)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "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}}, "declaration": { "type": "FunctionDeclaration", - "start": 15, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":15,"end":35,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":35}}, "id": { "type": "Identifier", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "yield" - }, + "start":25,"end":30,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":30},"identifierName":"yield"}, "name": "yield" }, "generator": true, @@ -82,18 +26,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "body": [], "directives": [] } 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 0eca9154c9..4824a8b521 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 @@ -1,80 +1,24 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":1,"end":19,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "yield" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"yield"}, "name": "yield" }, "generator": true, @@ -82,18 +26,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] }, 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 dbee42bd98..4ace3553e7 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 @@ -1,101 +1,34 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:12)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":1,"end":20,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":20}}, "id": null, "generator": true, "async": false, "params": [ { "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "yield" - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] }, 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 74eaaceb98..2f778cc2fe 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 @@ -1,133 +1,43 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:18)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":1,"end":26,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":26}}, "id": null, "generator": true, "async": false, "params": [ { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" }, { "type": "RestElement", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "argument": { "type": "Identifier", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "yield" - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23},"identifierName":"yield"}, "name": "yield" } } ], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json index ec55ac7718..81b4ea1bb5 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-function-declaration/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:25)" ], "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":14,"end":37,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":37}}, "body": [ { "type": "FunctionDeclaration", - "start": 16, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":16,"end":35,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":35}}, "id": { "type": "Identifier", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "yield" - }, + "start":25,"end":30,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":30},"identifierName":"yield"}, "name": "yield" }, "generator": false, @@ -117,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/output.json index e07b84fedd..7f30d12065 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-lexical-declaration/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:20)" ], "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":14,"end":28,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":28}}, "body": [ { "type": "VariableDeclaration", - "start": 16, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":16,"end":26,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":26}}, "declarations": [ { "type": "VariableDeclarator", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "yield" - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"yield"}, "name": "yield" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/output.json index 91b76a6f93..5746a0c95c 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-parameter/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:12)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -68,36 +23,13 @@ "params": [ { "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "yield" - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/output.json index 0b1e59c7ab..aabcbd49fd 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-rest/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:24)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -68,102 +23,32 @@ "params": [ { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "a" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "b" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"b"}, "name": "b" }, { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "c" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"c"}, "name": "c" }, { "type": "RestElement", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "argument": { "type": "Identifier", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "yield" - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29},"identifierName":"yield"}, "name": "yield" } } ], "body": { "type": "BlockStatement", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":30,"end":32,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":32}}, "body": [], "directives": [] } 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 b1b8b4f088..6e1c91ec0f 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (1:46)" ], "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":14,"end":58,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":58}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "g" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -68,94 +23,26 @@ "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":27,"end":58,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":58}}, "body": [ { "type": "VariableDeclaration", - "start": 29, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":29,"end":56,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":56}}, "declarations": [ { "type": "VariableDeclarator", - "start": 33, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":33,"end":55,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":55}}, "id": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "y" - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"y"}, "name": "y" }, "init": { "type": "FunctionExpression", - "start": 37, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":37,"end":55,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":55}}, "id": { "type": "Identifier", - "start": 46, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "yield" - }, + "start":46,"end":51,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":51},"identifierName":"yield"}, "name": "yield" }, "generator": false, @@ -163,18 +50,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 53, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":53,"end":55,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":55}}, "body": [], "directives": [] } @@ -191,32 +67,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 40d206249a..84e6c92063 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (1:47)" ], "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":14,"end":58,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":58}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "g" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -68,115 +23,36 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":28,"end":58,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":58}}, "body": [ { "type": "VariableDeclaration", - "start": 30, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":30,"end":56,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":56}}, "declarations": [ { "type": "VariableDeclarator", - "start": 34, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":34,"end":56,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":56}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "z" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"z"}, "name": "z" }, "init": { "type": "FunctionExpression", - "start": 38, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":38,"end":56,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":56}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 47, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 52 - }, - "identifierName": "yield" - }, + "start":47,"end":52,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":52},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "BlockStatement", - "start": 54, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":54,"end":56,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":56}}, "body": [], "directives": [] } @@ -193,32 +69,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/output.json index 770c2246fa..0dd81b4d0d 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/invalid-yield-generator-variable-declaration/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ "SyntaxError: Can not use 'yield' as identifier inside a generator (1:20)" ], "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":14,"end":28,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":28}}, "body": [ { "type": "VariableDeclaration", - "start": 16, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":16,"end":26,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":26}}, "declarations": [ { "type": "VariableDeclarator", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "yield" - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"yield"}, "name": "yield" }, "init": null 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 4a0cd56645..a662f4e01b 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 @@ -1,115 +1,36 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (1:16)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":14,"end":27,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":27}}, "expression": { "type": "AssignmentExpression", - "start": 15, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":15,"end":26,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":26}}, "operator": "=", "left": { "type": "ArrayPattern", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22}}, "elements": [ { "type": "Identifier", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "yield" - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21},"identifierName":"yield"}, "name": "yield" } ] }, "right": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "x" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"x"}, "name": "x" }, "extra": { @@ -122,32 +43,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 b6b507c9e6..c6814edc8a 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 @@ -1,133 +1,43 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (1:19)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":14,"end":31,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":31}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":14,"end":31,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":31}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24}}, "left": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "x" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"x"}, "name": "x" }, "right": { "type": "Identifier", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "yield" - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24},"identifierName":"yield"}, "name": "yield" } } ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } @@ -137,32 +47,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 3c5b82bd6c..bf2fe84747 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 @@ -1,101 +1,34 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":14,"end":27,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":27}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":14,"end":27,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":27}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "yield" - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "NumericLiteral", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "extra": { "rawValue": 42, "raw": "42" @@ -108,32 +41,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 06d787bb49..c1253768e7 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 @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (1:23)" ], "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 14, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":14,"end":37,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":37}}, "declarations": [ { "type": "VariableDeclarator", - "start": 18, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":18,"end":36,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":36}}, "id": { "type": "ObjectPattern", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "properties": [ { "type": "ObjectProperty", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "method": false, "key": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "yield" - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28},"identifierName":"yield"}, "name": "yield" } } @@ -132,19 +42,7 @@ }, "init": { "type": "Identifier", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "foo" - }, + "start":33,"end":36,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":36},"identifierName":"foo"}, "name": "foo" } } @@ -155,32 +53,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 2b7952b2af..dda9f41982 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 @@ -1,113 +1,35 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (1:28)" ], "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 14, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":14,"end":37,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":37}}, "block": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 21, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":21,"end":37,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":37}}, "param": { "type": "Identifier", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "yield" - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33},"identifierName":"yield"}, "name": "yield" }, "body": { "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":35,"end":37,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":37}}, "body": [], "directives": [] } @@ -118,32 +40,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 f936dc48ab..0d2aafc854 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (1:25)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":14,"end":34,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "f" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -68,36 +23,13 @@ "params": [ { "type": "Identifier", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "yield" - }, + "start":25,"end":30,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":30},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "BlockStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "body": [], "directives": [] } @@ -106,32 +38,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 7f270919a4..5f2d921752 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ "SyntaxError: Binding 'yield' in strict mode (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "yield" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"yield"}, "name": "yield" }, "generator": false, @@ -68,48 +23,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":16,"end":33,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":33}}, "body": [], "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "\"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 d65f41bace..f9eae4038a 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 @@ -1,80 +1,24 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'yield' in strict mode (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":1,"end":34,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "yield" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"yield"}, "name": "yield" }, "generator": false, @@ -82,48 +26,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":17,"end":34,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":34}}, "body": [], "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"use strict\"", 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 0d4e309576..6ea37fe809 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (1:29)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":14,"end":36,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "f" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":27,"end":36,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":36}}, "body": [ { "type": "ExpressionStatement", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":29,"end":34,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":34}}, "expression": { "type": "Identifier", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "yield" - }, + "start":29,"end":34,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":34},"identifierName":"yield"}, "name": "yield" } } @@ -121,32 +42,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 71c86eec82..9a8eac94ac 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 @@ -1,97 +1,30 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (1:18)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "declarations": [ { "type": "VariableDeclarator", - "start": 18, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":18,"end":28,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "yield" - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23},"identifierName":"yield"}, "name": "yield" }, "init": { "type": "NumericLiteral", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "extra": { "rawValue": 42, "raw": "42" @@ -106,32 +39,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 d246bfc86e..2aaef66dea 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (1:28)" ], "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":14,"end":37,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "f" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -68,51 +23,17 @@ "params": [ { "type": "RestElement", - "start": 25, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":25,"end":33,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":33}}, "argument": { "type": "Identifier", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "yield" - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33},"identifierName":"yield"}, "name": "yield" } } ], "body": { "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":35,"end":37,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":37}}, "body": [], "directives": [] } @@ -121,32 +42,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 0561e522bd..5554975e11 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 @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (1:18)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 14, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":14,"end":24,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":24}}, "declarations": [ { "type": "VariableDeclarator", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "yield" - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23},"identifierName":"yield"}, "name": "yield" }, "init": null @@ -87,32 +31,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-array-pattern/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-array-pattern/output.json index d999f3d55f..6f8f572cb3 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-array-pattern/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-array-pattern/output.json @@ -1,112 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "start": 1, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, "operator": "=", "left": { "type": "ArrayPattern", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "elements": [ { "type": "Identifier", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "yield" - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7},"identifierName":"yield"}, "name": "yield" } ] }, "right": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/output.json index cd0cda43de..65930bc7e3 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-concise-body/output.json @@ -1,131 +1,40 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "start": 7, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":7,"end":16,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":16}}, "left": { "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" }, "operator": "*", "right": { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "yield" - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"yield"}, "name": "yield" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-function-body/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-function-body/output.json index 0b9ab0f10a..b4b946f853 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-function-body/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-function-body/output.json @@ -1,160 +1,47 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "z" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"z"}, "name": "z" } ], "body": { "type": "BlockStatement", - "start": 7, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":7,"end":20,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":20}}, "body": [ { "type": "ExpressionStatement", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "expression": { "type": "BinaryExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "left": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "yield" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"yield"}, "name": "yield" }, "operator": "+", "right": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "z" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/output.json index 69a580ede4..6b7cee11c5 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-default/output.json @@ -1,130 +1,40 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, "left": { "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" }, "right": { "type": "Identifier", - "start": 5, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "yield" - }, + "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10},"identifierName":"yield"}, "name": "yield" } } ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/output.json index 9761a349a4..b08def12d4 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-arrow-parameter-name/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "yield" - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-binding-element/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-binding-element/output.json index eb617eadfb..0709ed0ce7 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-binding-element/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-binding-element/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "id": { "type": "ObjectPattern", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "yield" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"yield"}, "name": "yield" } } @@ -129,19 +39,7 @@ }, "init": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "foo" - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"foo"}, "name": "foo" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-binding-property/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-binding-property/output.json index 46407c4550..b352004bc7 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-binding-property/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-binding-property/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "id": { "type": "ObjectPattern", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "yield" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"yield"}, "name": "yield" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"x"}, "name": "x" } } @@ -129,19 +39,7 @@ }, "init": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "foo" - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"foo"}, "name": "foo" } } 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 bcf17d861f..9bdfc13894 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -65,93 +20,25 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":14,"end":30,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":30}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, "expression": { "type": "CallExpression", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":16,"end":27,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":27}}, "callee": { "type": "MemberExpression", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":16,"end":25,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":25}}, "object": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "obj" - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19},"identifierName":"obj"}, "name": "obj" }, "property": { "type": "Identifier", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "yield" - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"yield"}, "name": "yield" }, "computed": false diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-catch-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-catch-parameter/output.json index 1fad434f6a..231f24f357 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-catch-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-catch-parameter/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "block": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 7, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":7,"end":23,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":23}}, "param": { "type": "Identifier", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "yield" - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19},"identifierName":"yield"}, "name": "yield" }, "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-expression-precedence/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-expression-precedence/output.json index 49d3c999d4..a298e396b5 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-expression-precedence/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-expression-precedence/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -65,195 +20,58 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":14,"end":42,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":42}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":16,"end":40,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":40}}, "expression": { "type": "SequenceExpression", - "start": 16, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":16,"end":40,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":40}}, "expressions": [ { "type": "YieldExpression", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":16,"end":25,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":25}}, "delegate": false, "argument": { "type": "AssignmentExpression", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "operator": "=", "left": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "a" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"a"}, "name": "a" }, "right": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "b" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"b"}, "name": "b" } } }, { "type": "YieldExpression", - "start": 27, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":27,"end":37,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":37}}, "delegate": true, "argument": { "type": "AssignmentExpression", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":34,"end":37,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":37}}, "operator": "=", "left": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "c" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"c"}, "name": "c" }, "right": { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "d" - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37},"identifierName":"d"}, "name": "d" } } }, { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "e" - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"e"}, "name": "e" } ] diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/output.json index 572970e4d6..9c5fe29a08 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-declaration-formal-parameter/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,36 +20,13 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "yield" - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-declaration/output.json index 61394aecd8..4a5bbb8bdd 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-declaration/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "yield" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"yield"}, "name": "yield" }, "generator": false, @@ -65,18 +20,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/output.json index 70fedd1827..efa054fe93 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-expression-parameter/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":1,"end":19,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":19}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "yield" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-expression/output.json index 878904bed9..a58725e51e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-function-expression/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":1,"end":19,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "yield" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"yield"}, "name": "yield" }, "generator": false, @@ -79,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/output.json index 5ad3fb7676..b372faa4e2 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-concise-body/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -65,116 +20,36 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":14,"end":35,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":35}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":16,"end":33,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":33}}, "expression": { "type": "ArrowFunctionExpression", - "start": 16, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":16,"end":32,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":32}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"x"}, "name": "x" } ], "body": { "type": "BinaryExpression", - "start": 23, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":23,"end":32,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":32}}, "left": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"x"}, "name": "x" }, "operator": "*", "right": { "type": "Identifier", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "yield" - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32},"identifierName":"yield"}, "name": "yield" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/output.json index c26b779c02..a560dd2c5e 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-default/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Yield cannot be used as name inside a generator function (1:21)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -68,96 +23,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":14,"end":35,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":35}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":16,"end":33,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":33}}, "expression": { "type": "ArrowFunctionExpression", - "start": 16, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":16,"end":33,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":33}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":17,"end":26,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":26}}, "left": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"x"}, "name": "x" }, "right": { "type": "YieldExpression", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26}}, "delegate": false, "argument": null } @@ -165,18 +53,7 @@ ], "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/output.json index fb8baff364..f7986e071a 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-arrow-function-body/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -65,145 +20,43 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":14,"end":39,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":39}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":16,"end":37,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":37}}, "expression": { "type": "ArrowFunctionExpression", - "start": 16, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":16,"end":36,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":36}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "z" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"z"}, "name": "z" } ], "body": { "type": "BlockStatement", - "start": 23, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":23,"end":36,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":36}}, "body": [ { "type": "ExpressionStatement", - "start": 25, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":25,"end":34,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":34}}, "expression": { "type": "BinaryExpression", - "start": 25, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":25,"end":34,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":34}}, "left": { "type": "Identifier", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "yield" - }, + "start":25,"end":30,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":30},"identifierName":"yield"}, "name": "yield" }, "operator": "+", "right": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "z" - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-declaration/output.json index 90c754ee67..03908ae672 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-declaration/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "yield" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"yield"}, "name": "yield" }, "generator": true, @@ -65,18 +20,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-function-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-function-expression/output.json index 0a82a02499..2ed9e26310 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-function-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-function-expression/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -65,94 +20,26 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":13,"end":44,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":44}}, "body": [ { "type": "VariableDeclaration", - "start": 15, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":15,"end":42,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":42}}, "declarations": [ { "type": "VariableDeclarator", - "start": 19, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":19,"end":41,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":41}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "y" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"y"}, "name": "y" }, "init": { "type": "FunctionExpression", - "start": 23, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":23,"end":41,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":41}}, "id": { "type": "Identifier", - "start": 32, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "yield" - }, + "start":32,"end":37,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":37},"identifierName":"yield"}, "name": "yield" }, "generator": false, @@ -160,18 +47,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":39,"end":41,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":41}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/output.json index 4179e6acc5..b20ac0b622 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-function-parameter/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -65,115 +20,36 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":14,"end":44,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":44}}, "body": [ { "type": "VariableDeclaration", - "start": 16, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":16,"end":42,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":42}}, "declarations": [ { "type": "VariableDeclarator", - "start": 20, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":20,"end":42,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":42}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "z" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"z"}, "name": "z" }, "init": { "type": "FunctionExpression", - "start": 24, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":24,"end":42,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":42}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "yield" - }, + "start":33,"end":38,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":38},"identifierName":"yield"}, "name": "yield" } ], "body": { "type": "BlockStatement", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":40,"end":42,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":42}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-method/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-method/output.json index 33f0ac1101..714d9d2b86 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-method/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-method/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":1,"end":16,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":16}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":3,"end":14,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":14}}, "method": true, "key": { "type": "Identifier", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "yield" - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9},"identifierName":"yield"}, "name": "yield" }, "computed": false, @@ -98,18 +31,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/output.json index 7819b0e506..f510232150 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-generator-parameter-object-pattern/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -65,68 +20,22 @@ "params": [ { "type": "ObjectPattern", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":12,"end":22,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectProperty", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21}}, "method": false, "key": { "type": "Identifier", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "yield" - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18},"identifierName":"yield"}, "name": "yield" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "y" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"y"}, "name": "y" } } @@ -135,18 +44,7 @@ ], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/output.json index 2e898291cf..9edf66fdf0 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-lexical-declaration/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "yield" - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9},"identifierName":"yield"}, "name": "yield" }, "init": { "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/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 d73ff4d58e..9d9e642fdf 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -65,94 +20,26 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":14,"end":34,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":34}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":16,"end":32,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":32}}, "expression": { "type": "YieldExpression", - "start": 16, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":16,"end":31,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":31}}, "delegate": false, "argument": { "type": "MemberExpression", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31}}, "object": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "obj" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"obj"}, "name": "obj" }, "property": { "type": "Identifier", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "yield" - }, + "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-method/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-method/output.json index eeee1072ca..504479fdc2 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-method/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-method/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":1,"end":15,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":15}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":3,"end":13,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":13}}, "method": true, "key": { "type": "Identifier", - "start": 3, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "yield" - }, + "start":3,"end":8,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":8},"identifierName":"yield"}, "name": "yield" }, "computed": false, @@ -98,18 +31,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/output.json index 289ebcbb1b..2a587715ca 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-parameter-object-pattern/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,68 +20,22 @@ "params": [ { "type": "ObjectPattern", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21}}, "properties": [ { "type": "ObjectProperty", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "yield" - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17},"identifierName":"yield"}, "name": "yield" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "y" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"y"}, "name": "y" } } @@ -135,18 +44,7 @@ ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-rest-parameter/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-rest-parameter/output.json index 39b07b258e..72490114fd 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-rest-parameter/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-rest-parameter/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,51 +20,17 @@ "params": [ { "type": "RestElement", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19}}, "argument": { "type": "Identifier", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "yield" - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19},"identifierName":"yield"}, "name": "yield" } } ], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [], "directives": [] } 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 643588f065..f0e05e25a5 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 @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 14, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":14,"end":37,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":37}}, "declarations": [ { "type": "VariableDeclarator", - "start": 18, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":18,"end":36,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":36}}, "id": { "type": "ObjectPattern", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "properties": [ { "type": "ObjectProperty", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "method": false, "key": { "type": "Identifier", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "yield" - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"yield"}, "name": "yield" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "x" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"x"}, "name": "x" } } @@ -129,19 +39,7 @@ }, "init": { "type": "Identifier", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "foo" - }, + "start":33,"end":36,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":36},"identifierName":"foo"}, "name": "foo" } } @@ -152,32 +50,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 2fca4d2661..d5baf7a875 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 @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":14,"end":30,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":30}}, "expression": { "type": "ObjectExpression", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":15,"end":29,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":29}}, "properties": [ { "type": "ObjectMethod", - "start": 17, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":17,"end":27,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":27}}, "method": true, "key": { "type": "Identifier", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "yield" - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22},"identifierName":"yield"}, "name": "yield" }, "computed": false, @@ -98,18 +31,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [], "directives": [] } @@ -125,32 +47,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 6e60912b66..88ed22b68d 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 @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"B"}, "name": "B" }, "body": { "type": "ClassBody", - "start": 18, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":18,"end":41,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":41}}, "body": [ { "type": "ClassMethod", - "start": 20, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":20,"end":39,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":39}}, "static": false, "key": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "X" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"X"}, "name": "X" }, "computed": false, @@ -132,77 +41,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":24,"end":39,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":39}}, "body": [ { "type": "ExpressionStatement", - "start": 26, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":26,"end":37,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":37}}, "expression": { "type": "MemberExpression", - "start": 26, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":26,"end":37,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":37}}, "object": { "type": "Super", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}} }, "property": { "type": "Identifier", - "start": 32, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "yield" - }, + "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/es2015-yield/yield-variable-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-variable-declaration/output.json index ed44a5fcd0..d66d1be6b3 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-variable-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-variable-declaration/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "yield" - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9},"identifierName":"yield"}, "name": "yield" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/output.json index 7d36e1025f..674b069a64 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-yield-expression-delegate/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -65,62 +20,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":14,"end":30,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":30}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, "expression": { "type": "YieldExpression", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, "delegate": true, "argument": { "type": "YieldExpression", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "delegate": false, "argument": null } diff --git a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-yield-expression/output.json b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-yield-expression/output.json index aa219449eb..8004ac04b6 100644 --- a/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-yield-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/es2015-yield/yield-yield-expression/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "g" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"g"}, "name": "g" }, "generator": true, @@ -65,62 +20,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":16,"end":27,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":27}}, "expression": { "type": "YieldExpression", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":16,"end":27,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":27}}, "delegate": false, "argument": { "type": "YieldExpression", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27}}, "delegate": false, "argument": null } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-additive/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-additive/migrated_0000/output.json index c2adfba4b5..7d87c8fc6e 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-additive/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-additive/migrated_0000/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-additive/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-additive/migrated_0001/output.json index 13cc3bbdfc..5226c2ebfb 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-additive/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-additive/migrated_0001/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-additive/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-additive/migrated_0002/output.json index 6663391c9d..48c90f6fdb 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-additive/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-additive/migrated_0002/output.json @@ -1,76 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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\"" @@ -80,18 +25,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/fixtures/esprima/expression-assignment/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0000/output.json index a5a52c1e2d..53a8bda384 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0000/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-assignment/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0001/output.json index e1363b4f98..09238f85c9 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0001/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-assignment/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0002/output.json index 9ced89e225..45ca46801c 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0002/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-assignment/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0003/output.json index 4c6da633f9..4305f9c34d 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0003/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-assignment/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0004/output.json index 2ae6136428..ed4728f171 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0004/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-assignment/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0005/output.json index 62a87b6a49..c3f3df7e5f 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0005/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-assignment/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0006/output.json index 987e2eb785..2ccf078c9d 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0006/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-assignment/migrated_0007/output.json b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0007/output.json index 077c01c701..2ba631424d 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0007/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0007/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-assignment/migrated_0008/output.json b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0008/output.json index 9fc98d2128..5d0d198371 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0008/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0008/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-assignment/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0009/output.json index 6cefd83e32..320ab23201 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0009/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-assignment/migrated_0010/output.json b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0010/output.json index c12350d6a4..9c04a76a8e 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0010/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0010/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-assignment/migrated_0011/output.json b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0011/output.json index f97a88dd99..b35bbd4d76 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0011/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0011/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-assignment/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0012/output.json index f12219cdff..cf0974cabc 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0012/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-assignment/migrated_0013/output.json b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0013/output.json index d29652f48f..6141658267 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0013/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-assignment/migrated_0013/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-binary-bitwise/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/output.json index 0782650869..f2ef76b6ef 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary-bitwise/migrated_0000/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/output.json index a036d7feee..d1cc74acf7 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary-bitwise/migrated_0001/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/output.json index 3f0401d051..793dc10c6c 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary-bitwise/migrated_0002/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0000/output.json index ab60eb5ab7..b9a75b550b 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0000/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0001/output.json index beb961a6f0..156e6398fd 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0001/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0002/output.json index c2de2c5ec3..0ece3ff33f 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0002/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0003/output.json index 8ef39b3fcd..ea8daaf85f 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0003/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0004/output.json index c75389bc6c..776f47eea1 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0004/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-binary-logical/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0005/output.json index 0d49dfa5a7..29d1920ab7 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary-logical/migrated_0005/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-binary/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0000/output.json index 12c80600d8..94fc529252 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0000/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0001/output.json index 7a4cb9d5bd..12de61e60e 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0001/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0002/output.json index d95f951f8e..68a6d08d72 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0002/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0003/output.json index 4449ac1fc3..cdaf1460cf 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0003/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0004/output.json index 11b4c83b84..5d60fa9a4f 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0004/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-binary/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0005/output.json index 33ebd32af2..cfb1d7d325 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0005/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-binary/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0006/output.json index c6716f6d5b..e4ad518b49 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0006/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-binary/migrated_0007/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0007/output.json index d7d6a0eb4c..c9172b4c0e 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0007/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0007/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0008/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0008/output.json index 55536bf01e..928ebf4c4c 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0008/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0008/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0009/output.json index b0249f734e..b2def55e60 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0009/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0010/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0010/output.json index 42134f8776..f135242de7 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0010/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0010/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0011/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0011/output.json index 64aa2ad301..ad23fc9dbb 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0011/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0011/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0012/output.json index 8a205f26f6..299c2101fd 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0012/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0013/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0013/output.json index 76106e9d4f..8450ad8b97 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0013/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0013/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0014/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0014/output.json index 19599c7b1c..fb85cecd3e 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0014/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0014/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0015/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0015/output.json index 9e8b8d3fa8..3565086f71 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0015/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0015/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0016/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0016/output.json index c7661fa85d..9d88d7ba1c 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0016/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0016/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-binary/migrated_0017/output.json b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0017/output.json index fcccd1684f..ba82d25b87 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0017/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-binary/migrated_0017/output.json @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-bitwise-shift/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/output.json index a73cf0cf3f..967c39273d 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-bitwise-shift/migrated_0000/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/output.json index 8a2005065f..71da5f24f2 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-bitwise-shift/migrated_0001/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/output.json index 79e6ab49f0..37f18c8f1c 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-bitwise-shift/migrated_0002/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-complex/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-complex/migrated_0000/output.json index fc67569d5b..52f97b4915 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-complex/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-complex/migrated_0000/output.json @@ -1,383 +1,108 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-conditional/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-conditional/migrated_0000/output.json index 9256d55782..6bd9c8a488 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-conditional/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-conditional/migrated_0000/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" @@ -96,18 +29,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/fixtures/esprima/expression-conditional/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-conditional/migrated_0001/output.json index 78cba5d992..73ed52c6a7 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-conditional/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-conditional/migrated_0001/output.json @@ -1,126 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" @@ -129,18 +39,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/fixtures/esprima/expression-conditional/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-conditional/migrated_0002/output.json index e4d9c21387..3701d00385 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-conditional/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-conditional/migrated_0002/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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", @@ -113,18 +35,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" @@ -133,18 +44,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/fixtures/esprima/expression-equality/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-equality/migrated_0000/output.json index 1be43c5d3e..f9d37f650f 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-equality/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-equality/migrated_0000/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-equality/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-equality/migrated_0001/output.json index 7fdf6f8aa3..509a2fa878 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-equality/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-equality/migrated_0001/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-equality/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-equality/migrated_0002/output.json index 4e3733ed6b..910c4ace54 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-equality/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-equality/migrated_0002/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-equality/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/expression-equality/migrated_0003/output.json index d439d193a7..b84db6eff7 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-equality/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-equality/migrated_0003/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-grouping/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-grouping/migrated_0000/output.json index d248e9f318..6911226652 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-grouping/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-grouping/migrated_0000/output.json @@ -1,90 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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", @@ -96,18 +30,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", @@ -120,18 +43,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/fixtures/esprima/expression-grouping/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-grouping/migrated_0001/output.json index 02385c5aac..5b219a39af 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-grouping/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-grouping/migrated_0001/output.json @@ -1,90 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" @@ -94,18 +28,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" @@ -116,18 +39,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/fixtures/esprima/expression-left-hand-side/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0000/output.json index 832564eca4..d0e31b332f 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0000/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-left-hand-side/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0001/output.json index 7bd85bcc02..31c748c495 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0001/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-left-hand-side/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0002/output.json index 8890dbc0a5..b700e71957 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0002/output.json @@ -1,91 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-left-hand-side/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0003/output.json index 74dfc01529..2a305b55c4 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0003/output.json @@ -1,91 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/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 9a7b0d5681..6b3dccf75c 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 @@ -1,124 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": [] }, "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 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 aed252faf1..2a3507d72d 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 @@ -1,108 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 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 0177eead60..3a2644e842 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 @@ -1,108 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 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 2e5825aecf..6dfef381ed 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 @@ -1,105 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": [], @@ -110,19 +32,7 @@ }, "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 diff --git a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0008/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0008/output.json index 38dadd7078..0bbb304c6e 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0008/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0008/output.json @@ -1,112 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/fixtures/esprima/expression-left-hand-side/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0009/output.json index f8bf7daf5b..b86053f12a 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-left-hand-side/migrated_0009/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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/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 82d3e1035a..d55ddd1b61 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 @@ -1,94 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 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 a446cdb8fb..90f241ea29 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 @@ -1,127 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 }, "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 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 cb1cbf606f..6ebb1a398b 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 @@ -1,160 +1,46 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 }, "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 }, "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 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 fbb61eb44b..35c3eaa5e2 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 @@ -1,126 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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" } ] 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 4d221db72d..5ccfa4a76d 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 @@ -1,94 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 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 f3ec5d8857..5fa10d856c 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 @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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" @@ -112,19 +34,7 @@ }, "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 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 a0d7dd6582..5fe9e49343 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 @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" @@ -113,19 +35,7 @@ }, "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 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 3d93d997f9..e7068fd5ca 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 @@ -1,136 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" @@ -141,19 +41,7 @@ }, "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 @@ -161,18 +49,7 @@ "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" @@ -181,18 +58,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" @@ -201,18 +67,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" @@ -223,19 +78,7 @@ }, "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 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 bc3d887ec0..645ac82f55 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 @@ -1,174 +1,49 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 }, "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 }, "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 @@ -176,18 +51,7 @@ "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/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 8e2550dfe5..96d56d51f4 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 @@ -1,94 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 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 88fce0c713..834a12a4eb 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 @@ -1,94 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 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 c40e59d22d..e7664cfc93 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 @@ -1,94 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 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 9739e7a6f3..d9b4c0dd9e 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 @@ -1,94 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" }, "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 diff --git a/packages/babel-parser/test/fixtures/esprima/expression-multiplicative/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-multiplicative/migrated_0000/output.json index d6c2f9a3e0..f90dba3c9c 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-multiplicative/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-multiplicative/migrated_0000/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-multiplicative/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-multiplicative/migrated_0001/output.json index edeb7a67b9..8a3977855d 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-multiplicative/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-multiplicative/migrated_0001/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-multiplicative/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-multiplicative/migrated_0002/output.json index 65b21159bd..7d67196d62 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-multiplicative/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-multiplicative/migrated_0002/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0000/output.json index 603d0ca75c..798e7f2d3c 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0000/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0001/output.json index 0c86ed9cfa..2470e7fd78 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0001/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0002/output.json index acdf9d06a9..87c3e0871f 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0002/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0003/output.json index 16a8b4d997..1798f7e296 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0003/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0004/output.json index 1ae88c0512..6237a6d3dd 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0004/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0005/output.json index f9aca6bfaa..31b78a3ccb 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-postfix/migrated_0005/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0000/output.json index 9446cbbae1..86fa33c5b8 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0000/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0001/output.json index 138fcb2e62..07143b67c9 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0001/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ArrayExpression", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0002/output.json index ef826212c2..ffa484a7df 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0002/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ArrayExpression", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "elements": [ { "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/fixtures/esprima/expression-primary-array/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0003/output.json index d2f456d828..021db7e307 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0003/output.json @@ -1,119 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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": "=", "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": "ArrayExpression", - "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}}, + "extra": { + "trailingComma": 8 }, "elements": [ { "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" }, "value": 42 } - ], - "extra": { - "trailingComma": 8 - } + ] } } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0004/output.json index b0025ea338..207c5b9613 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0004/output.json @@ -1,111 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ArrayExpression", - "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}}, "elements": [ null, null, { "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" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0005/output.json index 0c39b167df..4bc8d58ff2 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0005/output.json @@ -1,109 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ArrayExpression", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, + "extra": { + "trailingComma": 13 }, "elements": [ { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -112,18 +37,7 @@ }, { "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": 2, "raw": "2" @@ -132,28 +46,14 @@ }, { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 3, "raw": "3" }, "value": 3 } - ], - "extra": { - "trailingComma": 13 - } + ] } } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0006/output.json index c2fec5bfcf..48a9251900 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0006/output.json @@ -1,109 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ArrayExpression", - "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}}, + "extra": { + "trailingComma": 14 }, "elements": [ { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -112,18 +37,7 @@ }, { "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": 2, "raw": "2" @@ -133,28 +47,14 @@ null, { "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": 3, "raw": "3" }, "value": 3 } - ], - "extra": { - "trailingComma": 14 - } + ] } } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0007/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0007/output.json index 4a76c9ff39..a51e468a58 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0007/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0007/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "日本語" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"日本語"}, "name": "日本語" }, "right": { "type": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0008/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0008/output.json index 5aa9eb0842..30fa812072 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0008/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0008/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "T‿" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"T‿"}, "name": "T‿" }, "right": { "type": "ArrayExpression", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0009/output.json index d6c768be89..36dc802266 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0009/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "T‌" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"T‌"}, "name": "T‌" }, "right": { "type": "ArrayExpression", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0010/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0010/output.json index ff1dbdcfac..dc4a4b7826 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0010/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0010/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "T‍" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"T‍"}, "name": "T‍" }, "right": { "type": "ArrayExpression", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0011/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0011/output.json index d48fa35f8a..53c0a13b70 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0011/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0011/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "ⅣⅡ" - }, + "start":0,"end":12,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":12},"identifierName":"ⅣⅡ"}, "name": "ⅣⅡ" }, "right": { "type": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/output.json index ea30bc6a30..ba8f74f4e0 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-array/migrated_0012/output.json @@ -1,51 +1,18 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Invalid Unicode escape (1:12)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "Identifier", "start": 0, diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0000/output.json index 3b0df6852f..a1b891f677 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0000/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0001/output.json index 20849b383b..db9c867205 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0001/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0002/output.json index b21e99bf2e..5ad0d74595 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0002/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 3, "raw": "3" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0003/output.json index a10e4151e3..aaeac684c1 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0003/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 5, "raw": "5" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0004/output.json index a5255d5fce..ac4cc54d11 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0004/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0.14, "raw": ".14" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0005/output.json index bcb0e150ed..8f33cfd606 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0005/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3.14159, "raw": "3.14159" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0006/output.json index 85fdb9eb27..34d1f995b4 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0006/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 6.02214179e+23, "raw": "6.02214179e+23" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0007/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0007/output.json index 570feb3f99..782f9c962a 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0007/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0007/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 1.49241783e-10, "raw": "1.492417830e-10" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0008/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0008/output.json index 5dab1af37b..2cbe6c5f22 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0008/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0008/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0x0" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0009/output.json index 2c80770e11..fdd2f3fa3c 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0009/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0x0" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0010/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0010/output.json index 4d36c6d5ce..10e5ffff0e 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0010/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0010/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0e+100" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0011/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0011/output.json index 4d36c6d5ce..10e5ffff0e 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0011/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0011/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0e+100" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0012/output.json index ffa4e3f03d..6155999213 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0012/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 2748, "raw": "0xabc" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0013/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0013/output.json index ca378cfb32..e713c6daf6 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0013/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0013/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3567, "raw": "0xdef" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0014/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0014/output.json index e88d6a6431..273d629674 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0014/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0014/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 26, "raw": "0X1A" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0015/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0015/output.json index da0f5a5a07..b8debd493d 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0015/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0015/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 16, "raw": "0x10" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0016/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0016/output.json index 3aeb059890..d269de6f53 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0016/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0016/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 256, "raw": "0x100" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0017/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0017/output.json index 508faca10f..9bfb038fdb 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0017/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0017/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 4, "raw": "0X04" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0018/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0018/output.json index 32add9ef9d..3e157b067a 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0018/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0018/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 2, "raw": "02" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0019/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0019/output.json index 25cd08d3e7..b173873622 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0019/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0019/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 10, "raw": "012" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0020/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0020/output.json index 3c9b2c223f..ef45bffe39 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0020/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0020/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 10, "raw": "0012" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0021/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0021/output.json index 877e589c14..1d2b07a4bd 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0021/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0021/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 8, "raw": "08" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0022/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0022/output.json index cb6c228619..696c4989aa 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0022/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0022/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 8, "raw": "0008" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0023/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0023/output.json index 22fa47db88..3e85623558 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0023/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0023/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "09" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0024/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0024/output.json index f48f7a7867..922adbe946 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0024/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-numeric/migrated_0024/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 9.5, "raw": "09.5" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0000/output.json index a6d0d7facf..d66077168e 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0000/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "RegExpLiteral", - "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}}, "extra": { "raw": "/p/" }, diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0001/output.json index 1180761953..b5a042c5d4 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0001/output.json @@ -1,77 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "RegExpLiteral", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "extra": { "raw": "/q/" }, diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0002/output.json index edf979f658..b0e0b89e8f 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0002/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "extra": { "raw": "/[a-z]/i" }, diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0003/output.json index 06f89a41d6..4668f70d8d 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0003/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "extra": { "raw": "/[a-z]/y" }, diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0004/output.json index 8c5d9482f1..594b9d2a64 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0004/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "extra": { "raw": "/[a-z]/u" }, diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0007/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0007/output.json index 4ec3778aaf..7330808104 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0007/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0007/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "extra": { "raw": "/[x-z]/i" }, diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0008/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0008/output.json index 7c5bfd0d7d..60a5a8fea2 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0008/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0008/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "extra": { "raw": "/[a-c]/i" }, diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0009/output.json index c79985fcb2..1eea2fed3a 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0009/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17}}, "extra": { "raw": "/[P QR]/i" }, diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0010/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0010/output.json index bc5ceb3e0e..c4e58bd99b 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0010/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0010/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15}}, "extra": { "raw": "/[\\]/]/" }, diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0011/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0011/output.json index abec94d30e..2e5490d094 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0011/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0011/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":4,"end":18,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":8,"end":18,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":18}}, "extra": { "raw": "/foo\\/bar/" }, diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0012/output.json index 311090fd6a..a9e8ee6e33 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/migrated_0012/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":4,"end":21,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":8,"end":21,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":21}}, "extra": { "raw": "/=([^=\\s])+/g" }, 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 1dc2cf3956..031ffabf46 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 @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":4,"end":18,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "MemberExpression", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":8,"end":18,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":18}}, "object": { "type": "RegExpLiteral", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "extra": { "raw": "/42/g" }, @@ -111,19 +33,7 @@ }, "property": { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "test" - }, + "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-regular-expression/u-flag-surrogate-pair/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/u-flag-surrogate-pair/output.json index b94b022ea7..565162df3c 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/u-flag-surrogate-pair/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/u-flag-surrogate-pair/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":4,"end":41,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":41}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":8,"end":41,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":41}}, "extra": { "raw": "/[\\uD834\\uDF06-\\uD834\\uDF08a-z]/u" }, diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/u-flag-valid-range/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/u-flag-valid-range/output.json index 20d499776a..84dbe6b65f 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/u-flag-valid-range/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-literal-regular-expression/u-flag-valid-range/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "program": { "type": "Program", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":4,"end":60,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":60}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":8,"end":60,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":60}}, "extra": { "raw": "/[\\u{61}-b][\\u0061-b][a-\\u{62}][a-\\u0062]\\u{1ffff}/u" }, 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 decc68148f..06adbec3fd 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 @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello", "extra": { "raw": "\"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 13ba3c4eb9..85beda94d4 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 @@ -1,63 +1,19 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "value": { "type": "DirectiveLiteral", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "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\"", 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 d9fbb2b999..4e09c13fd6 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 @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\\\u0061", "extra": { "raw": "\"\\\\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 2b81d94ea7..fb5e0996bf 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 @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\x61", "extra": { "raw": "\"\\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 1668494493..2bc5cf54b2 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 @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\nworld", "extra": { "raw": "\"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 69ff486c62..8bbf441a1b 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 @@ -1,63 +1,19 @@ { "type": "File", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "value": { "type": "DirectiveLiteral", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "value": "Hello\\\nworld", "extra": { "raw": "\"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 f3046102c2..7ba45ecc53 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 @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\02World", "extra": { "raw": "\"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 5f31b1a576..6ff8b0773c 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 @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\012World", "extra": { "raw": "\"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 9656f26c45..43e794894e 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 @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\122World", "extra": { "raw": "\"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 5a8ab1f211..e51d6f3e51 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 @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\0122World", "extra": { "raw": "\"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 e3470fcb4e..4dfa59a362 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 @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\312World", "extra": { "raw": "\"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 04f8c8c1df..f7c0c7ae2f 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 @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\412World", "extra": { "raw": "\"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 88a3f339c1..7ceb0644f6 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 @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\712World", "extra": { "raw": "\"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 d73cfa2bd0..1a8fc198f2 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 @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\0World", "extra": { "raw": "\"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 69ff486c62..8bbf441a1b 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 @@ -1,63 +1,19 @@ { "type": "File", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "value": { "type": "DirectiveLiteral", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "value": "Hello\\\nworld", "extra": { "raw": "\"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 e95ac9779c..b34917f7e6 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 @@ -1,63 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "Hello\\1World", "extra": { "raw": "\"Hello\\1World\"", diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0000/output.json index ace60cd560..b3d6b552a8 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0000/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ObjectExpression", - "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}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0001/output.json index 475c1afc13..dd1feb7b33 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0001/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ObjectExpression", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0002/output.json index 245feff142..e7d5402c92 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0002/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "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": "ObjectExpression", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":4,"end":18,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":18}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":6,"end":16,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "answer" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"answer"}, "name": "answer" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0003/output.json index 87c6c01640..934336937d 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0003/output.json @@ -1,143 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 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": "ObjectExpression", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "if" - }, + "start":6,"end":8,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":8},"identifierName":"if"}, "name": "if" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0004/output.json index 3a19ed468d..923dff08f3 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0004/output.json @@ -1,143 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "true" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"true"}, "name": "true" }, "computed": false, "shorthand": false, "value": { "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/fixtures/esprima/expression-primary-object/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0005/output.json index dbb1747c78..024dcc1726 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0005/output.json @@ -1,143 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "false" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"false"}, "name": "false" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0006/output.json index 2918b16e85..5ee065601e 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0006/output.json @@ -1,143 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "null" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"null"}, "name": "null" }, "computed": false, "shorthand": false, "value": { "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/fixtures/esprima/expression-primary-object/migrated_0007/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0007/output.json index 367eac5310..e5cdd1426d 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0007/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0007/output.json @@ -1,124 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "StringLiteral", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "extra": { "rawValue": "answer", "raw": "\"answer\"" @@ -129,18 +40,7 @@ "shorthand": false, "value": { "type": "NumericLiteral", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0008/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0008/output.json index 81194dadc7..b8f82071b2 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0008/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0008/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "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": "ObjectExpression", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":4,"end":18,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":18}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "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" @@ -147,52 +46,18 @@ }, { "type": "ObjectProperty", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0009/output.json index ea42451525..834b20a1eb 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0009/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":4,"end":38,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":38}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":6,"end":36,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":36}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "width" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"width"}, "name": "width" }, "computed": false, @@ -130,48 +40,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":18,"end":36,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":36}}, "body": [ { "type": "ReturnStatement", - "start": 20, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":20,"end":34,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":34}}, "argument": { "type": "Identifier", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "m_width" - }, + "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34},"identifierName":"m_width"}, "name": "m_width" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0010/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0010/output.json index 9392a4586d..67a3af336f 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0010/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0010/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "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": "ObjectExpression", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":6,"end":20,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "undef" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"undef"}, "name": "undef" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0011/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0011/output.json index 96fd3b7e93..0bd7432907 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0011/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0011/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "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": "ObjectExpression", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "if" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"if"}, "name": "if" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0012/output.json index b3ef7da7ca..dea4eee607 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0012/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":4,"end":21,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":21}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "true" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"true"}, "name": "true" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0013/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0013/output.json index e055a31d00..17909837b8 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0013/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0013/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "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": "ObjectExpression", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":6,"end":20,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "false" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"false"}, "name": "false" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0014/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0014/output.json index 2ba79ca360..ac45a4338b 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0014/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0014/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":4,"end":21,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":21}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "null" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"null"}, "name": "null" }, "computed": false, @@ -130,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0015/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0015/output.json index ea3146a858..4e52a2f943 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0015/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0015/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "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": "ObjectExpression", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":6,"end":22,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":22}}, "method": false, "key": { "type": "StringLiteral", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "extra": { "rawValue": "undef", "raw": "\"undef\"" @@ -133,18 +44,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0016/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0016/output.json index c02bf897d3..620c3d2cc9 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0016/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0016/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "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": "ObjectExpression", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, "method": false, "key": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 10, "raw": "10" @@ -133,18 +44,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0017/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0017/output.json index a15882b52d..6854d518cf 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0017/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0017/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "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": "ObjectExpression", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":6,"end":34,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":34}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "width" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"width"}, "name": "width" }, "computed": false, @@ -130,98 +40,29 @@ "params": [ { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "w" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"w"}, "name": "w" } ], "body": { "type": "BlockStatement", - "start": 19, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":19,"end":34,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":34}}, "body": [ { "type": "ExpressionStatement", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "expression": { "type": "AssignmentExpression", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "operator": "=", "left": { "type": "Identifier", - "start": 21, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "m_width" - }, + "start":21,"end":28,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":28},"identifierName":"m_width"}, "name": "m_width" }, "right": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "w" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"w"}, "name": "w" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0018/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0018/output.json index d672770fbc..c1d2713e76 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0018/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0018/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "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": "ObjectExpression", - "start": 4, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":4,"end":30,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":30}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":6,"end":28,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":28}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "if" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"if"}, "name": "if" }, "computed": false, @@ -130,98 +40,29 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "w" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"w"}, "name": "w" } ], "body": { "type": "BlockStatement", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "expression": { "type": "AssignmentExpression", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "operator": "=", "left": { "type": "Identifier", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "m_if" - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22},"identifierName":"m_if"}, "name": "m_if" }, "right": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "w" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"w"}, "name": "w" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0019/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0019/output.json index 3322d7a98a..daf210e071 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0019/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0019/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "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": "ObjectExpression", - "start": 4, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":4,"end":34,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":34}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":6,"end":32,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":32}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "true" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"true"}, "name": "true" }, "computed": false, @@ -130,98 +40,29 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "w" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"w"}, "name": "w" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "expression": { "type": "AssignmentExpression", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "operator": "=", "left": { "type": "Identifier", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "m_true" - }, + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26},"identifierName":"m_true"}, "name": "m_true" }, "right": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "w" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"w"}, "name": "w" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0020/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0020/output.json index a26b8b4009..c04c402e27 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0020/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0020/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "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": "ObjectExpression", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":6,"end":34,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":34}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "false" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"false"}, "name": "false" }, "computed": false, @@ -130,98 +40,29 @@ "params": [ { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "w" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"w"}, "name": "w" } ], "body": { "type": "BlockStatement", - "start": 19, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":19,"end":34,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":34}}, "body": [ { "type": "ExpressionStatement", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "expression": { "type": "AssignmentExpression", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "operator": "=", "left": { "type": "Identifier", - "start": 21, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "m_false" - }, + "start":21,"end":28,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":28},"identifierName":"m_false"}, "name": "m_false" }, "right": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "w" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"w"}, "name": "w" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0021/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0021/output.json index 96e1bccd51..cb6827eebf 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0021/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0021/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "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": "ObjectExpression", - "start": 4, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":4,"end":34,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":34}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":6,"end":32,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":32}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "null" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"null"}, "name": "null" }, "computed": false, @@ -130,98 +40,29 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "w" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"w"}, "name": "w" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "expression": { "type": "AssignmentExpression", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "operator": "=", "left": { "type": "Identifier", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "m_null" - }, + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26},"identifierName":"m_null"}, "name": "m_null" }, "right": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "w" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"w"}, "name": "w" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0022/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0022/output.json index 2fa4b803dd..185c7ceda3 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0022/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0022/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "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": "ObjectExpression", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":6,"end":34,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":34}}, "method": false, "key": { "type": "StringLiteral", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}}, "extra": { "rawValue": "null", "raw": "\"null\"" @@ -133,98 +44,29 @@ "params": [ { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "w" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"w"}, "name": "w" } ], "body": { "type": "BlockStatement", - "start": 20, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":20,"end":34,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":34}}, "body": [ { "type": "ExpressionStatement", - "start": 22, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":22,"end":32,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":32}}, "expression": { "type": "AssignmentExpression", - "start": 22, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":22,"end":32,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":32}}, "operator": "=", "left": { "type": "Identifier", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "m_null" - }, + "start":22,"end":28,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":28},"identifierName":"m_null"}, "name": "m_null" }, "right": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "w" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"w"}, "name": "w" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0023/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0023/output.json index 21dd434a7a..c7e5a73217 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0023/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0023/output.json @@ -1,124 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":4,"end":32,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":32}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":6,"end":30,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":30}}, "method": false, "key": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 10, "raw": "10" @@ -133,98 +44,29 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "w" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"w"}, "name": "w" } ], "body": { "type": "BlockStatement", - "start": 16, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":16,"end":30,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":30}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":18,"end":28,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":28}}, "expression": { "type": "AssignmentExpression", - "start": 18, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":18,"end":28,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":28}}, "operator": "=", "left": { "type": "Identifier", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "m_null" - }, + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24},"identifierName":"m_null"}, "name": "m_null" }, "right": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "w" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"w"}, "name": "w" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0024/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0024/output.json index 1a0a1b9547..3ae13a3f41 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0024/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0024/output.json @@ -1,143 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "get" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"get"}, "name": "get" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0025/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0025/output.json index 8caddf6f2a..26fa046a12 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0025/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0025/output.json @@ -1,143 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "set" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"set"}, "name": "set" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "extra": { "rawValue": 43, "raw": "43" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0026/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0026/output.json index 52ea78d41c..568a99de63 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0026/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0026/output.json @@ -1,143 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "__proto__" - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0027/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0027/output.json index bf57bae53f..e2a33949ba 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0027/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0027/output.json @@ -1,124 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "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": "ObjectExpression", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":4,"end":21,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":21}}, "properties": [ { "type": "ObjectProperty", - "start": 5, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":5,"end":19,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":19}}, "method": false, "key": { "type": "StringLiteral", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}}, "extra": { "rawValue": "__proto__", "raw": "\"__proto__\"" @@ -129,18 +40,7 @@ "shorthand": false, "value": { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0028/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0028/output.json index e68e602741..f0cd92951d 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0028/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0028/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 77 - } - }, + "start":0,"end":77,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":77}}, "program": { "type": "Program", - "start": 0, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 77 - } - }, + "start":0,"end":77,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":77}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 77 - } - }, + "start":0,"end":77,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":77}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 77 - } - }, + "start":0,"end":77,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":77}}, "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": "ObjectExpression", - "start": 4, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 77 - } - }, + "start":4,"end":77,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":77}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":6,"end":36,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":36}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "width" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"width"}, "name": "width" }, "computed": false, @@ -130,48 +40,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":18,"end":36,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":36}}, "body": [ { "type": "ReturnStatement", - "start": 20, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":20,"end":34,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":34}}, "argument": { "type": "Identifier", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "m_width" - }, + "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34},"identifierName":"m_width"}, "name": "m_width" } } @@ -181,34 +57,11 @@ }, { "type": "ObjectMethod", - "start": 38, - "end": 75, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 75 - } - }, + "start":38,"end":75,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":75}}, "method": false, "key": { "type": "Identifier", - "start": 42, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "width" - }, + "start":42,"end":47,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":47},"identifierName":"width"}, "name": "width" }, "computed": false, @@ -219,98 +72,29 @@ "params": [ { "type": "Identifier", - "start": 48, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 53 - }, - "identifierName": "width" - }, + "start":48,"end":53,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":53},"identifierName":"width"}, "name": "width" } ], "body": { "type": "BlockStatement", - "start": 55, - "end": 75, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 75 - } - }, + "start":55,"end":75,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":75}}, "body": [ { "type": "ExpressionStatement", - "start": 57, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 73 - } - }, + "start":57,"end":73,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":73}}, "expression": { "type": "AssignmentExpression", - "start": 57, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 72 - } - }, + "start":57,"end":72,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":72}}, "operator": "=", "left": { "type": "Identifier", - "start": 57, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 64 - }, - "identifierName": "m_width" - }, + "start":57,"end":64,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":64},"identifierName":"m_width"}, "name": "m_width" }, "right": { "type": "Identifier", - "start": 67, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 67 - }, - "end": { - "line": 1, - "column": 72 - }, - "identifierName": "width" - }, + "start":67,"end":72,"loc":{"start":{"line":1,"column":67},"end":{"line":1,"column":72},"identifierName":"width"}, "name": "width" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0029/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0029/output.json index 157cf63a83..aa4cb1e9c3 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0029/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0029/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":1,"end":23,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":23}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":3,"end":14,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "i" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"i"}, "name": "i" }, "computed": false, @@ -98,70 +31,25 @@ "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "body": [], "directives": [] } }, { "type": "ObjectProperty", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "method": false, "key": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "i" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"i"}, "name": "i" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "extra": { "rawValue": 42, "raw": "42" 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 9000ad9630..2e6287a362 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 @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24}}, "expression": { "type": "AssignmentExpression", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24}}, "operator": "=", "left": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"x"}, "name": "x" }, "right": { "type": "ObjectExpression", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24}}, "properties": [ { "type": "ObjectProperty", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}}, "method": false, "key": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "y" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 1, "raw": "1" @@ -147,52 +46,18 @@ }, { "type": "ObjectProperty", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23}}, "method": false, "key": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "y" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, "extra": { "rawValue": 1, "raw": "1" @@ -208,32 +73,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 7754e9f31d..31e2398fac 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 @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 14, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":14,"end":48,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":48}}, "declarations": [ { "type": "VariableDeclarator", - "start": 18, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":18,"end":48,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":48}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"x"}, "name": "x" }, "init": { "type": "ObjectExpression", - "start": 22, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":22,"end":48,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":48}}, "properties": [ { "type": "ObjectMethod", - "start": 24, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":24,"end":34,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":34}}, "method": false, "key": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "i" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"i"}, "name": "i" }, "computed": false, @@ -130,52 +40,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "body": [], "directives": [] } }, { "type": "ObjectMethod", - "start": 36, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":36,"end":46,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":46}}, "method": false, "key": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "i" - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"i"}, "name": "i" }, "computed": false, @@ -186,18 +62,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":44,"end":46,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":46}}, "body": [], "directives": [] } @@ -212,32 +77,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 d6a2610514..2a1ff4f914 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 @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 14, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":14,"end":43,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":43}}, "declarations": [ { "type": "VariableDeclarator", - "start": 18, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":18,"end":43,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":43}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"x"}, "name": "x" }, "init": { "type": "ObjectExpression", - "start": 22, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":22,"end":43,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":43}}, "properties": [ { "type": "ObjectProperty", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "i" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"i"}, "name": "i" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "extra": { "rawValue": 42, "raw": "42" @@ -147,34 +46,11 @@ }, { "type": "ObjectMethod", - "start": 31, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":31,"end":41,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":41}}, "method": false, "key": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "i" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"i"}, "name": "i" }, "computed": false, @@ -185,18 +61,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":39,"end":41,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":41}}, "body": [], "directives": [] } @@ -211,32 +76,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 93bb4ad695..a912cee466 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 @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 14, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":14,"end":44,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":44}}, "declarations": [ { "type": "VariableDeclarator", - "start": 18, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":18,"end":44,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"x"}, "name": "x" }, "init": { "type": "ObjectExpression", - "start": 22, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":22,"end":44,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":44}}, "properties": [ { "type": "ObjectMethod", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":24,"end":35,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":35}}, "method": false, "key": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "i" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"i"}, "name": "i" }, "computed": false, @@ -130,88 +40,31 @@ "params": [ { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "x" - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"x"}, "name": "x" } ], "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "body": [], "directives": [] } }, { "type": "ObjectProperty", - "start": 37, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":37,"end":42,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":42}}, "method": false, "key": { "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" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":40,"end":42,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":42}}, "extra": { "rawValue": 42, "raw": "42" @@ -229,32 +82,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0034/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0034/output.json index 1dc5a28897..bf72c40e96 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0034/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0034/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, "properties": [ { "type": "ObjectMethod", - "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}}, "method": true, "computed": true, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "a" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, "name": "a" }, "kind": "method", @@ -98,18 +31,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0035/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0035/output.json index 2b50d0f0ae..5b57ca2462 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0035/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0035/output.json @@ -1,129 +1,40 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":1,"end":13,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":13}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":2,"end":12,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":12}}, "method": false, "computed": true, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "a" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, "name": "a" }, "shorthand": false, "value": { "type": "ArrowFunctionExpression", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0036/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0036/output.json index 8ecd159198..a5feee6475 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0036/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0036/output.json @@ -1,93 +1,27 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":2,"end":17,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":17}}, "method": false, "computed": true, "key": { "type": "StringLiteral", - "start": 3, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":3,"end":14,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":14}}, "extra": { "rawValue": "__proto__", "raw": "\"__proto__\"" @@ -97,18 +31,7 @@ "shorthand": false, "value": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -118,34 +41,12 @@ }, { "type": "ObjectProperty", - "start": 19, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":19,"end":34,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":34}}, "method": false, "computed": true, "key": { "type": "StringLiteral", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "extra": { "rawValue": "__proto__", "raw": "\"__proto__\"" @@ -155,18 +56,7 @@ "shorthand": false, "value": { "type": "NumericLiteral", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0037/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0037/output.json index 5fcc5ff585..ae075f3bcd 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0037/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0037/output.json @@ -1,92 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "StringLiteral", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, "extra": { "rawValue": "[", "raw": "\"[\"" @@ -97,18 +31,7 @@ "shorthand": false, "value": { "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/fixtures/esprima/expression-primary-object/migrated_0038/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0038/output.json index 925deed2a0..e7131fb949 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0038/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-object/migrated_0038/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":1,"end":15,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":15}}, "properties": [ { "type": "ObjectMethod", - "start": 2, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":2,"end":14,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -98,49 +31,15 @@ "params": [ { "type": "AssignmentPattern", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "left": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"a"}, "name": "a" }, "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": 0, "raw": "0" @@ -151,18 +50,7 @@ ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0000/output.json index 1cf6441fff..066e563843 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0000/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "ThisExpression", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0001/output.json index 3d18314470..4bb0f76377 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0001/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NullLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0002/output.json index bf57e074cc..ab48d0f9ef 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0002/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":5,"end":7,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "expression": { "type": "NumericLiteral", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":5,"end":7,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0003/output.json index e05c37f126..230f98af8a 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-primary-other/migrated_0003/output.json @@ -1,90 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "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" @@ -94,18 +28,7 @@ "operator": "+", "right": { "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": 2, "raw": "2" @@ -120,18 +43,7 @@ "operator": "*", "right": { "type": "NumericLiteral", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "extra": { "rawValue": 3, "raw": "3" diff --git a/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0000/output.json index da4b728c5e..85ab5afc44 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0000/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0001/output.json index 7e1b9c51b1..b6ecda2e0a 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0001/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0002/output.json index 0fb742510b..75141bc2be 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0002/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0003/output.json index ad8dec06b0..8276ce96fc 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0003/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0004/output.json index bb04fff526..bd09306d3c 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0004/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0005/output.json index 6dc11018bc..e636283e42 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0005/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0006/output.json index 03f750d1df..726d741dfc 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-relational/migrated_0006/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0000/output.json index 620fca4048..2b55f4dc54 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0000/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0001/output.json index 2179523b38..e9b5955636 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0001/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0002/output.json index 82b23bcc25..334ceaff24 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0002/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0003/output.json index 88d60f45c5..d2960c20fb 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0003/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0004/output.json index 15827d1115..00218c0e04 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0004/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0005/output.json index e9f55cbe39..f83d741ef5 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0005/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0006/output.json index fd8b542217..f8707b9018 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0006/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0007/output.json b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0007/output.json index 00936f4b0f..cee848a92a 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0007/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0007/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0008/output.json b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0008/output.json index 533a669dfc..38ba1fbd5d 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0008/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0008/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0009/output.json index b017ac4d4b..37e26f32fe 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0009/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0010/output.json b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0010/output.json index 4a0bf74a8a..eb5d31ccb8 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0010/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0010/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0011/output.json b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0011/output.json index add0b1fc84..96c7f5c024 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0011/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0011/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0012/output.json index db311ef3bb..b42af7e2ff 100644 --- a/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/expression-unary/migrated_0012/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } 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 30ad8a2a05..88942a742b 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 @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "value": "\\x", "extra": { "raw": "\"\\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 91bb0ab97d..f306e9f023 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 @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\x0", "extra": { "raw": "\"\\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 422caf2f1e..c25ed8c834 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 @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\xx", "extra": { "raw": "\"\\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 a00ba8fc77..a9e327e586 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 @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "value": "\\u", "extra": { "raw": "\"\\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 4158fada8f..93cf7ff8ff 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 @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\u0", "extra": { "raw": "\"\\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 b36764ece6..0964301530 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 @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\ux", "extra": { "raw": "\"\\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 b24d044db4..9d296488f0 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 @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\u00", "extra": { "raw": "\"\\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 eb3f631398..667e2055d9 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 @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\u000", "extra": { "raw": "\"\\u000\"", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/output.json index 284fac8c43..b2d2e40318 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0004/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid number (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "3e" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/output.json index 6b6e666b00..1591ec979e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0005/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid number (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "3e+" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/output.json index b52b27d1ef..42c6c5a67a 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0006/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid number (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "3e-" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/output.json index ffcb3680fd..9a1a7ea608 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0009/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 16 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": null, "raw": "0x" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/output.json index 12a024fb2c..a880531bce 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0012/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 8 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": null, "raw": "0o" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/output.json index 5d2ed2d913..91dec1a230 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0013/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 8 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": null, "raw": "0O" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/output.json index 4b91f320f9..42696d4924 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0014/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 8 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0o9" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/output.json index 9978c5342e..9ed93409bc 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0015/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Expected number in radix 8 (1:3)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 8, "raw": "0o18" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/output.json index 0688a297c6..bd3bd49916 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0017/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": null, "raw": "0b" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/output.json index 7281fb745a..fabbead514 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0019/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0b9" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/output.json index 25d711669b..c90afe1734 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0020/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:3)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 2, "raw": "0b18" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/output.json index 379e9db894..2b8e4f22be 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0021/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:3)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 2, "raw": "0b12" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/output.json index c87719ade9..6cfde9edb3 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0022/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": null, "raw": "0B" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/output.json index e82ab6ace6..6e3728ace3 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0024/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0B9" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/output.json index 3726afdc10..d5ba308d59 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0025/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:3)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 2, "raw": "0B18" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/output.json index 402fcffc9e..af38f05f89 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0026/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:3)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 2, "raw": "0B12" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/output.json index af4105738e..2fbc3ece31 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0027/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 8 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 0, "raw": "0O9" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/output.json index 617cc13b66..4978bcf4e5 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0028/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Expected number in radix 8 (1:3)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 8, "raw": "0O18" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/output.json index fbb1d3b5d5..5dd7b5d3fc 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0032/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "xx\\" - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"xx\\"}, "name": "xx\\" } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/output.json index fae32b78cd..d9a89994f0 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0033/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid Unicode escape (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x\\" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"x\\"}, "name": "x\\" } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/output.json index 37312f42ce..32180fcde9 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0034/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid Unicode escape (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x*" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"x*"}, "name": "x*" } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/output.json index 3fa5e0bfd5..f676471df1 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0036/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/output.json index be5c03381d..8bc86d6bda 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0037/output.json @@ -1,51 +1,18 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Bad character escape sequence (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", "start": 0, diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/output.json index 68d637a981..d42d61f8a5 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0041/output.json @@ -1,98 +1,31 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Invalid regular expression flag (1:16)", "SyntaxError: Invalid regular expression flag (1:18)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":4,"end":18,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":8,"end":18,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":18}}, "extra": { "raw": "/[a-z]/\\ux" }, diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/output.json index c4e889cefe..1e07f7e127 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0042/output.json @@ -1,98 +1,31 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid regular expression flag (1:18)", "SyntaxError: Invalid regular expression flag (1:20)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":8,"end":20,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":20}}, "extra": { "raw": "/[a-z\\n]/\\ux" }, diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/output.json index 76ef6d90fe..471a965aa7 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0043/output.json @@ -1,17 +1,6 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Invalid regular expression flag (1:16)", "SyntaxError: Invalid regular expression flag (1:17)", @@ -19,81 +8,25 @@ ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":8,"end":19,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":19}}, "extra": { "raw": "/[a-z]/\\\\ux" }, diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/output.json index 430d18e24e..c783115307 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0044/output.json @@ -1,17 +1,6 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ "SyntaxError: Invalid regular expression flag (1:17)", "SyntaxError: Invalid regular expression flag (1:18)", @@ -22,81 +11,25 @@ ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":4,"end":23,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "RegExpLiteral", - "start": 8, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":8,"end":23,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":23}}, "extra": { "raw": "/[P QR]/\\\\u0067" }, diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json index 99a3e74a04..d4d2cf5dfe 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0045/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "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": 3, "raw": "3" @@ -83,18 +28,7 @@ }, "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": 4, "raw": "4" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json index 8770df4abb..edc3258403 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0046/output.json @@ -1,113 +1,35 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "CallExpression", - "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}}, "callee": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "func" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"func"}, "name": "func" }, "arguments": [] }, "right": { "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": 4, "raw": "4" 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 ec3792255a..46112c6c88 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 @@ -1,95 +1,29 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:1)", "SyntaxError: Invalid left-hand side in assignment expression (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "BinaryExpression", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "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" @@ -99,18 +33,7 @@ "operator": "+", "right": { "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": 1, "raw": "1" @@ -124,18 +47,7 @@ }, "right": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/output.json index 9d206b4f84..53070d6b82 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0049/output.json @@ -1,51 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "Identifier", "start": 0, diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/output.json index 252665de0e..b43e07489e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0050/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "FFF" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"FFF"}, "name": "FFF" } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/output.json index 2c27554ffa..ff97ec8233 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0051/output.json @@ -1,51 +1,18 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Bad character escape sequence (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", "start": 0, diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/output.json index ce2cb3d23d..89b9c579fa 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0052/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in postfix operation (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "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": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/output.json index 57d55fec0b..b0387fd4ff 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0053/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in postfix operation (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "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": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/output.json index 9a7a240c5b..e86e86ca22 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0054/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in prefix operation (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "NumericLiteral", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/output.json index 85107220da..de49f7815b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0055/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in prefix operation (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "NumericLiteral", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "extra": { "rawValue": 1, "raw": "1" 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 6cbd087660..609aed8d62 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 @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid parenthesized assignment pattern (1:5)", "SyntaxError: Invalid left-hand side in for-in statement (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "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}}, "left": { "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": "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": 1, "raw": "1" @@ -84,18 +29,7 @@ "operator": "+", "right": { "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" @@ -109,82 +43,24 @@ }, "right": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "list" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "expression": { "type": "CallExpression", - "start": 21, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":21,"end":31,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":31}}, "callee": { "type": "Identifier", - "start": 21, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "process" - }, + "start":21,"end":28,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":28},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "x" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/output.json index ac910291b7..71a10a5324 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/output.json @@ -1,97 +1,30 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'if' (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "if" - }, + "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6},"identifierName":"if"}, "name": "if" }, "init": { "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" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json index 56547ff7be..62e9955107 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0066/output.json @@ -1,112 +1,34 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "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": "i" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"i"}, "name": "i" }, "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": 2, "raw": "2" @@ -116,18 +38,7 @@ }, "right": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json index ece139488e..ba27c1c609 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0067/output.json @@ -1,114 +1,36 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "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": "i" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"i"}, "name": "i" } }, "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/fixtures/esprima/invalid-syntax/migrated_0075/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0075/output.json index b0ad157582..d704a0cb48 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 @@ -1,114 +1,36 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: setter must have exactly one formal parameter (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":1,"end":16,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":16}}, "properties": [ { "type": "Property", - "start": 3, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":3,"end":14,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":14}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "s" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"s"}, "name": "s" }, "computed": false, "kind": "set", "value": { "type": "FunctionExpression", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}}, "id": null, "generator": false, "async": false, @@ -116,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "body": [] } }, 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 3731ec6d7b..cca401d0d1 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 @@ -1,115 +1,37 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "errors": [ "SyntaxError: Assigning to 'eval' in strict mode (1:15)", "SyntaxError: Binding 'eval' in strict mode (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":14,"end":31,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":31}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":14,"end":31,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":31}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24}}, "left": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "eval" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"eval"}, "name": "eval" }, "right": { "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": 10, "raw": "10" @@ -120,18 +42,7 @@ ], "body": { "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": 42, "raw": "42" @@ -144,32 +55,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 dbffe6547a..8e8d8419af 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 @@ -1,101 +1,34 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:14)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":14,"end":24,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":24}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":14,"end":24,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":24}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "eval" - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"eval"}, "name": "eval" } ], "body": { "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": 42, "raw": "42" @@ -108,32 +41,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 1b3ed15f00..5a18ea14d8 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 @@ -1,101 +1,34 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:14)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "arguments" - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23},"identifierName":"arguments"}, "name": "arguments" } ], "body": { "type": "NumericLiteral", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "extra": { "rawValue": 42, "raw": "42" @@ -108,32 +41,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 6b7ae83c0a..c5a150d343 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 @@ -1,118 +1,39 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:15)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "eval" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"eval"}, "name": "eval" }, { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "a" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"a"}, "name": "a" } ], "body": { "type": "NumericLiteral", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "extra": { "rawValue": 42, "raw": "42" @@ -125,32 +46,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 c681755fb1..402704e9de 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 @@ -1,118 +1,39 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":14,"end":34,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":34}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":14,"end":34,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":34}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "arguments" - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24},"identifierName":"arguments"}, "name": "arguments" }, { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "a" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"a"}, "name": "a" } ], "body": { "type": "NumericLiteral", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "extra": { "rawValue": 42, "raw": "42" @@ -125,32 +46,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/output.json index 78da40f6d8..4cfc4cd77e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0092/output.json @@ -1,118 +1,39 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Argument name clash (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" } ], "body": { "type": "NumericLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": 42, "raw": "42" 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 3a5f60bddd..e552560189 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 @@ -1,118 +1,39 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ "SyntaxError: Argument name clash (1:18)" ], "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "a" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"a"}, "name": "a" } ], "body": { "type": "NumericLiteral", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "extra": { "rawValue": 42, "raw": "42" @@ -125,32 +46,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 18c0889f74..70812a59cc 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 @@ -1,101 +1,34 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:21)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a" } ], "body": { "type": "NumericLiteral", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "extra": { "rawValue": 0, "raw": "00" @@ -108,32 +41,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json index a7c444dfbc..6b624a3ee4 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0098/output.json @@ -1,83 +1,28 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "NumericLiteral", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "extra": { "rawValue": 10, "raw": "10" @@ -87,18 +32,7 @@ ], "body": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": 0, "raw": "00" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json index 2d80f047d2..06d87dffa4 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0099/output.json @@ -1,84 +1,29 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding invalid left-hand side in function parameter list (1:1)", "SyntaxError: Binding invalid left-hand side in function parameter list (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "NumericLiteral", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "extra": { "rawValue": 10, "raw": "10" @@ -87,18 +32,7 @@ }, { "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": 20, "raw": "20" @@ -108,18 +42,7 @@ ], "body": { "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": 0, "raw": "00" 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 49e0835c1b..8515329a04 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 @@ -1,101 +1,34 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "eval" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "NumericLiteral", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "extra": { "rawValue": 42, "raw": "42" @@ -108,32 +41,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 85866aeddd..16f6411a56 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 @@ -1,130 +1,41 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:1)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "eval" - }, + "start":1,"end":5,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":5},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 10, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":10,"end":30,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":30}}, "body": [ { "type": "ExpressionStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "expression": { "type": "NumericLiteral", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "extra": { "rawValue": 42, "raw": "42" @@ -136,32 +47,10 @@ "directives": [ { "type": "Directive", - "start": 12, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":12,"end":25,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":25}}, "value": { "type": "DirectiveLiteral", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/output.json index d3a105c584..8ce94b9605 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0116/output.json @@ -1,51 +1,18 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unsyntactic break (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BreakStatement", - "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}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/output.json index c32c5b0891..6d89822f15 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0118/output.json @@ -1,51 +1,18 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unsyntactic continue (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ContinueStatement", - "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}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/output.json index 3844a4d151..d3af5238b3 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0125/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Invalid left-hand side in for-in statement (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "left": { "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": "i" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"i"}, "name": "i" }, "operator": "+", "right": { "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" @@ -101,34 +34,12 @@ }, "right": { "type": "ObjectExpression", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "properties": [] }, "body": { "type": "EmptyStatement", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/output.json index 9d008175f6..a68f97021f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0126/output.json @@ -1,115 +1,37 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid left-hand side in for-in statement (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "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": "UnaryExpression", - "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}}, "operator": "+", "prefix": true, "argument": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "i" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"i"}, "name": "i" } }, "right": { "type": "ObjectExpression", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "properties": [] }, "body": { "type": "EmptyStatement", - "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}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/output.json index 3d2ee0555b..a0bb1f5c08 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0133/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Missing catch or finally clause (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "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}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/output.json index 237da8c03a..8515bc8f1f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0137/output.json @@ -1,97 +1,30 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid Unicode escape (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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": "=", "left": { "type": "Identifier", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "‿" - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"‿"}, "name": "‿" }, "right": { "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": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/output.json index c273b86361..65a76ea528 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0142/output.json @@ -1,127 +1,38 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Lexical declaration cannot appear in a single-statement context (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "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}}, "test": { "type": "BooleanLiteral", - "start": 3, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":3,"end":7,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":7}}, "value": true }, "consequent": { "type": "VariableDeclaration", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/output.json index c90c4eefdc..322359217c 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0143/output.json @@ -1,100 +1,33 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Multiple default clauses (1:22)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "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}}, "discriminant": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "c" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"c"}, "name": "c" }, "cases": [ { "type": "SwitchCase", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21}}, "consequent": [], "test": null }, { "type": "SwitchCase", - "start": 22, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":22,"end":30,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":30}}, "consequent": [], "test": null } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/output.json index 8644ccf99c..4e21f3ee7b 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0162/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "\\" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"\\"}, "name": "\\" } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/output.json index d44909ca99..6c34e22a00 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0163/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid Unicode escape (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "\\" - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"\\"}, "name": "\\" } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/output.json index 38cc0c05b0..cc7b3b44d6 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0164/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "\\x" - }, + "start":0,"end":2,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":2},"identifierName":"\\x"}, "name": "\\x" } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/output.json index 380e6ec698..3af7d55ae1 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0165/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid Unicode escape (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "\u0000" - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"\u0000"}, "name": "\u0000" } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/output.json index d528d79e32..b79101954c 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0166/output.json @@ -1,97 +1,30 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid Unicode escape (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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": "=", "left": { "type": "Identifier", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "‌" - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"‌"}, "name": "‌" }, "right": { "type": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/output.json index 91544094b6..88eefa8ba7 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0167/output.json @@ -1,97 +1,30 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid Unicode escape (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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": "=", "left": { "type": "Identifier", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "‍" - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"‍"}, "name": "‍" }, "right": { "type": "ArrayExpression", - "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}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/output.json index e43da23745..5875cb58be 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0171/output.json @@ -1,51 +1,18 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: 'return' outside of function (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ReturnStatement", - "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}}, "argument": null } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/output.json index d3a105c584..8ce94b9605 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0172/output.json @@ -1,51 +1,18 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unsyntactic break (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BreakStatement", - "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}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/output.json index c32c5b0891..6d89822f15 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0173/output.json @@ -1,51 +1,18 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unsyntactic continue (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ContinueStatement", - "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}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/output.json index b83145faf5..37451db0ed 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0174/output.json @@ -1,98 +1,31 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ "SyntaxError: Unsyntactic continue (1:22)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "discriminant": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, "cases": [ { "type": "SwitchCase", - "start": 13, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":13,"end":31,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":31}}, "consequent": [ { "type": "ContinueStatement", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/output.json index a7c8d4f9a0..ae9cb401dd 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0176/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ "SyntaxError: Unsyntactic break (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":13,"end":25,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":25}}, "body": [ { "type": "BreakStatement", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "label": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/output.json index 2f1c8737b2..39c5663443 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0177/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ "SyntaxError: Unsyntactic continue (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":13,"end":28,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":28}}, "body": [ { "type": "ContinueStatement", - "start": 15, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":15,"end":26,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":26}}, "label": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"x"}, "name": "x" } } 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 7337acd3e8..3939133b3b 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 @@ -1,172 +1,50 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ "SyntaxError: Unsyntactic break (1:33)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "body": { "type": "WhileStatement", - "start": 3, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":3,"end":47,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":47}}, "test": { "type": "BooleanLiteral", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": true }, "body": { "type": "BlockStatement", - "start": 16, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":16,"end":47,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":47}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":18,"end":45,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":45}}, "expression": { "type": "FunctionExpression", - "start": 19, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":19,"end":43,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":43}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 31, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":31,"end":43,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":43}}, "body": [ { "type": "BreakStatement", - "start": 33, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":33,"end":41,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":41}}, "label": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "x" - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"x"}, "name": "x" } } @@ -185,19 +63,7 @@ }, "label": { "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" } } 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 18bc9b977c..d65c7f7da9 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 @@ -1,172 +1,50 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ "SyntaxError: Unsyntactic continue (1:33)" ], "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "body": { "type": "WhileStatement", - "start": 3, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":3,"end":50,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":50}}, "test": { "type": "BooleanLiteral", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": true }, "body": { "type": "BlockStatement", - "start": 16, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":16,"end":50,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":50}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":18,"end":48,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":48}}, "expression": { "type": "FunctionExpression", - "start": 19, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":19,"end":46,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":46}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [ { "type": "ContinueStatement", - "start": 33, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":33,"end":44,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":44}}, "label": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "x" - }, + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"x"}, "name": "x" } } @@ -185,19 +63,7 @@ }, "label": { "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" } } 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 59ae007d6f..336add4fe3 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 @@ -1,157 +1,47 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unsyntactic break (1:33)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "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}}, "body": { "type": "WhileStatement", - "start": 3, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":3,"end":45,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":45}}, "test": { "type": "BooleanLiteral", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": true }, "body": { "type": "BlockStatement", - "start": 16, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":16,"end":45,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":45}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":18,"end":43,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":43}}, "expression": { "type": "FunctionExpression", - "start": 19, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":19,"end":41,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":41}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 31, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":31,"end":41,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":41}}, "body": [ { "type": "BreakStatement", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":33,"end":39,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":39}}, "label": null } ], @@ -169,19 +59,7 @@ }, "label": { "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" } } 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 d26e37b080..ac86039c65 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 @@ -1,157 +1,47 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "errors": [ "SyntaxError: Unsyntactic continue (1:33)" ], "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "body": { "type": "WhileStatement", - "start": 3, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":3,"end":48,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":48}}, "test": { "type": "BooleanLiteral", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": true }, "body": { "type": "BlockStatement", - "start": 16, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":16,"end":48,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":48}}, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "FunctionExpression", - "start": 19, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":19,"end":44,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":44}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 31, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":31,"end":44,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":44}}, "body": [ { "type": "ContinueStatement", - "start": 33, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":33,"end":42,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":42}}, "label": null } ], @@ -169,19 +59,7 @@ }, "label": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/output.json index 3025d6bfbf..815a430cb2 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0182/output.json @@ -1,173 +1,51 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Label 'x' is already declared (1:18)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "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}}, "body": { "type": "WhileStatement", - "start": 3, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":3,"end":39,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":39}}, "test": { "type": "BooleanLiteral", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": true }, "body": { "type": "BlockStatement", - "start": 16, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":16,"end":39,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":39}}, "body": [ { "type": "LabeledStatement", - "start": 18, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":18,"end":37,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":37}}, "body": { "type": "WhileStatement", - "start": 21, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":21,"end":37,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":37}}, "test": { "type": "BooleanLiteral", - "start": 28, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":28,"end":32,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":32}}, "value": true }, "body": { "type": "BlockStatement", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":34,"end":37,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":37}}, "body": [], "directives": [] } }, "label": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"x"}, "name": "x" } } @@ -177,19 +55,7 @@ }, "label": { "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" } } 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 f22f0efb06..392c525509 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 @@ -1,143 +1,43 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ "SyntaxError: Deleting local variable in strict mode (1:29)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, "callee": { "type": "FunctionExpression", - "start": 1, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":13,"end":40,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":40}}, "body": [ { "type": "ExpressionStatement", - "start": 29, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":29,"end":38,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":38}}, "expression": { "type": "UnaryExpression", - "start": 29, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":29,"end":37,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":37}}, "operator": "delete", "prefix": true, "argument": { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "i" - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37},"identifierName":"i"}, "name": "i" } } @@ -146,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "value": { "type": "DirectiveLiteral", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "value": "use strict", "extra": { "raw": "'use strict'", 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 1567b18881..62cf67d34e 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 @@ -1,175 +1,53 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ "SyntaxError: 'with' in strict mode (1:29)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, "callee": { "type": "FunctionExpression", - "start": 1, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":40}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":13,"end":40,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":40}}, "body": [ { "type": "WithStatement", - "start": 29, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":29,"end":38,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":38}}, "object": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "i" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"i"}, "name": "i" }, "body": { "type": "EmptyStatement", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - } - } + "start":37,"end":38,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":38}} } } ], "directives": [ { "type": "Directive", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "value": { "type": "DirectiveLiteral", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "value": "use strict", "extra": { "raw": "'use strict'", 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 7598b7431e..fcd0ab9858 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:36)" ], "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,79 +23,23 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":17,"end":48,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":48}}, "body": [ { "type": "VariableDeclaration", - "start": 32, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":32,"end":46,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":46}}, "declarations": [ { "type": "VariableDeclarator", - "start": 36, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":36,"end":45,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":45}}, "id": { "type": "Identifier", - "start": 36, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "eval" - }, + "start":36,"end":40,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":40},"identifierName":"eval"}, "name": "eval" }, "init": { "type": "NumericLiteral", - "start": 43, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":43,"end":45,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":45}}, "extra": { "rawValue": 10, "raw": "10" @@ -155,32 +54,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 7101109189..d557326e99 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:36)" ], "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,79 +23,23 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":17,"end":53,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":53}}, "body": [ { "type": "VariableDeclaration", - "start": 32, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":32,"end":51,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":51}}, "declarations": [ { "type": "VariableDeclarator", - "start": 36, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":36,"end":50,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":50}}, "id": { "type": "Identifier", - "start": 36, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "arguments" - }, + "start":36,"end":45,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":45},"identifierName":"arguments"}, "name": "arguments" }, "init": { "type": "NumericLiteral", - "start": 48, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":48,"end":50,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":50}}, "extra": { "rawValue": 10, "raw": "10" @@ -155,32 +54,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 dd5fca85f2..3040718fd5 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:47)" ], "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,95 +23,28 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":17,"end":58,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":58}}, "body": [ { "type": "TryStatement", - "start": 32, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":32,"end":56,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":56}}, "block": { "type": "BlockStatement", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":36,"end":39,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":39}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 40, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":40,"end":56,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":56}}, "param": { "type": "Identifier", - "start": 47, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "eval" - }, + "start":47,"end":51,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":51},"identifierName":"eval"}, "name": "eval" }, "body": { "type": "BlockStatement", - "start": 53, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":53,"end":56,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":56}}, "body": [], "directives": [] } @@ -167,32 +55,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 3b89f63424..429d686ed4 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:47)" ], "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,95 +23,28 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":17,"end":63,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":63}}, "body": [ { "type": "TryStatement", - "start": 32, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":32,"end":61,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":61}}, "block": { "type": "BlockStatement", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":36,"end":39,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":39}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 40, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":40,"end":61,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":61}}, "param": { "type": "Identifier", - "start": 47, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 56 - }, - "identifierName": "arguments" - }, + "start":47,"end":56,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":56},"identifierName":"arguments"}, "name": "arguments" }, "body": { "type": "BlockStatement", - "start": 58, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 58 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":58,"end":61,"loc":{"start":{"line":1,"column":58},"end":{"line":1,"column":61}}, "body": [], "directives": [] } @@ -167,32 +55,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 2973f35176..79c71ebb54 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "errors": [ "SyntaxError: Assigning to 'eval' in strict mode (1:32)" ], "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,79 +23,23 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":17,"end":44,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":44}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":32,"end":42,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":42}}, "expression": { "type": "AssignmentExpression", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":32,"end":41,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":41}}, "operator": "=", "left": { "type": "Identifier", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "eval" - }, + "start":32,"end":36,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":36},"identifierName":"eval"}, "name": "eval" }, "right": { "type": "NumericLiteral", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":39,"end":41,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":41}}, "extra": { "rawValue": 10, "raw": "10" @@ -153,32 +52,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 e328a1e98e..ec34fa9d5c 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ "SyntaxError: Assigning to 'arguments' in strict mode (1:32)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,79 +23,23 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":17,"end":49,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":49}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":32,"end":47,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":47}}, "expression": { "type": "AssignmentExpression", - "start": 32, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":32,"end":46,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":46}}, "operator": "=", "left": { "type": "Identifier", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "arguments" - }, + "start":32,"end":41,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":41},"identifierName":"arguments"}, "name": "arguments" }, "right": { "type": "NumericLiteral", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":44,"end":46,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":46}}, "extra": { "rawValue": 10, "raw": "10" @@ -153,32 +52,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 95091e6536..2ad9422223 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'eval' in strict mode (1:34)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":17,"end":41,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":41}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":32,"end":39,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":39}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}}, "operator": "++", "prefix": true, "argument": { "type": "Identifier", - "start": 34, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "eval" - }, + "start":34,"end":38,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":38},"identifierName":"eval"}, "name": "eval" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 8473055a41..c85c53c215 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'eval' in strict mode (1:34)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":17,"end":41,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":41}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":32,"end":39,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":39}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}}, "operator": "--", "prefix": true, "argument": { "type": "Identifier", - "start": 34, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "eval" - }, + "start":34,"end":38,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":38},"identifierName":"eval"}, "name": "eval" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 c997493244..8635017ed5 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'arguments' in strict mode (1:34)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":17,"end":46,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":46}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":32,"end":44,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":44}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":32,"end":43,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":43}}, "operator": "++", "prefix": true, "argument": { "type": "Identifier", - "start": 34, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "arguments" - }, + "start":34,"end":43,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":43},"identifierName":"arguments"}, "name": "arguments" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 cf31420c53..0090b60112 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'arguments' in strict mode (1:34)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":17,"end":46,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":46}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":32,"end":44,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":44}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":32,"end":43,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":43}}, "operator": "--", "prefix": true, "argument": { "type": "Identifier", - "start": 34, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "arguments" - }, + "start":34,"end":43,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":43},"identifierName":"arguments"}, "name": "arguments" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 59618c91e2..439436ef7e 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'eval' in strict mode (1:32)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":17,"end":41,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":41}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":32,"end":39,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":39}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}}, "operator": "++", "prefix": false, "argument": { "type": "Identifier", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "eval" - }, + "start":32,"end":36,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":36},"identifierName":"eval"}, "name": "eval" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 0b6b047c7b..b68c731a58 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'eval' in strict mode (1:32)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":17,"end":41,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":41}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":32,"end":39,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":39}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}}, "operator": "--", "prefix": false, "argument": { "type": "Identifier", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "eval" - }, + "start":32,"end":36,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":36},"identifierName":"eval"}, "name": "eval" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 64f2c09fd9..52dbdc3d5c 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'arguments' in strict mode (1:32)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":17,"end":46,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":46}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":32,"end":44,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":44}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":32,"end":43,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":43}}, "operator": "++", "prefix": false, "argument": { "type": "Identifier", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "arguments" - }, + "start":32,"end":41,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":41},"identifierName":"arguments"}, "name": "arguments" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 34c1b59c4e..48c2df5468 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Assigning to 'arguments' in strict mode (1:32)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,64 +23,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":17,"end":46,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":46}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":32,"end":44,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":44}}, "expression": { "type": "UpdateExpression", - "start": 32, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":32,"end":43,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":43}}, "operator": "--", "prefix": false, "argument": { "type": "Identifier", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "arguments" - }, + "start":32,"end":41,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":41},"identifierName":"arguments"}, "name": "arguments" } } @@ -134,32 +44,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 35af060b7c..3c4ac7fd38 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:41)" ], "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":17,"end":53,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":53}}, "body": [ { "type": "FunctionDeclaration", - "start": 32, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":32,"end":51,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":51}}, "id": { "type": "Identifier", - "start": 41, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "eval" - }, + "start":41,"end":45,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":45},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -117,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":48,"end":51,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":51}}, "body": [], "directives": [] } @@ -137,32 +47,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 7419ba446d..e183294a23 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:41)" ], "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":17,"end":58,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":58}}, "body": [ { "type": "FunctionDeclaration", - "start": 32, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":32,"end":56,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":56}}, "id": { "type": "Identifier", - "start": 41, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 50 - }, - "identifierName": "arguments" - }, + "start":41,"end":50,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":50},"identifierName":"arguments"}, "name": "arguments" }, "generator": false, @@ -117,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 53, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":53,"end":56,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":56}}, "body": [], "directives": [] } @@ -137,32 +47,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 ede15490b6..c252adad5c 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "eval" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -68,48 +23,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":16,"end":32,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":32}}, "body": [], "directives": [ { "type": "Directive", - "start": 17, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":17,"end":30,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":30}}, "value": { "type": "DirectiveLiteral", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":17,"end":29,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":29}}, "value": "use strict", "extra": { "raw": "'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 aeccd1a07e..2c691b4f70 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "arguments" - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18},"identifierName":"arguments"}, "name": "arguments" }, "generator": false, @@ -68,48 +23,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":21,"end":37,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":37}}, "body": [], "directives": [ { "type": "Directive", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":22,"end":35,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":35}}, "value": { "type": "DirectiveLiteral", - "start": 22, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, "value": "use strict", "extra": { "raw": "'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 4e8af9c85d..9e3046fe27 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:42)" ], "program": { "type": "Program", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,76 +23,20 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":17,"end":57,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":57}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":32,"end":55,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":55}}, "expression": { "type": "CallExpression", - "start": 33, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":33,"end":54,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":54}}, "callee": { "type": "FunctionExpression", - "start": 33, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, "id": { "type": "Identifier", - "start": 42, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "eval" - }, + "start":42,"end":46,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":46},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -145,18 +44,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":49,"end":52,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":52}}, "body": [], "directives": [] } @@ -172,32 +60,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 49a2e0086f..2502c52e18 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:42)" ], "program": { "type": "Program", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,76 +23,20 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":17,"end":62,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":62}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":32,"end":60,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":60}}, "expression": { "type": "CallExpression", - "start": 33, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, "callee": { "type": "FunctionExpression", - "start": 33, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":33,"end":57,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":57}}, "id": { "type": "Identifier", - "start": 42, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "arguments" - }, + "start":42,"end":51,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":51},"identifierName":"arguments"}, "name": "arguments" }, "generator": false, @@ -145,18 +44,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 54, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":54,"end":57,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":57}}, "body": [], "directives": [] } @@ -172,32 +60,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 6d1387258a..887c411495 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 @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "callee": { "type": "FunctionExpression", - "start": 1, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "eval" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -96,48 +29,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":17,"end":33,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":33}}, "body": [], "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'use strict'", 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 d3b5c36283..250afef7d8 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 @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "FunctionExpression", - "start": 1, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, "id": { "type": "Identifier", - "start": 10, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "arguments" - }, + "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19},"identifierName":"arguments"}, "name": "arguments" }, "generator": false, @@ -96,48 +29,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 22, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":22,"end":38,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":38}}, "body": [], "directives": [ { "type": "Directive", - "start": 23, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":23,"end":36,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":36}}, "value": { "type": "DirectiveLiteral", - "start": 23, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, "value": "use strict", "extra": { "raw": "'use strict'", 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 d0eb8e29b2..03985eff0b 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:47)" ], "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,111 +23,32 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":17,"end":63,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":63}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":32,"end":61,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":61}}, "expression": { "type": "ObjectExpression", - "start": 33, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, "properties": [ { "type": "ObjectProperty", - "start": 35, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":35,"end":57,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":57}}, "method": false, "key": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "s" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"s"}, "name": "s" }, "computed": false, "shorthand": false, "value": { "type": "FunctionExpression", - "start": 38, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":38,"end":57,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":57}}, "id": { "type": "Identifier", - "start": 47, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "eval" - }, + "start":47,"end":51,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":51},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -180,18 +56,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 54, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":54,"end":57,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":57}}, "body": [], "directives": [] } @@ -208,32 +73,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 d651009493..29ce013f0b 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 @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'package' in strict mode (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "FunctionExpression", - "start": 1, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":1,"end":36,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "package" - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17},"identifierName":"package"}, "name": "package" }, "generator": false, @@ -96,48 +29,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":20,"end":36,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":36}}, "body": [], "directives": [ { "type": "Directive", - "start": 21, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":21,"end":34,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":34}}, "value": { "type": "DirectiveLiteral", - "start": 21, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, "value": "use strict", "extra": { "raw": "'use strict'", 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 98e0968778..60d4df26f9 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:48)" ], "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,96 +23,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":17,"end":63,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":63}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":32,"end":61,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":61}}, "expression": { "type": "ObjectExpression", - "start": 33, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":33,"end":59,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":59}}, "properties": [ { "type": "ObjectProperty", - "start": 35, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":35,"end":40,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":40}}, "method": false, "key": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "i" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"i"}, "name": "i" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":38,"end":40,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":40}}, "extra": { "rawValue": 10, "raw": "10" @@ -167,34 +55,11 @@ }, { "type": "ObjectMethod", - "start": 42, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":42,"end":57,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":57}}, "method": false, "key": { "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "s" - }, + "start":46,"end":47,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":47},"identifierName":"s"}, "name": "s" }, "computed": false, @@ -205,36 +70,13 @@ "params": [ { "type": "Identifier", - "start": 48, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 52 - }, - "identifierName": "eval" - }, + "start":48,"end":52,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":52},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 54, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":54,"end":57,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":57}}, "body": [], "directives": [] } @@ -250,32 +92,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 f974d83f5a..4ee83b1402 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:41)" ], "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,78 +23,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":17,"end":56,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":56}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":32,"end":54,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":54}}, "expression": { "type": "ObjectExpression", - "start": 33, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, "properties": [ { "type": "ObjectMethod", - "start": 35, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":35,"end":50,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":50}}, "method": false, "key": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "s" - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"s"}, "name": "s" }, "computed": false, @@ -150,36 +49,13 @@ "params": [ { "type": "Identifier", - "start": 41, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "eval" - }, + "start":41,"end":45,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":45},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":47,"end":50,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":50}}, "body": [], "directives": [] } @@ -195,32 +71,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 2993cf6488..0c8905156a 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:49)" ], "program": { "type": "Program", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,111 +23,32 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":17,"end":64,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":64}}, "body": [ { "type": "ExpressionStatement", - "start": 32, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":32,"end":62,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":62}}, "expression": { "type": "ObjectExpression", - "start": 33, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":33,"end":60,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":60}}, "properties": [ { "type": "ObjectProperty", - "start": 35, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":35,"end":58,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":58}}, "method": false, "key": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "s" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"s"}, "name": "s" }, "computed": false, "shorthand": false, "value": { "type": "FunctionExpression", - "start": 38, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":38,"end":58,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":58}}, "id": { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "s" - }, + "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48},"identifierName":"s"}, "name": "s" }, "generator": false, @@ -180,36 +56,13 @@ "params": [ { "type": "Identifier", - "start": 49, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 53 - }, - "identifierName": "eval" - }, + "start":49,"end":53,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":53},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 55, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":55,"end":58,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":58}}, "body": [], "directives": [] } @@ -226,32 +79,10 @@ "directives": [ { "type": "Directive", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "value": { "type": "DirectiveLiteral", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "value": "use strict", "extra": { "raw": "'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 4534376b27..3ccaace1b1 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,66 +23,21 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "eval" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 21, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":21,"end":36,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":36}}, "body": [], "directives": [ { "type": "Directive", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":22,"end":35,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":35}}, "value": { "type": "DirectiveLiteral", - "start": 22, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, "value": "use strict", "extra": { "raw": "'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 cb41c27834..dc142e7610 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:15)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,66 +23,21 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "arguments" - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24},"identifierName":"arguments"}, "name": "arguments" } ], "body": { "type": "BlockStatement", - "start": 26, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":26,"end":41,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":41}}, "body": [], "directives": [ { "type": "Directive", - "start": 27, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":27,"end":40,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":40}}, "value": { "type": "DirectiveLiteral", - "start": 27, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":27,"end":39,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":39}}, "value": "use strict", "extra": { "raw": "'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 d8df2c1c2d..d887db53f5 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:48)" ], "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":17,"end":58,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":58}}, "body": [ { "type": "FunctionDeclaration", - "start": 33, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":33,"end":56,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":56}}, "id": { "type": "Identifier", - "start": 42, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "inner" - }, + "start":42,"end":47,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":47},"identifierName":"inner"}, "name": "inner" }, "generator": false, @@ -117,36 +38,13 @@ "params": [ { "type": "Identifier", - "start": 48, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 52 - }, - "identifierName": "eval" - }, + "start":48,"end":52,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":52},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 54, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":54,"end":56,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":56}}, "body": [], "directives": [] } @@ -155,32 +53,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "'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 a2fc6cb4db..ded1814137 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:48)" ], "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":17,"end":63,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":63}}, "body": [ { "type": "FunctionDeclaration", - "start": 33, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":33,"end":61,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":61}}, "id": { "type": "Identifier", - "start": 42, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "inner" - }, + "start":42,"end":47,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":47},"identifierName":"inner"}, "name": "inner" }, "generator": false, @@ -117,36 +38,13 @@ "params": [ { "type": "Identifier", - "start": 48, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 57 - }, - "identifierName": "arguments" - }, + "start":48,"end":57,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":57},"identifierName":"arguments"}, "name": "arguments" } ], "body": { "type": "BlockStatement", - "start": 59, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 59 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":59,"end":61,"loc":{"start":{"line":1,"column":59},"end":{"line":1,"column":61}}, "body": [], "directives": [] } @@ -155,32 +53,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "'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 f2a0068be6..7d00761d55 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 @@ -1,66 +1,22 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:2)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "value": "\\1", "extra": { "raw": "\"\\1\"", @@ -70,32 +26,10 @@ }, { "type": "Directive", - "start": 6, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}}, "value": { "type": "DirectiveLiteral", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, "value": "use strict", "extra": { "raw": "'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 4f1229be25..a7ce0eaeba 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:35)" ], "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,48 +23,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":17,"end":40,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":40}}, "body": [], "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "'use strict'", @@ -119,32 +41,10 @@ }, { "type": "Directive", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":33,"end":38,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":38}}, "value": { "type": "DirectiveLiteral", - "start": 33, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37}}, "value": "\\1", "extra": { "raw": "\"\\1\"", @@ -158,4 +58,4 @@ ], "directives": [] } -} +} \ No newline at end of file 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 343c7244d1..f4096149d8 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:33)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,47 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":17,"end":39,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":39}}, "body": [ { "type": "ExpressionStatement", - "start": 33, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37}}, "expression": { "type": "NumericLiteral", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":33,"end":36,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":36}}, "extra": { "rawValue": 17, "raw": "021" @@ -120,32 +42,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "'use strict'", @@ -159,4 +59,4 @@ ], "directives": [] } -} +} \ No newline at end of file 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 6d3d9feff3..2c29a7df14 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:38)" ], "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,77 +23,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":17,"end":50,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":50}}, "body": [ { "type": "ExpressionStatement", - "start": 33, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":33,"end":48,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":48}}, "expression": { "type": "ObjectExpression", - "start": 34, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":34,"end":46,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":46}}, "properties": [ { "type": "ObjectProperty", - "start": 36, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":36,"end":44,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":44}}, "method": false, "key": { "type": "StringLiteral", - "start": 36, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":36,"end":40,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":40}}, "extra": { "rawValue": "\u0001", "raw": "\"\\1\"" @@ -149,18 +49,7 @@ "shorthand": false, "value": { "type": "NumericLiteral", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":42,"end":44,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":44}}, "extra": { "rawValue": 42, "raw": "42" @@ -179,32 +68,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "'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 5eb3bcef0b..8caf22da60 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:36)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,77 +23,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":17,"end":49,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":49}}, "body": [ { "type": "ExpressionStatement", - "start": 33, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":33,"end":47,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":47}}, "expression": { "type": "ObjectExpression", - "start": 34, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":34,"end":45,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":45}}, "properties": [ { "type": "ObjectProperty", - "start": 36, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":36,"end":43,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":43}}, "method": false, "key": { "type": "NumericLiteral", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":36,"end":39,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":39}}, "extra": { "rawValue": 17, "raw": "021" @@ -149,18 +49,7 @@ "shorthand": false, "value": { "type": "NumericLiteral", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":41,"end":43,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":43}}, "extra": { "rawValue": 42, "raw": "42" @@ -179,32 +68,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "'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 05630566bf..13226ad500 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:36)" ], "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,48 +23,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":17,"end":55,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":55}}, "body": [], "directives": [ { "type": "Directive", - "start": 19, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":19,"end":39,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":39}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":19,"end":38,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":38}}, "value": "octal directive\\1", "extra": { "raw": "\"octal directive\\1\"", @@ -119,32 +41,10 @@ }, { "type": "Directive", - "start": 40, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":40,"end":53,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":53}}, "value": { "type": "DirectiveLiteral", - "start": 40, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":40,"end":52,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":52}}, "value": "use strict", "extra": { "raw": "\"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 abebf79057..43d10e2912 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 @@ -1,67 +1,22 @@ { "type": "File", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 76 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":76}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:36)", "SyntaxError: Legacy octal literals are not allowed in strict mode (1:57)" ], "program": { "type": "Program", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 76 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":76}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 76 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":76}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -69,48 +24,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 76 - } - }, + "start":17,"end":76,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":76}}, "body": [], "directives": [ { "type": "Directive", - "start": 19, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":19,"end":39,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":39}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":19,"end":38,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":38}}, "value": "octal directive\\1", "extra": { "raw": "\"octal directive\\1\"", @@ -120,32 +42,10 @@ }, { "type": "Directive", - "start": 40, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":40,"end":60,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":60}}, "value": { "type": "DirectiveLiteral", - "start": 40, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":40,"end":59,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":59}}, "value": "octal directive\\2", "extra": { "raw": "\"octal directive\\2\"", @@ -155,32 +55,10 @@ }, { "type": "Directive", - "start": 61, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 61 - }, - "end": { - "line": 1, - "column": 74 - } - }, + "start":61,"end":74,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":74}}, "value": { "type": "DirectiveLiteral", - "start": 61, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 61 - }, - "end": { - "line": 1, - "column": 73 - } - }, + "start":61,"end":73,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":73}}, "value": "use strict", "extra": { "raw": "\"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 81ea6460e3..d559db4b56 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 76 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":76}}, "errors": [ "SyntaxError: Legacy octal literals are not allowed in strict mode (1:69)" ], "program": { "type": "Program", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 76 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":76}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 76 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":76}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 76 - } - }, + "start":17,"end":76,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":76}}, "body": [ { "type": "FunctionDeclaration", - "start": 33, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 74 - } - }, + "start":33,"end":74,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":74}}, "id": { "type": "Identifier", - "start": 42, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "inner" - }, + "start":42,"end":47,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":47},"identifierName":"inner"}, "name": "inner" }, "generator": false, @@ -117,48 +38,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 50, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 74 - } - }, + "start":50,"end":74,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":74}}, "body": [], "directives": [ { "type": "Directive", - "start": 52, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 72 - } - }, + "start":52,"end":72,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":72}}, "value": { "type": "DirectiveLiteral", - "start": 52, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 71 - } - }, + "start":52,"end":71,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":71}}, "value": "octal directive\\1", "extra": { "raw": "\"octal directive\\1\"", @@ -173,32 +61,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 2201ea3de8..a3eee1ca11 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ "SyntaxError: Unexpected reserved word 'implements' (1:37)" ], "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":17,"end":50,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":50}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":33,"end":48,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":48}}, "declarations": [ { "type": "VariableDeclarator", - "start": 37, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":37,"end":47,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":47}}, "id": { "type": "Identifier", - "start": 37, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "implements" - }, + "start":37,"end":47,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":47},"identifierName":"implements"}, "name": "implements" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 be76deabc7..cffcb241d4 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ "SyntaxError: Unexpected reserved word 'interface' (1:37)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":17,"end":49,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":49}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":33,"end":47,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":47}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 37, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "interface" - }, + "start":37,"end":46,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":46},"identifierName":"interface"}, "name": "interface" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 414e229fac..3d7bd0ac8e 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ "SyntaxError: Unexpected reserved word 'package' (1:37)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":17,"end":47,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":47}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":33,"end":45,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":45}}, "declarations": [ { "type": "VariableDeclarator", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":37,"end":44,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "package" - }, + "start":37,"end":44,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":44},"identifierName":"package"}, "name": "package" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 32efcd46a6..4c1f2d2844 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "errors": [ "SyntaxError: Unexpected reserved word 'private' (1:37)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":17,"end":47,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":47}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":33,"end":45,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":45}}, "declarations": [ { "type": "VariableDeclarator", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":37,"end":44,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "private" - }, + "start":37,"end":44,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":44},"identifierName":"private"}, "name": "private" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 e3d3f255c2..dcf994402a 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ "SyntaxError: Unexpected reserved word 'protected' (1:37)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":17,"end":49,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":49}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":33,"end":47,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":47}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 37, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "protected" - }, + "start":37,"end":46,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":46},"identifierName":"protected"}, "name": "protected" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 2e801038c7..c7306ecdb6 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected reserved word 'public' (1:37)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":17,"end":46,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":46}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":33,"end":44,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":44}}, "declarations": [ { "type": "VariableDeclarator", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43}}, "id": { "type": "Identifier", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "public" - }, + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43},"identifierName":"public"}, "name": "public" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 4ed420518d..41fd579945 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected reserved word 'static' (1:37)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":17,"end":46,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":46}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":33,"end":44,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":44}}, "declarations": [ { "type": "VariableDeclarator", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43}}, "id": { "type": "Identifier", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "static" - }, + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43},"identifierName":"static"}, "name": "static" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 55dc17f91b..52018c7cba 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (1:37)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":17,"end":45,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":45}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":33,"end":43,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":43}}, "declarations": [ { "type": "VariableDeclarator", - "start": 37, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":37,"end":42,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":42}}, "id": { "type": "Identifier", - "start": 37, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "yield" - }, + "start":37,"end":42,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":42},"identifierName":"yield"}, "name": "yield" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 3b946aeb32..d714b3e28e 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ "SyntaxError: Unexpected reserved word 'let' (1:37)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,63 +23,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":17,"end":43,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":43}}, "body": [ { "type": "VariableDeclaration", - "start": 33, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":33,"end":41,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":41}}, "declarations": [ { "type": "VariableDeclarator", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":37,"end":40,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":40}}, "id": { "type": "Identifier", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "let" - }, + "start":37,"end":40,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":40},"identifierName":"let"}, "name": "let" }, "init": null @@ -136,32 +46,10 @@ "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 ab669586dc..1605445790 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ "SyntaxError: Binding 'static' in strict mode (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "hello" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"hello"}, "name": "hello" }, "generator": false, @@ -68,66 +23,21 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "static" - }, + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21},"identifierName":"static"}, "name": "static" } ], "body": { "type": "BlockStatement", - "start": 23, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":23,"end":40,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":40}}, "body": [], "directives": [ { "type": "Directive", - "start": 25, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":25,"end":38,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":38}}, "value": { "type": "DirectiveLiteral", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":25,"end":37,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":37}}, "value": "use strict", "extra": { "raw": "\"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 be76a2099b..b184d58817 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'static' in strict mode (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "static" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"static"}, "name": "static" }, "generator": false, @@ -68,48 +23,15 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":18,"end":35,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":35}}, "body": [], "directives": [ { "type": "Directive", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":20,"end":33,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":33}}, "value": { "type": "DirectiveLiteral", - "start": 20, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, "value": "use strict", "extra": { "raw": "\"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 df217b6af2..5704449178 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "eval" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"eval"}, "name": "eval" }, "generator": false, @@ -68,66 +23,21 @@ "params": [ { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "a" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"a"}, "name": "a" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":17,"end":34,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":34}}, "body": [], "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 0de7c6ba2a..4f8e8d897e 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'arguments' in strict mode (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "arguments" - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18},"identifierName":"arguments"}, "name": "arguments" }, "generator": false, @@ -68,66 +23,21 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "a" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"a"}, "name": "a" } ], "body": { "type": "BlockStatement", - "start": 22, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":22,"end":39,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":39}}, "body": [], "directives": [ { "type": "Directive", - "start": 24, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":24,"end":37,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":37}}, "value": { "type": "DirectiveLiteral", - "start": 24, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":24,"end":36,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":36}}, "value": "use strict", "extra": { "raw": "\"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 c249f39209..07cfc93246 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 @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected reserved word 'static' (1:23)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":14,"end":35,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":35}}, "id": { "type": "Identifier", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "static" - }, + "start":23,"end":29,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":29},"identifierName":"static"}, "name": "static" }, "generator": false, @@ -68,18 +23,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":32,"end":35,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":35}}, "body": [], "directives": [] } @@ -88,32 +32,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"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 f945eeb574..3b77c9170b 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ "SyntaxError: Argument name clash (1:14)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,83 +23,26 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "t" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"t"}, "name": "t" }, { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "t" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"t"}, "name": "t" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":17,"end":34,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":34}}, "body": [], "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 f2ff5d38de..0581517d99 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:11)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,66 +23,21 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "eval" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":17,"end":34,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":34}}, "body": [], "directives": [ { "type": "Directive", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "value": { "type": "DirectiveLiteral", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "value": "use strict", "extra": { "raw": "\"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 2f734055a4..aafa09421c 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ "SyntaxError: Binding 'package' in strict mode (1:11)" ], "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,66 +23,21 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "package" - }, + "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18},"identifierName":"package"}, "name": "package" } ], "body": { "type": "BlockStatement", - "start": 20, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":20,"end":37,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":37}}, "body": [], "directives": [ { "type": "Directive", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":22,"end":35,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":35}}, "value": { "type": "DirectiveLiteral", - "start": 22, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, "value": "use strict", "extra": { "raw": "\"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 60ac3ce8c9..df3094e728 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "errors": [ "SyntaxError: Argument name clash (1:43)" ], "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,48 +23,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":13,"end":52,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":52}}, "body": [ { "type": "FunctionDeclaration", - "start": 29, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":29,"end":49,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "b" - }, + "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39},"identifierName":"b"}, "name": "b" }, "generator": false, @@ -117,102 +38,34 @@ "params": [ { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "t" - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"t"}, "name": "t" }, { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "t" - }, + "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44},"identifierName":"t"}, "name": "t" } ], "body": { "type": "BlockStatement", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":46,"end":49,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":49}}, "body": [], "directives": [] } }, { "type": "EmptyStatement", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 50 - } - } + "start":49,"end":50,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":50}} } ], "directives": [ { "type": "Directive", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "value": { "type": "DirectiveLiteral", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "value": "use strict", "extra": { "raw": "\"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 766ec14c5a..bcaf874206 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 @@ -1,80 +1,24 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Argument name clash (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -82,83 +26,26 @@ "params": [ { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "t" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"t"}, "name": "t" }, { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "t" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"t"}, "name": "t" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":18,"end":35,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":35}}, "body": [], "directives": [ { "type": "Directive", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":20,"end":33,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":33}}, "value": { "type": "DirectiveLiteral", - "start": 20, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, "value": "use strict", "extra": { "raw": "\"use strict\"", 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 0f2e3c5dce..65f5a908f0 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "errors": [ "SyntaxError: Argument name clash (1:44)" ], "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -68,62 +23,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":13,"end":54,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":54}}, "body": [ { "type": "ExpressionStatement", - "start": 29, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":29,"end":52,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":52}}, "expression": { "type": "FunctionExpression", - "start": 30, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":30,"end":50,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":50}}, "id": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "b" - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"b"}, "name": "b" }, "generator": false, @@ -131,53 +41,18 @@ "params": [ { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "t" - }, + "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42},"identifierName":"t"}, "name": "t" }, { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "t" - }, + "start":44,"end":45,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":45},"identifierName":"t"}, "name": "t" } ], "body": { "type": "BlockStatement", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":47,"end":50,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":50}}, "body": [], "directives": [] }, @@ -191,32 +66,10 @@ "directives": [ { "type": "Directive", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "value": { "type": "DirectiveLiteral", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27}}, "value": "use strict", "extra": { "raw": "\"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 7945e482ca..a1ab8b4653 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 @@ -1,80 +1,24 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Binding 'eval' in strict mode (1:12)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":1,"end":35,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":35}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -82,66 +26,21 @@ "params": [ { "type": "Identifier", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "eval" - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16},"identifierName":"eval"}, "name": "eval" } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":18,"end":35,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":35}}, "body": [], "directives": [ { "type": "Directive", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":20,"end":33,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":33}}, "value": { "type": "DirectiveLiteral", - "start": 20, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":20,"end":32,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":32}}, "value": "use strict", "extra": { "raw": "\"use strict\"", 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 304b4237e9..7caed97929 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 @@ -1,80 +1,24 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Binding 'package' in strict mode (1:12)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":1,"end":38,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":38}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -82,66 +26,21 @@ "params": [ { "type": "Identifier", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "package" - }, + "start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19},"identifierName":"package"}, "name": "package" } ], "body": { "type": "BlockStatement", - "start": 21, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":21,"end":38,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":38}}, "body": [], "directives": [ { "type": "Directive", - "start": 23, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":23,"end":36,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":36}}, "value": { "type": "DirectiveLiteral", - "start": 23, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/output.json index 2b1e638019..df42b7ac7d 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0248/output.json @@ -1,93 +1,27 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ "SyntaxError: Label '__proto__' is already declared (1:11)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "body": { "type": "LabeledStatement", - "start": 11, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":11,"end":25,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":25}}, "body": { "type": "ExpressionStatement", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "expression": { "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": 42, "raw": "42" @@ -97,37 +31,13 @@ }, "label": { "type": "Identifier", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "__proto__" - }, + "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20},"identifierName":"__proto__"}, "name": "__proto__" } }, "label": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "__proto__" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"__proto__"}, "name": "__proto__" } } 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 45d9e76d63..27c0fb2e3a 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "errors": [ "SyntaxError: Argument name clash (1:36)" ], "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 14, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":14,"end":50,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":50}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "t" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"t"}, "name": "t" }, "generator": false, @@ -68,53 +23,18 @@ "params": [ { "type": "Identifier", - "start": 25, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "__proto__" - }, + "start":25,"end":34,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":34},"identifierName":"__proto__"}, "name": "__proto__" }, { "type": "Identifier", - "start": 36, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "__proto__" - }, + "start":36,"end":45,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":45},"identifierName":"__proto__"}, "name": "__proto__" } ], "body": { "type": "BlockStatement", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":47,"end":50,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":50}}, "body": [], "directives": [] } @@ -123,32 +43,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "\"use strict\"", diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/output.json index 6c9cf3db90..5b2a545950 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0250/output.json @@ -1,146 +1,45 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Redefinition of __proto__ property (1:21)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "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": "ObjectExpression", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "__proto__" - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "extra": { "rawValue": 42, "raw": "42" @@ -150,52 +49,18 @@ }, { "type": "ObjectProperty", - "start": 21, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":21,"end":34,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":34}}, "method": false, "key": { "type": "Identifier", - "start": 21, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "__proto__" - }, + "start":21,"end":30,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":30},"identifierName":"__proto__"}, "name": "__proto__" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "extra": { "rawValue": 43, "raw": "43" diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/output.json index 3c3b792e5b..cedce7bc2c 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0270/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ "SyntaxError: Classes may not have static property named prototype (1:16)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":8,"end":30,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":30}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":9,"end":29,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":29}}, "static": true, "key": { "type": "Identifier", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "prototype" - }, + "start":16,"end":25,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":25},"identifierName":"prototype"}, "name": "prototype" }, "computed": false, @@ -119,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/output.json index 0c00e7e068..5d43814f16 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0271/output.json @@ -1,113 +1,35 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Classes may not have static property named prototype (1:16)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":8,"end":32,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":32}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, "static": true, "key": { "type": "StringLiteral", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":16,"end":27,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":27}}, "extra": { "rawValue": "prototype", "raw": "\"prototype\"" @@ -122,18 +44,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/output.json index d74849d8de..ab3b4e1d0f 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0272/output.json @@ -1,114 +1,35 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Class constructor may not be an accessor (1:13)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":8,"end":29,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":29}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":9,"end":28,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":28}}, "static": false, "key": { "type": "Identifier", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "constructor" - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -119,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/output.json index 5fe83a6735..937104c770 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0273/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ "SyntaxError: Class constructor may not be an accessor (1:13)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":8,"end":30,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":30}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":9,"end":29,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":29}}, "static": false, "key": { "type": "Identifier", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "constructor" - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -119,36 +40,13 @@ "params": [ { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "m" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"m"}, "name": "m" } ], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/output.json index 4337adcf6e..ed124fb20e 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0274/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ "SyntaxError: Duplicate constructor in the same class (1:25)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":8,"end":43,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":43}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}}, "static": false, "key": { "type": "Identifier", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "constructor" - }, + "start":9,"end":20,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":20},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -119,51 +40,18 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 25, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":25,"end":42,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":42}}, "static": false, "key": { "type": "StringLiteral", - "start": 25, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":25,"end":38,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":38}}, "extra": { "rawValue": "constructor", "raw": "\"constructor\"" @@ -178,18 +66,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":40,"end":42,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":42}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/output.json index df10adea16..fbd8170142 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0277/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Unexpected reserved word 'enum' (1:11)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":8,"end":19,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":19}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "static": false, "key": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -119,36 +40,13 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "enum" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"enum"}, "name": "enum" } ], "body": { "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/output.json b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/output.json index 275b0d3ee3..d1c541915d 100644 --- a/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/output.json +++ b/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0278/output.json @@ -1,115 +1,36 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ "SyntaxError: Unexpected reserved word 'static' (1:17)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":8,"end":30,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":30}}, "body": [ { "type": "ClassMethod", - "start": 9, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":9,"end":28,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":28}}, "static": true, "computed": true, "key": { "type": "Identifier", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "static" - }, + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23},"identifierName":"static"}, "name": "static" }, "kind": "method", @@ -119,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/output.json b/packages/babel-parser/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/output.json index 274656622a..70f1ba7669 100644 --- a/packages/babel-parser/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/output.json +++ b/packages/babel-parser/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-array/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "argument": { "type": "ArrayPattern", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "elements": [ { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "b" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"b"}, "name": "b" } ] @@ -130,19 +40,7 @@ ], "body": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "c" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"c"}, "name": "c" } } diff --git a/packages/babel-parser/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/output.json b/packages/babel-parser/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/output.json index d2f4d73a6e..016842ff5e 100644 --- a/packages/babel-parser/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/output.json +++ b/packages/babel-parser/test/fixtures/esprima/rest-parameter/arrow-rest-parameter-object/output.json @@ -1,161 +1,48 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "argument": { "type": "ObjectPattern", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "b" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "b" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"b"}, "name": "b" }, "extra": { @@ -168,19 +55,7 @@ ], "body": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "c" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"c"}, "name": "c" } } diff --git a/packages/babel-parser/test/fixtures/esprima/rest-parameter/function-declaration/output.json b/packages/babel-parser/test/fixtures/esprima/rest-parameter/function-declaration/output.json index 6d5be94768..572ab04a24 100644 --- a/packages/babel-parser/test/fixtures/esprima/rest-parameter/function-declaration/output.json +++ b/packages/babel-parser/test/fixtures/esprima/rest-parameter/function-declaration/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,68 +20,22 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}}, "argument": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "b" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"b"}, "name": "b" } } ], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/rest-parameter/function-expression/output.json b/packages/babel-parser/test/fixtures/esprima/rest-parameter/function-expression/output.json index 292e5947e0..efed9fb6b3 100644 --- a/packages/babel-parser/test/fixtures/esprima/rest-parameter/function-expression/output.json +++ b/packages/babel-parser/test/fixtures/esprima/rest-parameter/function-expression/output.json @@ -1,162 +1,49 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "right": { "type": "FunctionExpression", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "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}}, "argument": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "b" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"b"}, "name": "b" } } ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json b/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json index 30ec6b3832..b36068b690 100644 --- a/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json +++ b/packages/babel-parser/test/fixtures/esprima/rest-parameter/invalid-setter-rest/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: setter function argument must not be a rest parameter (1:6)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "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": "ObjectExpression", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":6,"end":20,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "f" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"f"}, "name": "f" }, "computed": false, @@ -133,51 +43,17 @@ "params": [ { "type": "RestElement", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "argument": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "y" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"y"}, "name": "y" } } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/rest-parameter/object-method/output.json b/packages/babel-parser/test/fixtures/esprima/rest-parameter/object-method/output.json index 2a7cf33842..b47cdbe229 100644 --- a/packages/babel-parser/test/fixtures/esprima/rest-parameter/object-method/output.json +++ b/packages/babel-parser/test/fixtures/esprima/rest-parameter/object-method/output.json @@ -1,211 +1,64 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "operator": "=", "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "o" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"o"}, "name": "o" }, "right": { "type": "ObjectExpression", - "start": 4, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":4,"end":31,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":31}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":6,"end":29,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "f" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"f"}, "name": "f" }, "computed": false, "shorthand": false, "value": { "type": "FunctionExpression", - "start": 9, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":9,"end":29,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":29}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "a" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"a"}, "name": "a" }, { "type": "RestElement", - "start": 21, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":21,"end":25,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":25}}, "argument": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "b" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"b"}, "name": "b" } } ], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/rest-parameter/object-shorthand-method/output.json b/packages/babel-parser/test/fixtures/esprima/rest-parameter/object-shorthand-method/output.json index 2b0e6f95c3..0e1543e81b 100644 --- a/packages/babel-parser/test/fixtures/esprima/rest-parameter/object-shorthand-method/output.json +++ b/packages/babel-parser/test/fixtures/esprima/rest-parameter/object-shorthand-method/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "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": "ObjectExpression", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}}, "properties": [ { "type": "ObjectMethod", - "start": 6, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":6,"end":25,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":25}}, "method": true, "key": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "method" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"method"}, "name": "method" }, "computed": false, @@ -130,51 +40,17 @@ "params": [ { "type": "RestElement", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "argument": { "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "test" - }, + "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"test"}, "name": "test" } } ], "body": { "type": "BlockStatement", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/rest-parameter/rest-parameter-array/output.json b/packages/babel-parser/test/fixtures/esprima/rest-parameter/rest-parameter-array/output.json index 6ec46b27f6..8a74440bee 100644 --- a/packages/babel-parser/test/fixtures/esprima/rest-parameter/rest-parameter-array/output.json +++ b/packages/babel-parser/test/fixtures/esprima/rest-parameter/rest-parameter-array/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,48 +20,14 @@ "params": [ { "type": "RestElement", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "argument": { "type": "ArrayPattern", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "elements": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a" } ] @@ -115,18 +36,7 @@ ], "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/rest-parameter/rest-parameter-object/output.json b/packages/babel-parser/test/fixtures/esprima/rest-parameter/rest-parameter-object/output.json index d6665939ce..8e46e83105 100644 --- a/packages/babel-parser/test/fixtures/esprima/rest-parameter/rest-parameter-object/output.json +++ b/packages/babel-parser/test/fixtures/esprima/rest-parameter/rest-parameter-object/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,82 +20,25 @@ "params": [ { "type": "RestElement", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "argument": { "type": "ObjectPattern", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "properties": [ { "type": "ObjectProperty", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a" }, "extra": { @@ -153,18 +51,7 @@ ], "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-block/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/statement-block/migrated_0000/output.json index 598c96a56b..c606339577 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-block/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-block/migrated_0000/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, "expression": { "type": "Identifier", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "foo" - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5},"identifierName":"foo"}, "name": "foo" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-block/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/statement-block/migrated_0001/output.json index 9eed13dbf1..61bba56429 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-block/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-block/migrated_0001/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "body": [ { "type": "ExpressionStatement", - "start": 2, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":2,"end":11,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":11}}, "expression": { "type": "CallExpression", - "start": 2, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":2,"end":10,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":10}}, "callee": { "type": "Identifier", - "start": 2, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "doThis" - }, + "start":2,"end":8,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":8},"identifierName":"doThis"}, "name": "doThis" }, "arguments": [] @@ -94,47 +27,13 @@ }, { "type": "ExpressionStatement", - "start": 12, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":12,"end":21,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":21}}, "expression": { "type": "CallExpression", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "callee": { "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "doThat" - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18},"identifierName":"doThat"}, "name": "doThat" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-block/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/statement-block/migrated_0002/output.json index 9c65b7b8cb..b2560defc5 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-block/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-block/migrated_0002/output.json @@ -1,48 +1,15 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0000/output.json index f719006e5a..bdda42876a 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0000/output.json @@ -1,93 +1,27 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":13,"end":22,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":22}}, "body": [ { "type": "BreakStatement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0001/output.json index 09cd88be36..12f3b1a77a 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0001/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "body": { "type": "WhileStatement", - "start": 6, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":6,"end":33,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":33}}, "test": { "type": "BooleanLiteral", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17}}, "value": true }, "body": { "type": "BlockStatement", - "start": 19, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":19,"end":33,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":33}}, "body": [ { "type": "BreakStatement", - "start": 21, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":21,"end":31,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":31}}, "label": { "type": "Identifier", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "done" - }, + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31},"identifierName":"done"}, "name": "done" } } @@ -126,19 +37,7 @@ }, "label": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "done" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"done"}, "name": "done" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0002/output.json index 612f1abd2b..856e2d676e 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0002/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "body": { "type": "WhileStatement", - "start": 6, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":6,"end":34,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":34}}, "test": { "type": "BooleanLiteral", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17}}, "value": true }, "body": { "type": "BlockStatement", - "start": 19, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":19,"end":34,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":34}}, "body": [ { "type": "BreakStatement", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "label": { "type": "Identifier", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "done" - }, + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31},"identifierName":"done"}, "name": "done" } } @@ -126,19 +37,7 @@ }, "label": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "done" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"done"}, "name": "done" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0003/output.json index 320152a606..9b2756dbb4 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-break/migrated_0003/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "body": { "type": "WhileStatement", - "start": 11, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":11,"end":44,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":44}}, "test": { "type": "BooleanLiteral", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "value": true }, "body": { "type": "BlockStatement", - "start": 24, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":24,"end":44,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":44}}, "body": [ { "type": "BreakStatement", - "start": 26, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":26,"end":42,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":42}}, "label": { "type": "Identifier", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "__proto__" - }, + "start":32,"end":41,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":41},"identifierName":"__proto__"}, "name": "__proto__" } } @@ -126,19 +37,7 @@ }, "label": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "__proto__" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"__proto__"}, "name": "__proto__" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0000/output.json index 976ebcc715..797c741a6e 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0000/output.json @@ -1,93 +1,27 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "body": [ { "type": "ContinueStatement", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0001/output.json index b14a15b253..320fd8e869 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0001/output.json @@ -1,93 +1,27 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "BlockStatement", - "start": 13, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":13,"end":25,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":25}}, "body": [ { "type": "ContinueStatement", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0002/output.json index 618cec22e8..d69535cf35 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0002/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "body": { "type": "WhileStatement", - "start": 6, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":6,"end":36,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":36}}, "test": { "type": "BooleanLiteral", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17}}, "value": true }, "body": { "type": "BlockStatement", - "start": 19, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":19,"end":36,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":36}}, "body": [ { "type": "ContinueStatement", - "start": 21, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":21,"end":34,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":34}}, "label": { "type": "Identifier", - "start": 30, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "done" - }, + "start":30,"end":34,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":34},"identifierName":"done"}, "name": "done" } } @@ -126,19 +37,7 @@ }, "label": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "done" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"done"}, "name": "done" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0003/output.json index 1ae8f40f97..3036808c3c 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0003/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "body": { "type": "WhileStatement", - "start": 6, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":6,"end":37,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":37}}, "test": { "type": "BooleanLiteral", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17}}, "value": true }, "body": { "type": "BlockStatement", - "start": 19, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":19,"end":37,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":37}}, "body": [ { "type": "ContinueStatement", - "start": 21, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":21,"end":35,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":35}}, "label": { "type": "Identifier", - "start": 30, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "done" - }, + "start":30,"end":34,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":34},"identifierName":"done"}, "name": "done" } } @@ -126,19 +37,7 @@ }, "label": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "done" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"done"}, "name": "done" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0004/output.json index 2340c94c69..27feea5222 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-continue/migrated_0004/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "body": { "type": "WhileStatement", - "start": 11, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":11,"end":47,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":47}}, "test": { "type": "BooleanLiteral", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "value": true }, "body": { "type": "BlockStatement", - "start": 24, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":24,"end":47,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":47}}, "body": [ { "type": "ContinueStatement", - "start": 26, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":26,"end":45,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":45}}, "label": { "type": "Identifier", - "start": 35, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "__proto__" - }, + "start":35,"end":44,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":44},"identifierName":"__proto__"}, "name": "__proto__" } } @@ -126,19 +37,7 @@ }, "label": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "__proto__" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"__proto__"}, "name": "__proto__" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-debugger/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/statement-debugger/migrated_0000/output.json index 86fbfde778..a0ef6bdc2f 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-debugger/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-debugger/migrated_0000/output.json @@ -1,48 +1,15 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "DebuggerStatement", - "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}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-empty/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/statement-empty/migrated_0000/output.json index 1c109c350c..1056212c97 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-empty/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-empty/migrated_0000/output.json @@ -1,48 +1,15 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EmptyStatement", - "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}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0000/output.json index 46cd57504e..8bb741bae2 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0000/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0001/output.json index 769e912a7e..c6a529bc13 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0001/output.json @@ -1,95 +1,27 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "SequenceExpression", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expressions": [ { "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" }, { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "y" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"y"}, "name": "y" } ] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/output.json index e418d699ca..03c94d829a 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0002/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "\\a" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"\\a"}, "name": "\\a" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/output.json index 6f022e5637..f88db15c7f 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0003/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "aa\\a" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"aa\\a"}, "name": "aa\\a" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/output.json index c0f5118261..389c8a589f 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0004/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "\\aa" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"\\aa"}, "name": "\\aa" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/output.json index c0f5118261..389c8a589f 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-expression/migrated_0005/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expecting Unicode escape sequence \\uXXXX (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "\\aa" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"\\aa"}, "name": "\\aa" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0000/output.json index 078b39d33a..7dcb2358b5 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0000/output.json @@ -1,108 +1,29 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "test": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "morning" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"morning"}, "name": "morning" }, "consequent": { "type": "ExpressionStatement", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "expression": { "type": "CallExpression", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "callee": { "type": "Identifier", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "goodMorning" - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24},"identifierName":"goodMorning"}, "name": "goodMorning" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0001/output.json index 46b9ab0f4a..cfe4ca1e26 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0001/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "test": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "morning" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"morning"}, "name": "morning" }, "consequent": { "type": "ExpressionStatement", - "start": 13, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":13,"end":27,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":27}}, "expression": { "type": "FunctionExpression", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0002/output.json index d2e4bb7013..3fb7587ba6 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0002/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "test": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "morning" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"morning"}, "name": "morning" }, "consequent": { "type": "VariableDeclaration", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":13,"end":23,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0004/output.json index 3a5f512ccc..37986cf131 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0004/output.json @@ -1,108 +1,29 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "test": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "morning" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"morning"}, "name": "morning" }, "consequent": { "type": "ExpressionStatement", - "start": 13, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":13,"end":27,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":27}}, "expression": { "type": "CallExpression", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "callee": { "type": "Identifier", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "goodMorning" - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24},"identifierName":"goodMorning"}, "name": "goodMorning" }, "arguments": [] @@ -110,47 +31,13 @@ }, "alternate": { "type": "ExpressionStatement", - "start": 33, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":33,"end":42,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":42}}, "expression": { "type": "CallExpression", - "start": 33, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":33,"end":42,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":42}}, "callee": { "type": "Identifier", - "start": 33, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "goodDay" - }, + "start":33,"end":40,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":40},"identifierName":"goodDay"}, "name": "goodDay" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0005/output.json index 9bdda240be..2b5173ab82 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0005/output.json @@ -1,107 +1,29 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "test": { "type": "BooleanLiteral", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "value": true }, "consequent": { "type": "ExpressionStatement", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":10,"end":18,"loc":{"start":{"line":1,"column":10},"end":{"line":2,"column":1}}, "expression": { "type": "CallExpression", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}}, "callee": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "that" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"that"}, "name": "that" }, "arguments": [] @@ -109,18 +31,7 @@ }, "alternate": { "type": "EmptyStatement", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - } + "start":23,"end":24,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0006/output.json index abdcda9559..c0a36d1894 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-if/migrated_0006/output.json @@ -1,107 +1,29 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "test": { "type": "BooleanLiteral", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "value": true }, "consequent": { "type": "ExpressionStatement", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "expression": { "type": "CallExpression", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}}, "callee": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "that" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"that"}, "name": "that" }, "arguments": [] @@ -109,18 +31,7 @@ }, "alternate": { "type": "EmptyStatement", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/const_forin/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/const_forin/output.json index e2464ea28f..d29ec1396d 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/const_forin/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/const_forin/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "left": { "type": "VariableDeclaration", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "init": null @@ -96,82 +29,24 @@ }, "right": { "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "list" - }, + "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 22, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":22,"end":33,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":33}}, "expression": { "type": "CallExpression", - "start": 22, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":22,"end":32,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":32}}, "callee": { "type": "Identifier", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "process" - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "x" - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/for-statement-with-seq/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/for-statement-with-seq/output.json index 4263383a0b..a8b45fca99 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/for-statement-with-seq/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/for-statement-with-seq/output.json @@ -1,112 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "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}}, "init": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "b" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"b"}, "name": "b" }, { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "c" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"c"}, "name": "c" } ] @@ -115,18 +35,7 @@ "update": null, "body": { "type": "EmptyStatement", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0000/output.json index ea8f8f1ee1..17cddefa31 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0000/output.json @@ -1,91 +1,24 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "DoWhileStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "body": { "type": "ExpressionStatement", - "start": 3, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":3,"end":10,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":10}}, "expression": { "type": "CallExpression", - "start": 3, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":3,"end":9,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":9}}, "callee": { "type": "Identifier", - "start": 3, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "keep" - }, + "start":3,"end":7,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":7},"identifierName":"keep"}, "name": "keep" }, "arguments": [] @@ -93,18 +26,7 @@ }, "test": { "type": "BooleanLiteral", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "value": true } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0001/output.json index 58dc5fcc7b..8328102958 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0001/output.json @@ -1,91 +1,24 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "DoWhileStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "body": { "type": "ExpressionStatement", - "start": 3, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":3,"end":10,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":10}}, "expression": { "type": "CallExpression", - "start": 3, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":3,"end":9,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":9}}, "callee": { "type": "Identifier", - "start": 3, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "keep" - }, + "start":3,"end":7,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":7},"identifierName":"keep"}, "name": "keep" }, "arguments": [] @@ -93,18 +26,7 @@ }, "test": { "type": "BooleanLiteral", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "value": true } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0002/output.json index 2dc7a4b042..0d0752b806 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0002/output.json @@ -1,157 +1,45 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "DoWhileStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "body": { "type": "BlockStatement", - "start": 3, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":3,"end":16,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":16}}, "body": [ { "type": "ExpressionStatement", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "expression": { "type": "UpdateExpression", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "operator": "++", "prefix": false, "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" } } }, { "type": "ExpressionStatement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "expression": { "type": "UpdateExpression", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "operator": "--", "prefix": false, "argument": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "y" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"y"}, "name": "y" } } @@ -161,50 +49,16 @@ }, "test": { "type": "BinaryExpression", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}}, "left": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"x"}, "name": "x" }, "operator": "<", "right": { "type": "NumericLiteral", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "extra": { "rawValue": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0003/output.json index 0ae53e012b..7a8450a177 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0003/output.json @@ -1,125 +1,37 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "body": [ { "type": "DoWhileStatement", - "start": 2, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":2,"end":22,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":22}}, "body": { "type": "BlockStatement", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "body": [], "directives": [] }, "test": { "type": "BooleanLiteral", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "value": false } }, { "type": "ExpressionStatement", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "expression": { "type": "BooleanLiteral", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "value": false } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0004/output.json index 56f02c219f..60e0d1e828 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0004/output.json @@ -1,91 +1,24 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "DoWhileStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "body": { "type": "ExpressionStatement", - "start": 3, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":3,"end":10,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":10}}, "expression": { "type": "CallExpression", - "start": 3, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":3,"end":9,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":9}}, "callee": { "type": "Identifier", - "start": 3, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "that" - }, + "start":3,"end":7,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":7},"identifierName":"that"}, "name": "that" }, "arguments": [] @@ -93,18 +26,7 @@ }, "test": { "type": "BooleanLiteral", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21}}, "value": true } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0005/output.json index d51c3bce84..9e9585db2e 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0005/output.json @@ -1,91 +1,24 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "DoWhileStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "body": { "type": "ExpressionStatement", - "start": 3, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":3,"end":11,"loc":{"start":{"line":1,"column":3},"end":{"line":2,"column":1}}, "expression": { "type": "CallExpression", - "start": 3, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":3,"end":9,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":9}}, "callee": { "type": "Identifier", - "start": 3, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "that" - }, + "start":3,"end":7,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":7},"identifierName":"that"}, "name": "that" }, "arguments": [] @@ -93,18 +26,7 @@ }, "test": { "type": "BooleanLiteral", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":18,"end":22,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":12}}, "value": true } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0006/output.json index 4f0b42bf91..14379aca37 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0006/output.json @@ -1,107 +1,29 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "test": { "type": "BooleanLiteral", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "value": true }, "body": { "type": "ExpressionStatement", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "expression": { "type": "CallExpression", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "callee": { "type": "Identifier", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "doSomething" - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24},"identifierName":"doSomething"}, "name": "doSomething" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0007/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0007/output.json index cab2b6c289..855a078a1e 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0007/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0007/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WhileStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "test": { "type": "BinaryExpression", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "left": { "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" }, "operator": "<", "right": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "extra": { "rawValue": 10, "raw": "10" @@ -98,113 +31,34 @@ }, "body": { "type": "BlockStatement", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "body": [ { "type": "ExpressionStatement", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21}}, "expression": { "type": "UpdateExpression", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "operator": "++", "prefix": false, "argument": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"x"}, "name": "x" } } }, { "type": "ExpressionStatement", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":22,"end":26,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":26}}, "expression": { "type": "UpdateExpression", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "operator": "--", "prefix": false, "argument": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "y" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"y"}, "name": "y" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0008/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0008/output.json index ef81cf2ef0..2e3d9f6a43 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0008/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0008/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "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}}, "init": null, "test": null, "update": null, "body": { "type": "EmptyStatement", - "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}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0009/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0009/output.json index eca6e822f6..4b8a7f23f0 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0009/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0009/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "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}}, "init": null, "test": null, "update": null, "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0010/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0010/output.json index 087317911d..dbc5316223 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0010/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0010/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "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}}, "init": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "right": { "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": 0, "raw": "0" @@ -100,18 +33,7 @@ "update": null, "body": { "type": "EmptyStatement", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0011/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0011/output.json index aa78dd8a11..c66442c43c 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0011/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0011/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "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}}, "init": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "id": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 0, "raw": "0" @@ -117,18 +39,7 @@ "update": null, "body": { "type": "EmptyStatement", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0012/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0012/output.json index 8cee92a6a4..333c5c3949 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0012/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0012/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "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}}, "init": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "id": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 0, "raw": "0" @@ -117,18 +39,7 @@ "update": null, "body": { "type": "EmptyStatement", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0013/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0013/output.json index 02714a4af3..2fd8f619a8 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0013/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0013/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "init": { "type": "VariableDeclaration", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20}}, "declarations": [ { "type": "VariableDeclarator", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "id": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": 0, "raw": "0" @@ -112,49 +34,15 @@ }, { "type": "VariableDeclarator", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "y" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"y"}, "name": "y" }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" @@ -169,18 +57,7 @@ "update": null, "body": { "type": "EmptyStatement", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0014/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0014/output.json index ae77e9c9c0..d4c5c67c94 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0014/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0014/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "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}}, "init": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "right": { "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": 0, "raw": "0" @@ -98,50 +31,16 @@ }, "test": { "type": "BinaryExpression", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "left": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "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" @@ -152,18 +51,7 @@ "update": null, "body": { "type": "EmptyStatement", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0015/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0015/output.json index 8cae092843..cd2ea8ed46 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0015/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0015/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "init": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "right": { "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": 0, "raw": "0" @@ -98,50 +31,16 @@ }, "test": { "type": "BinaryExpression", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "left": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "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" @@ -151,52 +50,18 @@ }, "update": { "type": "UpdateExpression", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, "operator": "++", "prefix": false, "argument": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "x" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"x"}, "name": "x" } }, "body": { "type": "EmptyStatement", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0016/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0016/output.json index 0623e2624b..35c53b58e7 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0016/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0016/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForStatement", - "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}}, "init": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "right": { "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": 0, "raw": "0" @@ -98,50 +31,16 @@ }, "test": { "type": "BinaryExpression", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "left": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "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" @@ -151,99 +50,30 @@ }, "update": { "type": "UpdateExpression", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, "operator": "++", "prefix": false, "argument": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "x" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"x"}, "name": "x" } }, "body": { "type": "ExpressionStatement", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":24,"end":35,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":35}}, "expression": { "type": "CallExpression", - "start": 24, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":24,"end":34,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":34}}, "callee": { "type": "Identifier", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "process" - }, + "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "x" - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0017/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0017/output.json index 4ce8157544..0dcc76e29b 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0017/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0017/output.json @@ -1,143 +1,40 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "left": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "right": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "list" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 15, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":15,"end":26,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":26}}, "expression": { "type": "CallExpression", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":15,"end":25,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":25}}, "callee": { "type": "Identifier", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "process" - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0018/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0018/output.json index d418bc0ac8..b132a32e5e 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0018/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0018/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "left": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "init": null @@ -96,82 +29,24 @@ }, "right": { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "list" - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "expression": { "type": "CallExpression", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "callee": { "type": "Identifier", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "process" - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "x" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0020/output.json b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0020/output.json index 3cfd26fb69..65791b99b8 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0020/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-iteration/migrated_0020/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "left": { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "init": null @@ -96,82 +29,24 @@ }, "right": { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "list" - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"list"}, "name": "list" }, "body": { "type": "ExpressionStatement", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "expression": { "type": "CallExpression", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "callee": { "type": "Identifier", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "process" - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27},"identifierName":"process"}, "name": "process" }, "arguments": [ { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "x" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"x"}, "name": "x" } ] 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 7a1b2313ce..2bf7aed2fc 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 @@ -1,126 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "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}}, "left": { "type": "MemberExpression", - "start": 5, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":5,"end":14,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":14}}, "object": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "property": { "type": "BinaryExpression", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "left": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "b" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" }, "operator": "in", "right": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "c" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"c"}, "name": "c" } }, @@ -128,35 +37,12 @@ }, "right": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "d" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"d"}, "name": "d" }, "body": { "type": "EmptyStatement", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}} } } ], 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 f25bf92484..783531a212 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 @@ -1,141 +1,39 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "left": { "type": "MemberExpression", - "start": 5, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":5,"end":17,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":17}}, "object": { "type": "CallExpression", - "start": 5, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":5,"end":14,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":14}}, "callee": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "arguments": [ { "type": "BinaryExpression", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "left": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "b" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"b"}, "name": "b" }, "operator": "in", "right": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "c" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"c"}, "name": "c" } } @@ -143,18 +41,7 @@ }, "property": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 0, "raw": "0" @@ -165,35 +52,12 @@ }, "right": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "d" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"d"}, "name": "d" }, "body": { "type": "EmptyStatement", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} } } ], 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 b89167e9aa..0a0bb5e03a 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 @@ -1,129 +1,38 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ForInStatement", - "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}}, "left": { "type": "MemberExpression", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "object": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 7, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "in" - }, + "start":7,"end":9,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":9},"identifierName":"in"}, "name": "in" }, "computed": false }, "right": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a" }, "body": { "type": "EmptyStatement", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}} } } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-labelled/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/statement-labelled/migrated_0000/output.json index acbeba45c5..9a1c53c853 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-labelled/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-labelled/migrated_0000/output.json @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "body": { "type": "ForStatement", - "start": 7, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":7,"end":27,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":27}}, "init": null, "test": null, "update": null, "body": { "type": "BreakStatement", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":16,"end":27,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":27}}, "label": { "type": "Identifier", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "start" - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27},"identifierName":"start"}, "name": "start" } } }, "label": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "start" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"start"}, "name": "start" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-labelled/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/statement-labelled/migrated_0001/output.json index 5251cd078d..758f4d4bd8 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-labelled/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-labelled/migrated_0001/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "body": { "type": "WhileStatement", - "start": 7, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":7,"end":31,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":31}}, "test": { "type": "BooleanLiteral", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}}, "value": true }, "body": { "type": "BreakStatement", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "label": { "type": "Identifier", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "start" - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31},"identifierName":"start"}, "name": "start" } } }, "label": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "start" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"start"}, "name": "start" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-labelled/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/statement-labelled/migrated_0002/output.json index 1fd4ea1925..607fea4fa9 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-labelled/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-labelled/migrated_0002/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "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}}, "body": { "type": "ExpressionStatement", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15}}, "expression": { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "test" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"test"}, "name": "test" } }, "label": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "__proto__" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"__proto__"}, "name": "__proto__" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0000/output.json index 34df72d1dd..12be6ac788 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0000/output.json @@ -1,95 +1,29 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":1,"end":21,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":21}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21}}, "body": [ { "type": "ReturnStatement", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}}, "argument": null } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0001/output.json index ea1e209f24..23e0a043e2 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0001/output.json @@ -1,95 +1,29 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":1,"end":22,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":22}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":11,"end":22,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":22}}, "body": [ { "type": "ReturnStatement", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "argument": null } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0002/output.json index c0cd7f5516..b6cb58fdb0 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0002/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":1,"end":24,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":24}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":11,"end":24,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":24}}, "body": [ { "type": "ReturnStatement", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":13,"end":22,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":22}}, "argument": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0003/output.json index dc6bc1917e..129603ce64 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-return/migrated_0003/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":1,"end":27,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":27}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 11, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":11,"end":27,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":27}}, "body": [ { "type": "ReturnStatement", - "start": 13, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":13,"end":25,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":25}}, "argument": { "type": "BinaryExpression", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25}}, "left": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"x"}, "name": "x" }, "operator": "*", "right": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "y" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"y"}, "name": "y" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-switch/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/statement-switch/migrated_0000/output.json index 2676e60076..191390407c 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-switch/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-switch/migrated_0000/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "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}}, "discriminant": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, "cases": [] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-switch/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/statement-switch/migrated_0001/output.json index 26eb0ec7e2..34304235c8 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-switch/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-switch/migrated_0001/output.json @@ -1,124 +1,34 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "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}}, "discriminant": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "answer" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"answer"}, "name": "answer" }, "cases": [ { "type": "SwitchCase", - "start": 18, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":18,"end":39,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":39}}, "consequent": [ { "type": "ExpressionStatement", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32}}, "expression": { "type": "CallExpression", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31}}, "callee": { "type": "Identifier", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "hi" - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29},"identifierName":"hi"}, "name": "hi" }, "arguments": [] @@ -126,35 +36,13 @@ }, { "type": "BreakStatement", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":33,"end":39,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":39}}, "label": null } ], "test": { "type": "NumericLiteral", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/statement-switch/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/statement-switch/migrated_0002/output.json index 1295bdfcf9..e91e6f437f 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-switch/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-switch/migrated_0002/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "SwitchStatement", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "discriminant": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "answer" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"answer"}, "name": "answer" }, "cases": [ { "type": "SwitchCase", - "start": 18, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":18,"end":39,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":39}}, "consequent": [ { "type": "ExpressionStatement", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32}}, "expression": { "type": "CallExpression", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31}}, "callee": { "type": "Identifier", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "hi" - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29},"identifierName":"hi"}, "name": "hi" }, "arguments": [] @@ -126,35 +36,13 @@ }, { "type": "BreakStatement", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":33,"end":39,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":39}}, "label": null } ], "test": { "type": "NumericLiteral", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "extra": { "rawValue": 42, "raw": "42" @@ -164,33 +52,11 @@ }, { "type": "SwitchCase", - "start": 40, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":40,"end":54,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":54}}, "consequent": [ { "type": "BreakStatement", - "start": 49, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":49,"end":54,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":54}}, "label": null } ], diff --git a/packages/babel-parser/test/fixtures/esprima/statement-throw/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/statement-throw/migrated_0000/output.json index 4d485ddd96..16e82da75c 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-throw/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-throw/migrated_0000/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ThrowStatement", - "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}}, "argument": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-throw/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/statement-throw/migrated_0001/output.json index 0099a2d97e..2835e74689 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-throw/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-throw/migrated_0001/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ThrowStatement", - "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}}, "argument": { "type": "BinaryExpression", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "left": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "operator": "*", "right": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "y" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"y"}, "name": "y" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-throw/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/statement-throw/migrated_0002/output.json index ef879544f9..5caef91e52 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-throw/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-throw/migrated_0002/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ThrowStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "argument": { "type": "ObjectExpression", - "start": 6, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":6,"end":26,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":26}}, "properties": [ { "type": "ObjectProperty", - "start": 8, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":8,"end":24,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":24}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "message" - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15},"identifierName":"message"}, "name": "message" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}}, "extra": { "rawValue": "Error", "raw": "\"Error\"" diff --git a/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0000/output.json index 7124a7ba6f..cb43070c27 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0000/output.json @@ -1,110 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "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}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":8,"end":21,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":21}}, "param": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "e" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"e"}, "name": "e" }, "body": { "type": "BlockStatement", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0001/output.json index 0f104da5ae..bca060357b 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0001/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":8,"end":24,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":24}}, "param": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "eval" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"eval"}, "name": "eval" }, "body": { "type": "BlockStatement", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0002/output.json index 8721f9d984..d1a65bb67c 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0002/output.json @@ -1,110 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "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}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":8,"end":29,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":29}}, "param": { "type": "Identifier", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "arguments" - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24},"identifierName":"arguments"}, "name": "arguments" }, "body": { "type": "BlockStatement", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0003/output.json index 49094bb0e6..fb80b314fa 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0003/output.json @@ -1,172 +1,48 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 8, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":8,"end":28,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":28}}, "param": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "e" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"e"}, "name": "e" }, "body": { "type": "BlockStatement", - "start": 18, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":18,"end":28,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":28}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26}}, "expression": { "type": "CallExpression", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26}}, "callee": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "say" - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23},"identifierName":"say"}, "name": "say" }, "arguments": [ { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "e" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"e"}, "name": "e" } ] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0004/output.json index b1589f69dc..a079acf849 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0004/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "block": { "type": "BlockStatement", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "body": [], "directives": [] }, "handler": null, "finalizer": { "type": "BlockStatement", - "start": 16, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":16,"end":34,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":34}}, "body": [ { "type": "ExpressionStatement", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "expression": { "type": "CallExpression", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "callee": { "type": "Identifier", - "start": 18, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "cleanup" - }, + "start":18,"end":25,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":25},"identifierName":"cleanup"}, "name": "cleanup" }, "arguments": [ { "type": "Identifier", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "stuff" - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31},"identifierName":"stuff"}, "name": "stuff" } ] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0005/output.json index 7bb5acfbed..0453b860b1 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0005/output.json @@ -1,106 +1,28 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "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}}, "block": { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "expression": { "type": "CallExpression", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "callee": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "doThat" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"doThat"}, "name": "doThat" }, "arguments": [] @@ -111,111 +33,31 @@ }, "handler": { "type": "CatchClause", - "start": 18, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":18,"end":38,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":38}}, "param": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "e" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"e"}, "name": "e" }, "body": { "type": "BlockStatement", - "start": 28, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":28,"end":38,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":38}}, "body": [ { "type": "ExpressionStatement", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}}, "expression": { "type": "CallExpression", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}}, "callee": { "type": "Identifier", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "say" - }, + "start":30,"end":33,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":33},"identifierName":"say"}, "name": "say" }, "arguments": [ { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "e" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"e"}, "name": "e" } ] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0006/output.json index 91b0085400..bddc435c75 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-try/migrated_0006/output.json @@ -1,106 +1,28 @@ { "type": "File", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":65}}, "program": { "type": "Program", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":65}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":65}}, "block": { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "expression": { "type": "CallExpression", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "callee": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "doThat" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"doThat"}, "name": "doThat" }, "arguments": [] @@ -111,111 +33,31 @@ }, "handler": { "type": "CatchClause", - "start": 18, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":18,"end":38,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":38}}, "param": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "e" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"e"}, "name": "e" }, "body": { "type": "BlockStatement", - "start": 28, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":28,"end":38,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":38}}, "body": [ { "type": "ExpressionStatement", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}}, "expression": { "type": "CallExpression", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}}, "callee": { "type": "Identifier", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "say" - }, + "start":30,"end":33,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":33},"identifierName":"say"}, "name": "say" }, "arguments": [ { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "e" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"e"}, "name": "e" } ] @@ -227,80 +69,23 @@ }, "finalizer": { "type": "BlockStatement", - "start": 47, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":47,"end":65,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":65}}, "body": [ { "type": "ExpressionStatement", - "start": 49, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":49,"end":63,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":63}}, "expression": { "type": "CallExpression", - "start": 49, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":49,"end":63,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":63}}, "callee": { "type": "Identifier", - "start": 49, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 56 - }, - "identifierName": "cleanup" - }, + "start":49,"end":56,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":56},"identifierName":"cleanup"}, "name": "cleanup" }, "arguments": [ { "type": "Identifier", - "start": 57, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 62 - }, - "identifierName": "stuff" - }, + "start":57,"end":62,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":62},"identifierName":"stuff"}, "name": "stuff" } ] diff --git a/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/output.json b/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/output.json index 8c9fa87e49..0763ff9481 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-variable/complex-pattern-requires-init/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Complex binding patterns require an initialization value (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "ArrayPattern", - "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}}, "elements": [] }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0000/output.json index c2d1aa9e82..1fad75e9a9 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0000/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0001/output.json index 2292f444ff..765527f777 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0001/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": null }, { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "y" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"y"}, "name": "y" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0002/output.json index 338b1ef14f..26d684ab89 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0002/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0003/output.json b/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0003/output.json index 64faa9a0c0..46dc4683a1 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0003/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0003/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "eval" - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8},"identifierName":"eval"}, "name": "eval" }, "init": { "type": "NumericLiteral", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "extra": { "rawValue": 42, "raw": "42" @@ -98,49 +31,15 @@ }, { "type": "VariableDeclarator", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":15,"end":29,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":29}}, "id": { "type": "Identifier", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "arguments" - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24},"identifierName":"arguments"}, "name": "arguments" }, "init": { "type": "NumericLiteral", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0004/output.json b/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0004/output.json index cb147f686b..bdc2834baf 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0004/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0004/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": 14, "raw": "14" @@ -98,49 +31,15 @@ }, { "type": "VariableDeclarator", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "y" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"y"}, "name": "y" }, "init": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 3, "raw": "3" @@ -150,49 +49,15 @@ }, { "type": "VariableDeclarator", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "z" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"z"}, "name": "z" }, "init": { "type": "NumericLiteral", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27}}, "extra": { "rawValue": 1977, "raw": "1977" diff --git a/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0005/output.json b/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0005/output.json index d6d6794fe5..1c191ef723 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0005/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0005/output.json @@ -1,144 +1,42 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "implements" - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14},"identifierName":"implements"}, "name": "implements" }, "init": null }, { "type": "VariableDeclarator", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":16,"end":25,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "interface" - }, + "start":16,"end":25,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":25},"identifierName":"interface"}, "name": "interface" }, "init": null }, { "type": "VariableDeclarator", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "package" - }, + "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34},"identifierName":"package"}, "name": "package" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0006/output.json b/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0006/output.json index 4b8305ce1e..8a4c16c4b1 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0006/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-variable/migrated_0006/output.json @@ -1,177 +1,52 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "private" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"private"}, "name": "private" }, "init": null }, { "type": "VariableDeclarator", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":13,"end":22,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "protected" - }, + "start":13,"end":22,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":22},"identifierName":"protected"}, "name": "protected" }, "init": null }, { "type": "VariableDeclarator", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "public" - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30},"identifierName":"public"}, "name": "public" }, "init": null }, { "type": "VariableDeclarator", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}}, "id": { "type": "Identifier", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "static" - }, + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38},"identifierName":"static"}, "name": "static" }, "init": null diff --git a/packages/babel-parser/test/fixtures/esprima/statement-with/migrated_0000/output.json b/packages/babel-parser/test/fixtures/esprima/statement-with/migrated_0000/output.json index de556d5854..4e092c03ea 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-with/migrated_0000/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-with/migrated_0000/output.json @@ -1,126 +1,35 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WithStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "object": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "body": { "type": "ExpressionStatement", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "expression": { "type": "AssignmentExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "operator": "=", "left": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "bar" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-with/migrated_0001/output.json b/packages/babel-parser/test/fixtures/esprima/statement-with/migrated_0001/output.json index b8b6377905..4f5b295c2b 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-with/migrated_0001/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-with/migrated_0001/output.json @@ -1,126 +1,35 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WithStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "object": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "body": { "type": "ExpressionStatement", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19}}, "expression": { "type": "AssignmentExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "operator": "=", "left": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "bar" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/esprima/statement-with/migrated_0002/output.json b/packages/babel-parser/test/fixtures/esprima/statement-with/migrated_0002/output.json index 67715145c7..7675a58299 100644 --- a/packages/babel-parser/test/fixtures/esprima/statement-with/migrated_0002/output.json +++ b/packages/babel-parser/test/fixtures/esprima/statement-with/migrated_0002/output.json @@ -1,141 +1,39 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "WithStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "object": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "body": { "type": "BlockStatement", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "body": [ { "type": "ExpressionStatement", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20}}, "expression": { "type": "AssignmentExpression", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20}}, "operator": "=", "left": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "bar" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json b/packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json index eebbaebd13..610eff55fe 100644 --- a/packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json +++ b/packages/babel-parser/test/fixtures/estree/bigInt/basic/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "id": { "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" }, "init": { "type": "Literal", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "value": { "$$ babel internal serialized type": "BigInt", "value": "1" diff --git a/packages/babel-parser/test/fixtures/estree/class-method/basic/output.json b/packages/babel-parser/test/fixtures/estree/class-method/basic/output.json index 8d314eae24..61eec15d10 100644 --- a/packages/babel-parser/test/fixtures/estree/class-method/basic/output.json +++ b/packages/babel-parser/test/fixtures/estree/class-method/basic/output.json @@ -1,129 +1,39 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "MethodDefinition", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":12,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "foo" - }, + "start":12,"end":15,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"foo"}, "name": "foo" }, "computed": false, "kind": "method", "value": { "type": "FunctionExpression", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":15,"end":20,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":10}}, "id": null, "generator": false, "async": false, @@ -131,18 +41,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":18,"end":20,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":10}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/estree/class-method/flow/output.json b/packages/babel-parser/test/fixtures/estree/class-method/flow/output.json index acc15e6c1a..7e8990aa69 100644 --- a/packages/babel-parser/test/fixtures/estree/class-method/flow/output.json +++ b/packages/babel-parser/test/fixtures/estree/class-method/flow/output.json @@ -1,145 +1,43 @@ { "type": "File", - "start": 0, - "end": 102, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":102,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 102, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":102,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 102, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":102,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "NodeUtils" - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15},"identifierName":"NodeUtils"}, "name": "NodeUtils" }, "superClass": { "type": "Identifier", - "start": 24, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "UtilParser" - }, + "start":24,"end":34,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":34},"identifierName":"UtilParser"}, "name": "UtilParser" }, "body": { "type": "ClassBody", - "start": 35, - "end": 102, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":35,"end":102,"loc":{"start":{"line":1,"column":35},"end":{"line":5,"column":1}}, "body": [ { "type": "MethodDefinition", - "start": 39, - "end": 100, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":39,"end":100,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 39, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "finishNodeAt" - }, + "start":39,"end":51,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14},"identifierName":"finishNodeAt"}, "name": "finishNodeAt" }, "computed": false, "kind": "method", "value": { "type": "FunctionExpression", - "start": 65, - "end": 100, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":65,"end":100,"loc":{"start":{"line":2,"column":28},"end":{"line":4,"column":3}}, "id": null, "generator": false, "async": false, @@ -147,64 +45,18 @@ "params": [ { "type": "Identifier", - "start": 66, - "end": 73, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 36 - }, - "identifierName": "node" - }, + "start":66,"end":73,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":36},"identifierName":"node"}, "name": "node", "typeAnnotation": { "type": "TypeAnnotation", - "start": 70, - "end": 73, - "loc": { - "start": { - "line": 2, - "column": 33 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":70,"end":73,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":36}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 72, - "end": 73, - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":72,"end":73,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":36}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 72, - "end": 73, - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 36 - }, - "identifierName": "T" - }, + "start":72,"end":73,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":36},"identifierName":"T"}, "name": "T" } } @@ -214,96 +66,28 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 74, - "end": 77, - "loc": { - "start": { - "line": 2, - "column": 37 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":74,"end":77,"loc":{"start":{"line":2,"column":37},"end":{"line":2,"column":40}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 76, - "end": 77, - "loc": { - "start": { - "line": 2, - "column": 39 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":76,"end":77,"loc":{"start":{"line":2,"column":39},"end":{"line":2,"column":40}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 76, - "end": 77, - "loc": { - "start": { - "line": 2, - "column": 39 - }, - "end": { - "line": 2, - "column": 40 - }, - "identifierName": "T" - }, + "start":76,"end":77,"loc":{"start":{"line":2,"column":39},"end":{"line":2,"column":40},"identifierName":"T"}, "name": "T" } } }, "body": { "type": "BlockStatement", - "start": 78, - "end": 100, - "loc": { - "start": { - "line": 2, - "column": 41 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":78,"end":100,"loc":{"start":{"line":2,"column":41},"end":{"line":4,"column":3}}, "body": [ { "type": "ReturnStatement", - "start": 84, - "end": 96, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":84,"end":96,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":16}}, "argument": { "type": "Identifier", - "start": 91, - "end": 95, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "node" - }, + "start":91,"end":95,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":15},"identifierName":"node"}, "name": "node" } } @@ -311,79 +95,23 @@ }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 51, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":51,"end":65,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":28}}, "params": [ { "type": "TypeParameter", - "start": 52, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":52,"end":64,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":27}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 54, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":54,"end":64,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":27}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 56, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":56,"end":64,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":27}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 56, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "NodeType" - }, + "start":56,"end":64,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":27},"identifierName":"NodeType"}, "name": "NodeType" } } diff --git a/packages/babel-parser/test/fixtures/estree/class-method/typescript/output.json b/packages/babel-parser/test/fixtures/estree/class-method/typescript/output.json index 83a6337257..82f61bd8b8 100644 --- a/packages/babel-parser/test/fixtures/estree/class-method/typescript/output.json +++ b/packages/babel-parser/test/fixtures/estree/class-method/typescript/output.json @@ -1,131 +1,41 @@ { "type": "File", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "abstract": true, "id": { "type": "Identifier", - "start": 15, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "TSAbstractClass" - }, + "start":15,"end":30,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":30},"identifierName":"TSAbstractClass"}, "name": "TSAbstractClass" }, "superClass": null, "body": { "type": "ClassBody", - "start": 31, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":31,"end":73,"loc":{"start":{"line":1,"column":31},"end":{"line":3,"column":1}}, "body": [ { "type": "MethodDefinition", - "start": 35, - "end": 71, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":35,"end":71,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":38}}, "abstract": true, "static": false, "key": { "type": "Identifier", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "foo" - }, + "start":44,"end":47,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"foo"}, "name": "foo" }, "computed": false, "kind": "method", "value": { "type": "FunctionExpression", - "start": 47, - "end": 71, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":47,"end":71,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":38}}, "id": null, "generator": false, "async": false, @@ -133,80 +43,24 @@ "params": [ { "type": "Identifier", - "start": 48, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "name" - }, + "start":48,"end":60,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":27},"identifierName":"name"}, "name": "name", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 52, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":52,"end":60,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":27}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 54, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 27 - } - } + "start":54,"end":60,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":27}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 61, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":61,"end":70,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":37}}, "typeAnnotation": { "type": "TSBooleanKeyword", - "start": 63, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 37 - } - } + "start":63,"end":70,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":37}} } } } diff --git a/packages/babel-parser/test/fixtures/estree/directives/block/output.json b/packages/babel-parser/test/fixtures/estree/directives/block/output.json index 75a911187c..81955a57f9 100644 --- a/packages/babel-parser/test/fixtures/estree/directives/block/output.json +++ b/packages/babel-parser/test/fixtures/estree/directives/block/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -66,47 +21,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":15,"end":63,"loc":{"start":{"line":1,"column":15},"end":{"line":5,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":19,"end":32,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "expression": { "type": "Literal", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":19,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "value": "use strict", "raw": "\"use strict\"" }, @@ -114,64 +36,19 @@ }, { "type": "VariableDeclaration", - "start": 35, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":35,"end":45,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 39, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":39,"end":44,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "a" - }, + "start":39,"end":40,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7},"identifierName":"a"}, "name": "a" }, "init": { "type": "Literal", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":43,"end":44,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11}}, "value": 1, "raw": "1" } @@ -181,32 +58,10 @@ }, { "type": "ExpressionStatement", - "start": 48, - "end": 61, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":48,"end":61,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":15}}, "expression": { "type": "Literal", - "start": 48, - "end": 60, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":48,"end":60,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":14}}, "value": "use strict", "raw": "\"use strict\"" } diff --git a/packages/babel-parser/test/fixtures/estree/directives/function-non-strict/output.json b/packages/babel-parser/test/fixtures/estree/directives/function-non-strict/output.json index b886b1ed16..18f57d0b02 100644 --- a/packages/babel-parser/test/fixtures/estree/directives/function-non-strict/output.json +++ b/packages/babel-parser/test/fixtures/estree/directives/function-non-strict/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -66,47 +21,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":16,"end":39,"loc":{"start":{"line":1,"column":16},"end":{"line":4,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":20,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "expression": { "type": "Literal", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":20,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "value": "use smth", "raw": "\"use smth\"" }, @@ -114,64 +36,20 @@ }, { "type": "ExpressionStatement", - "start": 33, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":33,"end":37,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":6}}, "expression": { "type": "BinaryExpression", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":33,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5}}, "left": { "type": "Literal", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":33,"end":34,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3}}, "value": 1, "raw": "1" }, "operator": "+", "right": { "type": "Literal", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":35,"end":36,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5}}, "value": 1, "raw": "1" } diff --git a/packages/babel-parser/test/fixtures/estree/directives/program-order/output.json b/packages/babel-parser/test/fixtures/estree/directives/program-order/output.json index 80b8812fef..c03eb506b4 100644 --- a/packages/babel-parser/test/fixtures/estree/directives/program-order/output.json +++ b/packages/babel-parser/test/fixtures/estree/directives/program-order/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":6}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Literal", - "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}}, "value": "use strict", "raw": "\"use strict\"" }, @@ -64,32 +20,10 @@ }, { "type": "ExpressionStatement", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":14,"end":26,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "expression": { "type": "Literal", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "value": "use loose", "raw": "\"use loose\"" }, @@ -97,48 +31,14 @@ }, { "type": "VariableDeclaration", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":27,"end":33,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":6}}, "declarations": [ { "type": "VariableDeclarator", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":31,"end":32,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5}}, "id": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "a" - }, + "start":31,"end":32,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"a"}, "name": "a" }, "init": null diff --git a/packages/babel-parser/test/fixtures/estree/directives/program/output.json b/packages/babel-parser/test/fixtures/estree/directives/program/output.json index 60cb5221f5..645a584e45 100644 --- a/packages/babel-parser/test/fixtures/estree/directives/program/output.json +++ b/packages/babel-parser/test/fixtures/estree/directives/program/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":13}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Literal", - "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}}, "value": "use strict", "raw": "\"use strict\"" }, @@ -64,64 +20,19 @@ }, { "type": "VariableDeclaration", - "start": 14, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":14,"end":24,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":18,"end":23,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "a" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"}, "name": "a" }, "init": { "type": "Literal", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, "value": 1, "raw": "1" } @@ -131,32 +42,10 @@ }, { "type": "ExpressionStatement", - "start": 25, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":25,"end":38,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":13}}, "expression": { "type": "Literal", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":25,"end":37,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "value": "use strict", "raw": "\"use strict\"" } diff --git a/packages/babel-parser/test/fixtures/estree/directives/raw/output.json b/packages/babel-parser/test/fixtures/estree/directives/raw/output.json index 8193286a8c..97494837e4 100644 --- a/packages/babel-parser/test/fixtures/estree/directives/raw/output.json +++ b/packages/babel-parser/test/fixtures/estree/directives/raw/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Literal", - "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}}, "value": "use strict", "raw": "\"use\\x20strict\"" }, diff --git a/packages/babel-parser/test/fixtures/estree/dynamic-import/basic/output.json b/packages/babel-parser/test/fixtures/estree/dynamic-import/basic/output.json index be4caee8d6..342f38a3d5 100644 --- a/packages/babel-parser/test/fixtures/estree/dynamic-import/basic/output.json +++ b/packages/babel-parser/test/fixtures/estree/dynamic-import/basic/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":6,"end":21,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":21}}, "id": { "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" }, "init": { "type": "ImportExpression", - "start": 10, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21}}, "source": { "type": "Literal", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "value": "a", "raw": "\"a\"" } diff --git a/packages/babel-parser/test/fixtures/estree/export/batch/output.json b/packages/babel-parser/test/fixtures/estree/export/batch/output.json index 13118b1f2b..0cc8a7ebf2 100644 --- a/packages/babel-parser/test/fixtures/estree/export/batch/output.json +++ b/packages/babel-parser/test/fixtures/estree/export/batch/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportAllDeclaration", - "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}}, "source": { "type": "Literal", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "value": "foo", "raw": "\"foo\"" }, diff --git a/packages/babel-parser/test/fixtures/estree/export/ns-from/output.json b/packages/babel-parser/test/fixtures/estree/export/ns-from/output.json index 5b60865a3e..35d3ad7ebe 100644 --- a/packages/babel-parser/test/fixtures/estree/export/ns-from/output.json +++ b/packages/babel-parser/test/fixtures/estree/export/ns-from/output.json @@ -1,80 +1,24 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportAllDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "source": { "type": "Literal", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}}, "value": "test", "raw": "'test'" }, "exported": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "A" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"A"}, "name": "A" } } diff --git a/packages/babel-parser/test/fixtures/estree/flow/string-literal-annotation/output.json b/packages/babel-parser/test/fixtures/estree/flow/string-literal-annotation/output.json index 3d767e959f..d9c4cd6d8a 100644 --- a/packages/babel-parser/test/fixtures/estree/flow/string-literal-annotation/output.json +++ b/packages/babel-parser/test/fixtures/estree/flow/string-literal-annotation/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":4,"end":15,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":5,"end":15,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":15}}, "typeAnnotation": { "type": "StringLiteralTypeAnnotation", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "value": "string", "raw": "\"string\"" } diff --git a/packages/babel-parser/test/fixtures/estree/literal/boolean/output.json b/packages/babel-parser/test/fixtures/estree/literal/boolean/output.json index 4b390246bd..247785e656 100644 --- a/packages/babel-parser/test/fixtures/estree/literal/boolean/output.json +++ b/packages/babel-parser/test/fixtures/estree/literal/boolean/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": { "type": "Literal", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "value": true, "raw": "true" } @@ -98,64 +31,19 @@ }, { "type": "VariableDeclaration", - "start": 14, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":14,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":18,"end":27,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":13}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "b" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"b"}, "name": "b" }, "init": { "type": "Literal", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":22,"end":27,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":13}}, "value": false, "raw": "false" } diff --git a/packages/babel-parser/test/fixtures/estree/literal/null/output.json b/packages/babel-parser/test/fixtures/estree/literal/null/output.json index 450588b8a0..e262d408ca 100644 --- a/packages/babel-parser/test/fixtures/estree/literal/null/output.json +++ b/packages/babel-parser/test/fixtures/estree/literal/null/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": { "type": "Literal", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "value": null, "raw": "null" } diff --git a/packages/babel-parser/test/fixtures/estree/literal/number/output.json b/packages/babel-parser/test/fixtures/estree/literal/number/output.json index 46cbb6ce3a..a10c4906a6 100644 --- a/packages/babel-parser/test/fixtures/estree/literal/number/output.json +++ b/packages/babel-parser/test/fixtures/estree/literal/number/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": { "type": "Literal", - "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}}, "value": 1, "raw": "1" } diff --git a/packages/babel-parser/test/fixtures/estree/literal/regexp/output.json b/packages/babel-parser/test/fixtures/estree/literal/regexp/output.json index fccddbd97a..40d890c795 100644 --- a/packages/babel-parser/test/fixtures/estree/literal/regexp/output.json +++ b/packages/babel-parser/test/fixtures/estree/literal/regexp/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": { "type": "Literal", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "value": { "$$ babel internal serialized type": "RegExp", "source": ".*", diff --git a/packages/babel-parser/test/fixtures/estree/literal/string/output.json b/packages/babel-parser/test/fixtures/estree/literal/string/output.json index 5647bff910..a67865ea95 100644 --- a/packages/babel-parser/test/fixtures/estree/literal/string/output.json +++ b/packages/babel-parser/test/fixtures/estree/literal/string/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "a" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"a"}, "name": "a" }, "init": { "type": "Literal", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "value": "string", "raw": "\"string\"" } diff --git a/packages/babel-parser/test/fixtures/estree/object-method/basic/output.json b/packages/babel-parser/test/fixtures/estree/object-method/basic/output.json index 2f6b9a5c04..852471d6a7 100644 --- a/packages/babel-parser/test/fixtures/estree/object-method/basic/output.json +++ b/packages/babel-parser/test/fixtures/estree/object-method/basic/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":1}}, "id": { "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" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":24,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "properties": [ { "type": "Property", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":14,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10}}, "method": true, "key": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"foo"}, "name": "foo" }, "computed": false, "kind": "init", "value": { "type": "FunctionExpression", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":17,"end":22,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":10}}, "id": null, "generator": false, "async": false, @@ -145,18 +44,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":20,"end":22,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":10}}, "body": [] } }, diff --git a/packages/babel-parser/test/fixtures/estree/object-property/basic/output.json b/packages/babel-parser/test/fixtures/estree/object-property/basic/output.json index 8efc7583c3..760fb02d63 100644 --- a/packages/babel-parser/test/fixtures/estree/object-property/basic/output.json +++ b/packages/babel-parser/test/fixtures/estree/object-property/basic/output.json @@ -1,143 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":6,"end":20,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":20}}, "id": { "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" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "properties": [ { "type": "Property", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}}, "method": false, "key": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "foo" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": false, "value": { "type": "Literal", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "value": 1, "raw": "1" }, diff --git a/packages/babel-parser/test/fixtures/estree/typescript/enum/output.json b/packages/babel-parser/test/fixtures/estree/typescript/enum/output.json index 7a0e9a0cbb..0fe89b60ba 100644 --- a/packages/babel-parser/test/fixtures/estree/typescript/enum/output.json +++ b/packages/babel-parser/test/fixtures/estree/typescript/enum/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "members": [ { "type": "TSEnumMember", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"a"}, "name": "a" } }, { "type": "TSEnumMember", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":16,"end":19,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5}}, "id": { "type": "Literal", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":16,"end":19,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5}}, "value": "r", "raw": "\"r\"" } diff --git a/packages/babel-parser/test/fixtures/estree/typescript/import-require/output.json b/packages/babel-parser/test/fixtures/estree/typescript/import-require/output.json index 65361fdc83..5457c5086a 100644 --- a/packages/babel-parser/test/fixtures/estree/typescript/import-require/output.json +++ b/packages/babel-parser/test/fixtures/estree/typescript/import-require/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSImportEqualsDeclaration", - "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}}, "isExport": false, "id": { "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" }, "moduleReference": { "type": "TSExternalModuleReference", - "start": 11, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":11,"end":31,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":31}}, "expression": { "type": "Literal", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "value": "asdfasdf", "raw": "\"asdfasdf\"" } diff --git a/packages/babel-parser/test/fixtures/estree/typescript/import/output.json b/packages/babel-parser/test/fixtures/estree/typescript/import/output.json index 48ff04ded0..813e43851e 100644 --- a/packages/babel-parser/test/fixtures/estree/typescript/import/output.json +++ b/packages/babel-parser/test/fixtures/estree/typescript/import/output.json @@ -1,135 +1,35 @@ { "type": "File", - "start": 0, - "end": 89, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":0,"end":89,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 89, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":0,"end":89,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "x" - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":5,"end":27,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "TSTypeQuery", - "start": 7, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":7,"end":27,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":27}}, "exprName": { "type": "TSImportType", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":14,"end":27,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":27}}, "argument": { "type": "Literal", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26}}, "value": "./x", "raw": "'./x'" } @@ -144,109 +44,30 @@ }, { "type": "VariableDeclaration", - "start": 29, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":29,"end":52,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 33, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":33,"end":51,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":22}}, "id": { "type": "Identifier", - "start": 33, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "Y" - }, + "start":33,"end":51,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":22},"identifierName":"Y"}, "name": "Y", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 34, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":34,"end":51,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":22}}, "typeAnnotation": { "type": "TSImportType", - "start": 36, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":36,"end":51,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":22}}, "argument": { "type": "Literal", - "start": 43, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":43,"end":48,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":19}}, "value": "./y", "raw": "'./y'" }, "qualifier": { "type": "Identifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "Y" - }, + "start":50,"end":51,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22},"identifierName":"Y"}, "name": "Y" } } @@ -259,172 +80,48 @@ }, { "type": "VariableDeclaration", - "start": 53, - "end": 89, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":53,"end":89,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":36}}, "declarations": [ { "type": "VariableDeclarator", - "start": 57, - "end": 88, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":57,"end":88,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":35}}, "id": { "type": "Identifier", - "start": 57, - "end": 88, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 35 - }, - "identifierName": "z" - }, + "start":57,"end":88,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":35},"identifierName":"z"}, "name": "z", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 58, - "end": 88, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":58,"end":88,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":35}}, "typeAnnotation": { "type": "TSImportType", - "start": 60, - "end": 88, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":60,"end":88,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":35}}, "argument": { "type": "Literal", - "start": 67, - "end": 71, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":67,"end":71,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":18}}, "value": "/z", "raw": "\"/z\"" }, "qualifier": { "type": "TSQualifiedName", - "start": 73, - "end": 80, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":73,"end":80,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":27}}, "left": { "type": "Identifier", - "start": 73, - "end": 76, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 23 - }, - "identifierName": "foo" - }, + "start":73,"end":76,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":23},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "Identifier", - "start": 77, - "end": 80, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 27 - }, - "identifierName": "bar" - }, + "start":77,"end":80,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":27},"identifierName":"bar"}, "name": "bar" } }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 80, - "end": 88, - "loc": { - "start": { - "line": 3, - "column": 27 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":80,"end":88,"loc":{"start":{"line":3,"column":27},"end":{"line":3,"column":35}}, "params": [ { "type": "TSStringKeyword", - "start": 81, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 34 - } - } + "start":81,"end":87,"loc":{"start":{"line":3,"column":28},"end":{"line":3,"column":34}} } ] } diff --git a/packages/babel-parser/test/fixtures/estree/typescript/literals/output.json b/packages/babel-parser/test/fixtures/estree/typescript/literals/output.json index e08c9b31db..a0c8c7bd13 100644 --- a/packages/babel-parser/test/fixtures/estree/typescript/literals/output.json +++ b/packages/babel-parser/test/fixtures/estree/typescript/literals/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 131, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 19 - } - }, + "start":0,"end":131,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 131, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 19 - } - }, + "start":0,"end":131,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "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}}, "id": { "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" }, "typeAnnotation": { "type": "TSLiteralType", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "literal": { "type": "Literal", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "value": false, "raw": "false" } @@ -95,63 +28,18 @@ }, { "type": "TSTypeAliasDeclaration", - "start": 18, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":18,"end":35,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "id": { "type": "Identifier", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "Foo2" - }, + "start":23,"end":27,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":9},"identifierName":"Foo2"}, "name": "Foo2" }, "typeAnnotation": { "type": "TSLiteralType", - "start": 30, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":30,"end":34,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":16}}, "literal": { "type": "Literal", - "start": 30, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":30,"end":34,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":16}}, "value": true, "raw": "true" } @@ -159,63 +47,18 @@ }, { "type": "TSTypeAliasDeclaration", - "start": 36, - "end": 57, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":36,"end":57,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":21}}, "id": { "type": "Identifier", - "start": 41, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "Foo3" - }, + "start":41,"end":45,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":9},"identifierName":"Foo3"}, "name": "Foo3" }, "typeAnnotation": { "type": "TSLiteralType", - "start": 48, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":48,"end":56,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":20}}, "literal": { "type": "Literal", - "start": 48, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":48,"end":56,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":20}}, "value": "string", "raw": "\"string\"" } @@ -223,63 +66,18 @@ }, { "type": "TSTypeAliasDeclaration", - "start": 58, - "end": 74, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 16 - } - }, + "start":58,"end":74,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":16}}, "id": { "type": "Identifier", - "start": 63, - "end": 67, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 9 - }, - "identifierName": "Foo4" - }, + "start":63,"end":67,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":9},"identifierName":"Foo4"}, "name": "Foo4" }, "typeAnnotation": { "type": "TSLiteralType", - "start": 70, - "end": 73, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":70,"end":73,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":15}}, "literal": { "type": "Literal", - "start": 70, - "end": 73, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":70,"end":73,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":15}}, "value": 123, "raw": "123" } @@ -287,63 +85,18 @@ }, { "type": "TSTypeAliasDeclaration", - "start": 75, - "end": 93, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 18 - } - }, + "start":75,"end":93,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":18}}, "id": { "type": "Identifier", - "start": 80, - "end": 84, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 9 - }, - "identifierName": "Foo5" - }, + "start":80,"end":84,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":9},"identifierName":"Foo5"}, "name": "Foo5" }, "typeAnnotation": { "type": "TSLiteralType", - "start": 87, - "end": 92, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 17 - } - }, + "start":87,"end":92,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":17}}, "literal": { "type": "Literal", - "start": 87, - "end": 92, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 17 - } - }, + "start":87,"end":92,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":17}}, "value": 123.4, "raw": "123.4" } @@ -351,79 +104,23 @@ }, { "type": "TSTypeAliasDeclaration", - "start": 94, - "end": 111, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":94,"end":111,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":17}}, "id": { "type": "Identifier", - "start": 99, - "end": 103, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 9 - }, - "identifierName": "Foo6" - }, + "start":99,"end":103,"loc":{"start":{"line":6,"column":5},"end":{"line":6,"column":9},"identifierName":"Foo6"}, "name": "Foo6" }, "typeAnnotation": { "type": "TSLiteralType", - "start": 106, - "end": 110, - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 16 - } - }, + "start":106,"end":110,"loc":{"start":{"line":6,"column":12},"end":{"line":6,"column":16}}, "literal": { "type": "UnaryExpression", - "start": 106, - "end": 110, - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 16 - } - }, + "start":106,"end":110,"loc":{"start":{"line":6,"column":12},"end":{"line":6,"column":16}}, "operator": "-", "prefix": true, "argument": { "type": "Literal", - "start": 107, - "end": 110, - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 6, - "column": 16 - } - }, + "start":107,"end":110,"loc":{"start":{"line":6,"column":13},"end":{"line":6,"column":16}}, "value": 123, "raw": "123" } @@ -432,79 +129,23 @@ }, { "type": "TSTypeAliasDeclaration", - "start": 112, - "end": 131, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 19 - } - }, + "start":112,"end":131,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":19}}, "id": { "type": "Identifier", - "start": 117, - "end": 121, - "loc": { - "start": { - "line": 7, - "column": 5 - }, - "end": { - "line": 7, - "column": 9 - }, - "identifierName": "Foo7" - }, + "start":117,"end":121,"loc":{"start":{"line":7,"column":5},"end":{"line":7,"column":9},"identifierName":"Foo7"}, "name": "Foo7" }, "typeAnnotation": { "type": "TSLiteralType", - "start": 124, - "end": 130, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 18 - } - }, + "start":124,"end":130,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":18}}, "literal": { "type": "UnaryExpression", - "start": 124, - "end": 130, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 18 - } - }, + "start":124,"end":130,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":18}}, "operator": "-", "prefix": true, "argument": { "type": "Literal", - "start": 125, - "end": 130, - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 18 - } - }, + "start":125,"end":130,"loc":{"start":{"line":7,"column":13},"end":{"line":7,"column":18}}, "value": 123.5, "raw": "123.5" } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/async-generator/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/async-generator/output.json index 15456d810c..b8cbd6ca0a 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/async-generator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-methods/async-generator/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 212, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 13, - "column": 1 - } - }, + "start":0,"end":212,"loc":{"start":{"line":1,"column":0},"end":{"line":13,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 212, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 13, - "column": 1 - } - }, + "start":0,"end":212,"loc":{"start":{"line":1,"column":0},"end":{"line":13,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 212, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 13, - "column": 1 - } - }, + "start":0,"end":212,"loc":{"start":{"line":1,"column":0},"end":{"line":13,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 212, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 13, - "column": 1 - } - }, + "start":10,"end":212,"loc":{"start":{"line":1,"column":10},"end":{"line":13,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 14, - "end": 210, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 12, - "column": 3 - } - }, + "start":14,"end":210,"loc":{"start":{"line":2,"column":2},"end":{"line":12,"column":3}}, "static": false, "key": { "type": "PrivateName", - "start": 21, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":21,"end":31,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":19}}, "id": { "type": "Identifier", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "readLines" - }, + "start":22,"end":31,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":19},"identifierName":"readLines"}, "name": "readLines" } }, @@ -131,144 +41,41 @@ "params": [ { "type": "Identifier", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "path" - }, + "start":32,"end":36,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":24},"identifierName":"path"}, "name": "path" } ], "body": { "type": "BlockStatement", - "start": 38, - "end": 210, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 12, - "column": 3 - } - }, + "start":38,"end":210,"loc":{"start":{"line":2,"column":26},"end":{"line":12,"column":3}}, "body": [ { "type": "VariableDeclaration", - "start": 44, - "end": 76, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":44,"end":76,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":36}}, "declarations": [ { "type": "VariableDeclarator", - "start": 48, - "end": 75, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":48,"end":75,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":35}}, "id": { "type": "Identifier", - "start": 48, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 12 - }, - "identifierName": "file" - }, + "start":48,"end":52,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":12},"identifierName":"file"}, "name": "file" }, "init": { "type": "AwaitExpression", - "start": 55, - "end": 75, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":55,"end":75,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":35}}, "argument": { "type": "CallExpression", - "start": 61, - "end": 75, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":61,"end":75,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":35}}, "callee": { "type": "Identifier", - "start": 61, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 29 - }, - "identifierName": "fileOpen" - }, + "start":61,"end":69,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":29},"identifierName":"fileOpen"}, "name": "fileOpen" }, "arguments": [ { "type": "Identifier", - "start": 70, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 34 - }, - "identifierName": "path" - }, + "start":70,"end":74,"loc":{"start":{"line":3,"column":30},"end":{"line":3,"column":34},"identifierName":"path"}, "name": "path" } ] @@ -280,109 +87,30 @@ }, { "type": "TryStatement", - "start": 82, - "end": 206, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 11, - "column": 5 - } - }, + "start":82,"end":206,"loc":{"start":{"line":5,"column":4},"end":{"line":11,"column":5}}, "block": { "type": "BlockStatement", - "start": 86, - "end": 164, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 9, - "column": 5 - } - }, + "start":86,"end":164,"loc":{"start":{"line":5,"column":8},"end":{"line":9,"column":5}}, "body": [ { "type": "WhileStatement", - "start": 94, - "end": 158, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 8, - "column": 7 - } - }, + "start":94,"end":158,"loc":{"start":{"line":6,"column":6},"end":{"line":8,"column":7}}, "test": { "type": "UnaryExpression", - "start": 101, - "end": 110, - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 6, - "column": 22 - } - }, + "start":101,"end":110,"loc":{"start":{"line":6,"column":13},"end":{"line":6,"column":22}}, "operator": "!", "prefix": true, "argument": { "type": "MemberExpression", - "start": 102, - "end": 110, - "loc": { - "start": { - "line": 6, - "column": 14 - }, - "end": { - "line": 6, - "column": 22 - } - }, + "start":102,"end":110,"loc":{"start":{"line":6,"column":14},"end":{"line":6,"column":22}}, "object": { "type": "Identifier", - "start": 102, - "end": 106, - "loc": { - "start": { - "line": 6, - "column": 14 - }, - "end": { - "line": 6, - "column": 18 - }, - "identifierName": "file" - }, + "start":102,"end":106,"loc":{"start":{"line":6,"column":14},"end":{"line":6,"column":18},"identifierName":"file"}, "name": "file" }, "property": { "type": "Identifier", - "start": 107, - "end": 110, - "loc": { - "start": { - "line": 6, - "column": 19 - }, - "end": { - "line": 6, - "column": 22 - }, - "identifierName": "EOF" - }, + "start":107,"end":110,"loc":{"start":{"line":6,"column":19},"end":{"line":6,"column":22},"identifierName":"EOF"}, "name": "EOF" }, "computed": false @@ -390,122 +118,32 @@ }, "body": { "type": "BlockStatement", - "start": 112, - "end": 158, - "loc": { - "start": { - "line": 6, - "column": 24 - }, - "end": { - "line": 8, - "column": 7 - } - }, + "start":112,"end":158,"loc":{"start":{"line":6,"column":24},"end":{"line":8,"column":7}}, "body": [ { "type": "ExpressionStatement", - "start": 122, - "end": 150, - "loc": { - "start": { - "line": 7, - "column": 8 - }, - "end": { - "line": 7, - "column": 36 - } - }, + "start":122,"end":150,"loc":{"start":{"line":7,"column":8},"end":{"line":7,"column":36}}, "expression": { "type": "YieldExpression", - "start": 122, - "end": 149, - "loc": { - "start": { - "line": 7, - "column": 8 - }, - "end": { - "line": 7, - "column": 35 - } - }, + "start":122,"end":149,"loc":{"start":{"line":7,"column":8},"end":{"line":7,"column":35}}, "delegate": false, "argument": { "type": "AwaitExpression", - "start": 128, - "end": 149, - "loc": { - "start": { - "line": 7, - "column": 14 - }, - "end": { - "line": 7, - "column": 35 - } - }, + "start":128,"end":149,"loc":{"start":{"line":7,"column":14},"end":{"line":7,"column":35}}, "argument": { "type": "CallExpression", - "start": 134, - "end": 149, - "loc": { - "start": { - "line": 7, - "column": 20 - }, - "end": { - "line": 7, - "column": 35 - } - }, + "start":134,"end":149,"loc":{"start":{"line":7,"column":20},"end":{"line":7,"column":35}}, "callee": { "type": "MemberExpression", - "start": 134, - "end": 147, - "loc": { - "start": { - "line": 7, - "column": 20 - }, - "end": { - "line": 7, - "column": 33 - } - }, + "start":134,"end":147,"loc":{"start":{"line":7,"column":20},"end":{"line":7,"column":33}}, "object": { "type": "Identifier", - "start": 134, - "end": 138, - "loc": { - "start": { - "line": 7, - "column": 20 - }, - "end": { - "line": 7, - "column": 24 - }, - "identifierName": "file" - }, + "start":134,"end":138,"loc":{"start":{"line":7,"column":20},"end":{"line":7,"column":24},"identifierName":"file"}, "name": "file" }, "property": { "type": "Identifier", - "start": 139, - "end": 147, - "loc": { - "start": { - "line": 7, - "column": 25 - }, - "end": { - "line": 7, - "column": 33 - }, - "identifierName": "readLine" - }, + "start":139,"end":147,"loc":{"start":{"line":7,"column":25},"end":{"line":7,"column":33},"identifierName":"readLine"}, "name": "readLine" }, "computed": false @@ -525,107 +163,28 @@ "handler": null, "finalizer": { "type": "BlockStatement", - "start": 173, - "end": 206, - "loc": { - "start": { - "line": 9, - "column": 14 - }, - "end": { - "line": 11, - "column": 5 - } - }, + "start":173,"end":206,"loc":{"start":{"line":9,"column":14},"end":{"line":11,"column":5}}, "body": [ { "type": "ExpressionStatement", - "start": 181, - "end": 200, - "loc": { - "start": { - "line": 10, - "column": 6 - }, - "end": { - "line": 10, - "column": 25 - } - }, + "start":181,"end":200,"loc":{"start":{"line":10,"column":6},"end":{"line":10,"column":25}}, "expression": { "type": "AwaitExpression", - "start": 181, - "end": 199, - "loc": { - "start": { - "line": 10, - "column": 6 - }, - "end": { - "line": 10, - "column": 24 - } - }, + "start":181,"end":199,"loc":{"start":{"line":10,"column":6},"end":{"line":10,"column":24}}, "argument": { "type": "CallExpression", - "start": 187, - "end": 199, - "loc": { - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 10, - "column": 24 - } - }, + "start":187,"end":199,"loc":{"start":{"line":10,"column":12},"end":{"line":10,"column":24}}, "callee": { "type": "MemberExpression", - "start": 187, - "end": 197, - "loc": { - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 10, - "column": 22 - } - }, + "start":187,"end":197,"loc":{"start":{"line":10,"column":12},"end":{"line":10,"column":22}}, "object": { "type": "Identifier", - "start": 187, - "end": 191, - "loc": { - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 10, - "column": 16 - }, - "identifierName": "file" - }, + "start":187,"end":191,"loc":{"start":{"line":10,"column":12},"end":{"line":10,"column":16},"identifierName":"file"}, "name": "file" }, "property": { "type": "Identifier", - "start": 192, - "end": 197, - "loc": { - "start": { - "line": 10, - "column": 17 - }, - "end": { - "line": 10, - "column": 22 - }, - "identifierName": "close" - }, + "start":192,"end":197,"loc":{"start":{"line":10,"column":17},"end":{"line":10,"column":22},"identifierName":"close"}, "name": "close" }, "computed": false diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/async/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/async/output.json index f1d0b408d3..110900de77 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/async/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-methods/async/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "Hotel" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"Hotel"}, "name": "Hotel" }, "superClass": null, "body": { "type": "ClassBody", - "start": 12, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":12,"end":60,"loc":{"start":{"line":1,"column":12},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 16, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":16,"end":58,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "static": false, "key": { "type": "PrivateName", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":22,"end":27,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":13}}, "id": { "type": "Identifier", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "evil" - }, + "start":23,"end":27,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":13},"identifierName":"evil"}, "name": "evil" } }, @@ -131,76 +41,20 @@ "params": [], "body": { "type": "BlockStatement", - "start": 30, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":30,"end":58,"loc":{"start":{"line":2,"column":16},"end":{"line":4,"column":3}}, "body": [ { "type": "ExpressionStatement", - "start": 36, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":36,"end":54,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":22}}, "expression": { "type": "AwaitExpression", - "start": 36, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":36,"end":53,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":21}}, "argument": { "type": "CallExpression", - "start": 42, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":42,"end":53,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":21}}, "callee": { "type": "Identifier", - "start": 42, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 19 - }, - "identifierName": "notReally" - }, + "start":42,"end":51,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":19},"identifierName":"notReally"}, "name": "notReally" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/combined/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/combined/output.json index 68e29ceab9..d423f26aeb 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/combined/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-methods/combined/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 159, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 16, - "column": 1 - } - }, + "start":0,"end":159,"loc":{"start":{"line":1,"column":0},"end":{"line":16,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 159, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 16, - "column": 1 - } - }, + "start":0,"end":159,"loc":{"start":{"line":1,"column":0},"end":{"line":16,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 159, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 16, - "column": 1 - } - }, + "start":0,"end":159,"loc":{"start":{"line":1,"column":0},"end":{"line":16,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 159, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 16, - "column": 1 - } - }, + "start":10,"end":159,"loc":{"start":{"line":1,"column":10},"end":{"line":16,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":14,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "a" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "value": { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -132,49 +42,15 @@ }, { "type": "ClassPrivateMethod", - "start": 24, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":24,"end":52,"loc":{"start":{"line":4,"column":2},"end":{"line":6,"column":3}}, "static": false, "kind": "method", "key": { "type": "PrivateName", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 4, - "column": 3 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":25,"end":27,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":5}}, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "a" - }, + "start":26,"end":27,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":5},"identifierName":"a"}, "name": "a" } }, @@ -184,77 +60,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 30, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":30,"end":52,"loc":{"start":{"line":4,"column":8},"end":{"line":6,"column":3}}, "body": [ { "type": "ExpressionStatement", - "start": 36, - "end": 48, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 16 - } - }, + "start":36,"end":48,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":16}}, "expression": { "type": "YieldExpression", - "start": 36, - "end": 47, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":36,"end":47,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":15}}, "delegate": false, "argument": { "type": "CallExpression", - "start": 42, - "end": 47, - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":42,"end":47,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":15}}, "callee": { "type": "Identifier", - "start": 42, - "end": 45, - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 13 - }, - "identifierName": "bar" - }, + "start":42,"end":45,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":13},"identifierName":"bar"}, "name": "bar" }, "arguments": [] @@ -267,65 +87,20 @@ }, { "type": "ClassPrivateProperty", - "start": 56, - "end": 63, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 9 - } - }, + "start":56,"end":63,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 56, - "end": 58, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 4 - } - }, + "start":56,"end":58,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":4}}, "id": { "type": "Identifier", - "start": 57, - "end": 58, - "loc": { - "start": { - "line": 8, - "column": 3 - }, - "end": { - "line": 8, - "column": 4 - }, - "identifierName": "b" - }, + "start":57,"end":58,"loc":{"start":{"line":8,"column":3},"end":{"line":8,"column":4},"identifierName":"b"}, "name": "b" } }, "value": { "type": "NumericLiteral", - "start": 61, - "end": 62, - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 8 - } - }, + "start":61,"end":62,"loc":{"start":{"line":8,"column":7},"end":{"line":8,"column":8}}, "extra": { "rawValue": 2, "raw": "2" @@ -335,34 +110,11 @@ }, { "type": "ClassMethod", - "start": 67, - "end": 91, - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 10, - "column": 26 - } - }, + "start":67,"end":91,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":26}}, "static": false, "key": { "type": "Identifier", - "start": 71, - "end": 72, - "loc": { - "start": { - "line": 10, - "column": 6 - }, - "end": { - "line": 10, - "column": 7 - }, - "identifierName": "b" - }, + "start":71,"end":72,"loc":{"start":{"line":10,"column":6},"end":{"line":10,"column":7},"identifierName":"b"}, "name": "b" }, "computed": false, @@ -373,47 +125,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 75, - "end": 91, - "loc": { - "start": { - "line": 10, - "column": 10 - }, - "end": { - "line": 10, - "column": 26 - } - }, + "start":75,"end":91,"loc":{"start":{"line":10,"column":10},"end":{"line":10,"column":26}}, "body": [ { "type": "ReturnStatement", - "start": 77, - "end": 89, - "loc": { - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 10, - "column": 24 - } - }, + "start":77,"end":89,"loc":{"start":{"line":10,"column":12},"end":{"line":10,"column":24}}, "argument": { "type": "NumericLiteral", - "start": 84, - "end": 88, - "loc": { - "start": { - "line": 10, - "column": 19 - }, - "end": { - "line": 10, - "column": 23 - } - }, + "start":84,"end":88,"loc":{"start":{"line":10,"column":19},"end":{"line":10,"column":23}}, "extra": { "rawValue": 9999, "raw": "9999" @@ -427,48 +146,14 @@ }, { "type": "ClassPrivateMethod", - "start": 94, - "end": 117, - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 11, - "column": 25 - } - }, + "start":94,"end":117,"loc":{"start":{"line":11,"column":2},"end":{"line":11,"column":25}}, "static": false, "key": { "type": "PrivateName", - "start": 98, - "end": 100, - "loc": { - "start": { - "line": 11, - "column": 6 - }, - "end": { - "line": 11, - "column": 8 - } - }, + "start":98,"end":100,"loc":{"start":{"line":11,"column":6},"end":{"line":11,"column":8}}, "id": { "type": "Identifier", - "start": 99, - "end": 100, - "loc": { - "start": { - "line": 11, - "column": 7 - }, - "end": { - "line": 11, - "column": 8 - }, - "identifierName": "c" - }, + "start":99,"end":100,"loc":{"start":{"line":11,"column":7},"end":{"line":11,"column":8},"identifierName":"c"}, "name": "c" } }, @@ -480,66 +165,20 @@ "params": [ { "type": "Identifier", - "start": 101, - "end": 102, - "loc": { - "start": { - "line": 11, - "column": 9 - }, - "end": { - "line": 11, - "column": 10 - }, - "identifierName": "x" - }, + "start":101,"end":102,"loc":{"start":{"line":11,"column":9},"end":{"line":11,"column":10},"identifierName":"x"}, "name": "x" } ], "body": { "type": "BlockStatement", - "start": 104, - "end": 117, - "loc": { - "start": { - "line": 11, - "column": 12 - }, - "end": { - "line": 11, - "column": 25 - } - }, + "start":104,"end":117,"loc":{"start":{"line":11,"column":12},"end":{"line":11,"column":25}}, "body": [ { "type": "ReturnStatement", - "start": 106, - "end": 115, - "loc": { - "start": { - "line": 11, - "column": 14 - }, - "end": { - "line": 11, - "column": 23 - } - }, + "start":106,"end":115,"loc":{"start":{"line":11,"column":14},"end":{"line":11,"column":23}}, "argument": { "type": "Identifier", - "start": 113, - "end": 114, - "loc": { - "start": { - "line": 11, - "column": 21 - }, - "end": { - "line": 11, - "column": 22 - }, - "identifierName": "x" - }, + "start":113,"end":114,"loc":{"start":{"line":11,"column":21},"end":{"line":11,"column":22},"identifierName":"x"}, "name": "x" } } @@ -549,48 +188,14 @@ }, { "type": "ClassPrivateMethod", - "start": 121, - "end": 157, - "loc": { - "start": { - "line": 13, - "column": 2 - }, - "end": { - "line": 15, - "column": 3 - } - }, + "start":121,"end":157,"loc":{"start":{"line":13,"column":2},"end":{"line":15,"column":3}}, "static": false, "key": { "type": "PrivateName", - "start": 121, - "end": 123, - "loc": { - "start": { - "line": 13, - "column": 2 - }, - "end": { - "line": 13, - "column": 4 - } - }, + "start":121,"end":123,"loc":{"start":{"line":13,"column":2},"end":{"line":13,"column":4}}, "id": { "type": "Identifier", - "start": 122, - "end": 123, - "loc": { - "start": { - "line": 13, - "column": 3 - }, - "end": { - "line": 13, - "column": 4 - }, - "identifierName": "d" - }, + "start":122,"end":123,"loc":{"start":{"line":13,"column":3},"end":{"line":13,"column":4},"identifierName":"d"}, "name": "d" } }, @@ -601,93 +206,25 @@ "params": [], "body": { "type": "BlockStatement", - "start": 126, - "end": 157, - "loc": { - "start": { - "line": 13, - "column": 7 - }, - "end": { - "line": 15, - "column": 3 - } - }, + "start":126,"end":157,"loc":{"start":{"line":13,"column":7},"end":{"line":15,"column":3}}, "body": [ { "type": "ReturnStatement", - "start": 132, - "end": 153, - "loc": { - "start": { - "line": 14, - "column": 4 - }, - "end": { - "line": 14, - "column": 25 - } - }, + "start":132,"end":153,"loc":{"start":{"line":14,"column":4},"end":{"line":14,"column":25}}, "argument": { "type": "CallExpression", - "start": 139, - "end": 152, - "loc": { - "start": { - "line": 14, - "column": 11 - }, - "end": { - "line": 14, - "column": 24 - } - }, + "start":139,"end":152,"loc":{"start":{"line":14,"column":11},"end":{"line":14,"column":24}}, "callee": { "type": "MemberExpression", - "start": 139, - "end": 150, - "loc": { - "start": { - "line": 14, - "column": 11 - }, - "end": { - "line": 14, - "column": 22 - } - }, + "start":139,"end":150,"loc":{"start":{"line":14,"column":11},"end":{"line":14,"column":22}}, "object": { "type": "Identifier", - "start": 139, - "end": 143, - "loc": { - "start": { - "line": 14, - "column": 11 - }, - "end": { - "line": 14, - "column": 15 - }, - "identifierName": "Math" - }, + "start":139,"end":143,"loc":{"start":{"line":14,"column":11},"end":{"line":14,"column":15},"identifierName":"Math"}, "name": "Math" }, "property": { "type": "Identifier", - "start": 144, - "end": 150, - "loc": { - "start": { - "line": 14, - "column": 16 - }, - "end": { - "line": 14, - "column": 22 - }, - "identifierName": "random" - }, + "start":144,"end":150,"loc":{"start":{"line":14,"column":16},"end":{"line":14,"column":22},"identifierName":"random"}, "name": "random" }, "computed": false diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json index 342fc174b5..b1975e9de1 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-name-constructor/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Classes may not have a private field named '#constructor' (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":34,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 14, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":14,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "static": false, "key": { "type": "PrivateName", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":14,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 15, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "constructor" - }, + "start":15,"end":26,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":14},"identifierName":"constructor"}, "name": "constructor" } }, @@ -133,18 +43,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/output.json index e126bf7fb5..bda07d6588 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-methods/failure-spaces/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: Unexpected space between # and identifier (2:3)" ], "program": { "type": "Program", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "Spaces" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"Spaces"}, "name": "Spaces" }, "superClass": null, "body": { "type": "ClassBody", - "start": 13, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":13,"end":60,"loc":{"start":{"line":1,"column":13},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 17, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":17,"end":58,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "static": false, "key": { "type": "PrivateName", - "start": 17, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":17,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "id": { "type": "Identifier", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "wrongSpaces" - }, + "start":20,"end":31,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":16},"identifierName":"wrongSpaces"}, "name": "wrongSpaces" } }, @@ -133,62 +43,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 34, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":34,"end":58,"loc":{"start":{"line":2,"column":19},"end":{"line":4,"column":3}}, "body": [ { "type": "ReturnStatement", - "start": 40, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":40,"end":54,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":18}}, "argument": { "type": "CallExpression", - "start": 47, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":47,"end":53,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":17}}, "callee": { "type": "Identifier", - "start": 47, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "fail" - }, + "start":47,"end":51,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":15},"identifierName":"fail"}, "name": "fail" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/generator/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/generator/output.json index 03ba962264..8f10de0fce 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/generator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-methods/generator/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "Hotel" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"Hotel"}, "name": "Hotel" }, "superClass": null, "body": { "type": "ClassBody", - "start": 12, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":12,"end":55,"loc":{"start":{"line":1,"column":12},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 16, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":16,"end":53,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "static": false, "kind": "method", "key": { "type": "PrivateName", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":17,"end":22,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "evil" - }, + "start":18,"end":22,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":8},"identifierName":"evil"}, "name": "evil" } }, @@ -130,77 +40,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 25, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":25,"end":53,"loc":{"start":{"line":2,"column":11},"end":{"line":4,"column":3}}, "body": [ { "type": "ExpressionStatement", - "start": 31, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":31,"end":49,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":22}}, "expression": { "type": "YieldExpression", - "start": 31, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":31,"end":48,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":21}}, "delegate": false, "argument": { "type": "CallExpression", - "start": 37, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":37,"end":48,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":21}}, "callee": { "type": "Identifier", - "start": 37, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 19 - }, - "identifierName": "notReally" - }, + "start":37,"end":46,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":19},"identifierName":"notReally"}, "name": "notReally" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/get-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/get-set/output.json index 70e1196943..4d6dc0a81a 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/get-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-methods/get-set/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 99, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":0,"end":99,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 99, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":0,"end":99,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 99, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":0,"end":99,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "Hotel" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"Hotel"}, "name": "Hotel" }, "superClass": null, "body": { "type": "ClassBody", - "start": 12, - "end": 99, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":12,"end":99,"loc":{"start":{"line":1,"column":12},"end":{"line":8,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 16, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":16,"end":52,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "static": false, "key": { "type": "PrivateName", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":20,"end":25,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 21, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "evil" - }, + "start":21,"end":25,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":11},"identifierName":"evil"}, "name": "evil" } }, @@ -131,62 +41,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":28,"end":52,"loc":{"start":{"line":2,"column":14},"end":{"line":4,"column":3}}, "body": [ { "type": "ReturnStatement", - "start": 34, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":34,"end":48,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":18}}, "argument": { "type": "CallExpression", - "start": 41, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":41,"end":47,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":17}}, "callee": { "type": "Identifier", - "start": 41, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "ohNo" - }, + "start":41,"end":45,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":15},"identifierName":"ohNo"}, "name": "ohNo" }, "arguments": [] @@ -198,48 +63,14 @@ }, { "type": "ClassPrivateMethod", - "start": 55, - "end": 97, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":55,"end":97,"loc":{"start":{"line":5,"column":2},"end":{"line":7,"column":3}}, "static": false, "key": { "type": "PrivateName", - "start": 59, - "end": 64, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":59,"end":64,"loc":{"start":{"line":5,"column":6},"end":{"line":5,"column":11}}, "id": { "type": "Identifier", - "start": 60, - "end": 64, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 11 - }, - "identifierName": "evil" - }, + "start":60,"end":64,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":11},"identifierName":"evil"}, "name": "evil" } }, @@ -251,98 +82,29 @@ "params": [ { "type": "Identifier", - "start": 65, - "end": 66, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 13 - }, - "identifierName": "x" - }, + "start":65,"end":66,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":13},"identifierName":"x"}, "name": "x" } ], "body": { "type": "BlockStatement", - "start": 68, - "end": 97, - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":68,"end":97,"loc":{"start":{"line":5,"column":15},"end":{"line":7,"column":3}}, "body": [ { "type": "ReturnStatement", - "start": 74, - "end": 93, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 23 - } - }, + "start":74,"end":93,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":23}}, "argument": { "type": "CallExpression", - "start": 81, - "end": 92, - "loc": { - "start": { - "line": 6, - "column": 11 - }, - "end": { - "line": 6, - "column": 22 - } - }, + "start":81,"end":92,"loc":{"start":{"line":6,"column":11},"end":{"line":6,"column":22}}, "callee": { "type": "Identifier", - "start": 81, - "end": 89, - "loc": { - "start": { - "line": 6, - "column": 11 - }, - "end": { - "line": 6, - "column": 19 - }, - "identifierName": "makeEvil" - }, + "start":81,"end":89,"loc":{"start":{"line":6,"column":11},"end":{"line":6,"column":19},"identifierName":"makeEvil"}, "name": "makeEvil" }, "arguments": [ { "type": "Identifier", - "start": 90, - "end": 91, - "loc": { - "start": { - "line": 6, - "column": 20 - }, - "end": { - "line": 6, - "column": 21 - }, - "identifierName": "x" - }, + "start":90,"end":91,"loc":{"start":{"line":6,"column":20},"end":{"line":6,"column":21},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-methods/method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-methods/method/output.json index 6946c14c5a..524174017a 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-methods/method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-methods/method/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "Hotel" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"Hotel"}, "name": "Hotel" }, "superClass": null, "body": { "type": "ClassBody", - "start": 12, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":12,"end":64,"loc":{"start":{"line":1,"column":12},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 16, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":16,"end":62,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":16,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "id": { "type": "Identifier", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "getBanned" - }, + "start":17,"end":26,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":12},"identifierName":"getBanned"}, "name": "getBanned" } }, @@ -130,62 +40,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 29, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":29,"end":62,"loc":{"start":{"line":2,"column":15},"end":{"line":4,"column":3}}, "body": [ { "type": "ReturnStatement", - "start": 35, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":35,"end":58,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":27}}, "argument": { "type": "CallExpression", - "start": 42, - "end": 57, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 26 - } - }, + "start":42,"end":57,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":26}}, "callee": { "type": "Identifier", - "start": 42, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 24 - }, - "identifierName": "violentPeople" - }, + "start":42,"end":55,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":24},"identifierName":"violentPeople"}, "name": "violentPeople" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/output.json index b69a455a0f..365b9b97a9 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-field/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":31,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,65 +48,20 @@ }, { "type": "ClassPrivateProperty", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":22,"end":29,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":22,"end":24,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/output.json index 62a6d3a10f..dbd141f365 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-get/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":35,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,48 +48,14 @@ }, { "type": "ClassPrivateMethod", - "start": 22, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":22,"end":33,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":26,"end":28,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -202,18 +67,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":31,"end":33,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/output.json index 0d301cbb84..860696f144 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-method/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":31,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,48 +48,14 @@ }, { "type": "ClassPrivateMethod", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":22,"end":29,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":22,"end":24,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -201,18 +66,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":27,"end":29,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":9}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/output.json index 99af2b8a69..fc48d9672d 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-instance-set/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":36,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,48 +48,14 @@ }, { "type": "ClassPrivateMethod", - "start": 22, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":22,"end":34,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":26,"end":28,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -202,36 +67,13 @@ "params": [ { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "_" - }, + "start":29,"end":30,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":32,"end":34,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":14}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/output.json index 45ed934caa..6bdc11432e 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-field/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":38,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,65 +48,20 @@ }, { "type": "ClassPrivateProperty", - "start": 22, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":22,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":29,"end":31,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":30,"end":31,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/output.json index d4e1a7d1e6..78af3bf7c7 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-get/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:13)" ], "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":42,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,48 +48,14 @@ }, { "type": "ClassPrivateMethod", - "start": 22, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":22,"end":40,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":33,"end":35,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -202,18 +67,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":38,"end":40,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/output.json index 3fa0178df7..4d7e2c8824 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-method/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":38,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,48 +48,14 @@ }, { "type": "ClassPrivateMethod", - "start": 22, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":22,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":29,"end":31,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":30,"end":31,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -201,18 +66,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":34,"end":36,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/output.json index 3e3d506336..1267a637ac 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-field-static-set/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:13)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":43,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,48 +48,14 @@ }, { "type": "ClassPrivateMethod", - "start": 22, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":22,"end":41,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":33,"end":35,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -202,36 +67,13 @@ "params": [ { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "_" - }, + "start":36,"end":37,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":39,"end":41,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/output.json index e7c6f5e6bb..326584989c 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-field/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":35,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -134,83 +44,27 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":21,"end":23,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "body": [], "directives": [] } }, { "type": "ClassPrivateProperty", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":26,"end":33,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":26,"end":28,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":31,"end":32,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/output.json index c63e32cca8..d1d6acb5f0 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-get/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":39,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -134,66 +44,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":21,"end":23,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 26, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":26,"end":37,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":30,"end":32,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":31,"end":32,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -205,18 +70,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":35,"end":37,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/output.json index 9fa1c29170..995f7b0838 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-method/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":35,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -134,66 +44,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":21,"end":23,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":26,"end":33,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":26,"end":28,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -204,18 +69,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":31,"end":33,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":9}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/output.json index 109fbb70ba..ce4251ad8e 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-instance-set/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":40,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -131,66 +41,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":21,"end":23,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 26, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":26,"end":38,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":30,"end":32,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":31,"end":32,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -202,36 +67,13 @@ "params": [ { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "_" - }, + "start":33,"end":34,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":36,"end":38,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":14}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/output.json index 5c6ec686f5..35d9b789e2 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-field/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":42,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -134,83 +44,27 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":21,"end":23,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "body": [], "directives": [] } }, { "type": "ClassPrivateProperty", - "start": 26, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":26,"end":40,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":33,"end":35,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":38,"end":39,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/output.json index 65ec3150bb..cb4da3ca45 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-get/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:13)" ], "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":46,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -134,66 +44,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":21,"end":23,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 26, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":26,"end":44,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":37,"end":39,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":38,"end":39,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -205,18 +70,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":42,"end":44,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/output.json index 68c3ff18b2..af99874340 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-method/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":42,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -134,66 +44,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":21,"end":23,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 26, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":26,"end":40,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":33,"end":35,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -204,18 +69,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":38,"end":40,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/output.json index 470062c22b..42d1371ce7 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-get-static-set/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:13)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":47,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -134,66 +44,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":21,"end":23,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 26, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":26,"end":45,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":37,"end":39,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":38,"end":39,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -205,36 +70,13 @@ "params": [ { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "_" - }, + "start":40,"end":41,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 43, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":43,"end":45,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/output.json index d32285dc3a..122a0e829f 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-field/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":31,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -133,83 +43,27 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":17,"end":19,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":9}}, "body": [], "directives": [] } }, { "type": "ClassPrivateProperty", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":22,"end":29,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":22,"end":24,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/output.json index 8dbf70cdb0..9c3051a380 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-get/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":35,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -133,66 +43,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":17,"end":19,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":9}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 22, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":22,"end":33,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":26,"end":28,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -204,18 +69,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":31,"end":33,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/output.json index 7fe8d83f31..9e05934745 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-method/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":31,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -133,66 +43,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":17,"end":19,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":9}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":22,"end":29,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":22,"end":24,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -203,18 +68,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":27,"end":29,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":9}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/output.json index 35d6a2f29b..792fec48d7 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-instance-set/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":36,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -133,66 +43,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":17,"end":19,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":9}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 22, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":22,"end":34,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":26,"end":28,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -204,36 +69,13 @@ "params": [ { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "_" - }, + "start":29,"end":30,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":32,"end":34,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":14}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/output.json index 8e35008926..91b3df114c 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-field/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":38,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -133,83 +43,27 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":17,"end":19,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":9}}, "body": [], "directives": [] } }, { "type": "ClassPrivateProperty", - "start": 22, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":22,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":29,"end":31,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":30,"end":31,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/output.json index 1d94cf8546..9ee1d22c1b 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-get/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:13)" ], "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":42,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -133,66 +43,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":17,"end":19,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":9}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 22, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":22,"end":40,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":33,"end":35,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -204,18 +69,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":38,"end":40,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/output.json index fd8bc97f5b..17a3f75931 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-method/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":38,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -133,66 +43,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":17,"end":19,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":9}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 22, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":22,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":29,"end":31,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":30,"end":31,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -203,18 +68,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":34,"end":36,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/output.json index b984451082..f7d4c6d3a1 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-method-static-set/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:13)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":43,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -133,66 +43,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":17,"end":19,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":9}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 22, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":22,"end":41,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":33,"end":35,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -204,36 +69,13 @@ "params": [ { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "_" - }, + "start":36,"end":37,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":39,"end":41,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/output.json index 83b198523b..f0e607109c 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-field/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":36,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":12,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -134,101 +44,33 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "_" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [], "directives": [] } }, { "type": "ClassPrivateProperty", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":27,"end":34,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":27,"end":29,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":28,"end":29,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":32,"end":33,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-get/output.json index 08513a3011..9f60051553 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-get/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":40,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":12,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -131,84 +41,27 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "_" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 27, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":27,"end":38,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":31,"end":33,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":32,"end":33,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -220,18 +73,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":36,"end":38,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/output.json index dceb3bd390..816bb3ac14 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-method/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":36,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":12,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -134,84 +44,27 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "_" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":27,"end":34,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":27,"end":29,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":28,"end":29,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -222,18 +75,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":32,"end":34,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":9}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/output.json index 7add5089ff..6fe3015ccf 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-instance-set/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":41,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":12,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -134,84 +44,27 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "_" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 27, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":27,"end":39,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":31,"end":33,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":32,"end":33,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -223,36 +76,13 @@ "params": [ { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "_" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":37,"end":39,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":14}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/output.json index 06e380aea7..7c3c0b0a5e 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-field/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":43,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":12,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -134,101 +44,33 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "_" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [], "directives": [] } }, { "type": "ClassPrivateProperty", - "start": 27, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":27,"end":41,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":34,"end":36,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":35,"end":36,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":39,"end":40,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/output.json index 339ca0c0d5..ee2325e1bd 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-get/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:13)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":47,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":12,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -134,84 +44,27 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "_" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 27, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":27,"end":45,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":38,"end":40,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":39,"end":40,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -223,18 +76,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 43, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":43,"end":45,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/output.json index 1841252732..fe58593dfb 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-method/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":43,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":12,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -134,84 +44,27 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "_" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 27, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":27,"end":41,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":34,"end":36,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":35,"end":36,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -222,18 +75,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":39,"end":41,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/output.json index 128468f965..e029e983ee 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/instance-set-static-set/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:13)" ], "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":48,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":12,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -134,84 +44,27 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "_" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 27, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":27,"end":46,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":38,"end":40,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":39,"end":40,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -223,36 +76,13 @@ "params": [ { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "_" - }, + "start":41,"end":42,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":44,"end":46,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/output.json index 0724b9e565..cf003ba438 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-field/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":38,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,65 +48,20 @@ }, { "type": "ClassPrivateProperty", - "start": 29, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":29,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":29,"end":31,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":30,"end":31,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/output.json index 1a3e576e3b..d0f7aa76db 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-get/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":42,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,48 +48,14 @@ }, { "type": "ClassPrivateMethod", - "start": 29, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":29,"end":40,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":33,"end":35,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -202,18 +67,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":38,"end":40,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/output.json index d1c2347cb1..b740b3d3bd 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-method/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":38,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,48 +48,14 @@ }, { "type": "ClassPrivateMethod", - "start": 29, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":29,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":29,"end":31,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":30,"end":31,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -201,18 +66,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":34,"end":36,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":9}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/output.json index 0a638b426a..d4337b4f6d 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-instance-set/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":43,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,48 +48,14 @@ }, { "type": "ClassPrivateMethod", - "start": 29, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":29,"end":41,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":33,"end":35,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -202,36 +67,13 @@ "params": [ { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "_" - }, + "start":36,"end":37,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":39,"end":41,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":14}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/output.json index 7cf03fd42b..4e1bc28f26 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-field/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":45,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,65 +48,20 @@ }, { "type": "ClassPrivateProperty", - "start": 29, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":29,"end":43,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":36,"end":38,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":37,"end":38,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":41,"end":42,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/output.json index 98d454b78c..82cf9bd9f5 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-get/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:13)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":49,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,48 +48,14 @@ }, { "type": "ClassPrivateMethod", - "start": 29, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":29,"end":47,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":40,"end":42,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":41,"end":42,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -202,18 +67,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 45, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":45,"end":47,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/output.json index 74c7d35d4f..baad4ea0cd 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-method/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":45,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,48 +48,14 @@ }, { "type": "ClassPrivateMethod", - "start": 29, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":29,"end":43,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":36,"end":38,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":37,"end":38,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -201,18 +66,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":41,"end":43,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/output.json index 379ee84d2d..53103a600f 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-field-static-set/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:13)" ], "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":50,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "extra": { "rawValue": 0, "raw": "0" @@ -149,48 +48,14 @@ }, { "type": "ClassPrivateMethod", - "start": 29, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":29,"end":48,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":40,"end":42,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":41,"end":42,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -202,36 +67,13 @@ "params": [ { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "_" - }, + "start":43,"end":44,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 46, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":46,"end":48,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/output.json index 113e8bbbbe..752fd3b1a7 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-field/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":42,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":12,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -134,83 +44,27 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":28,"end":30,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}}, "body": [], "directives": [] } }, { "type": "ClassPrivateProperty", - "start": 33, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":33,"end":40,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":33,"end":35,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":38,"end":39,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/output.json index c7fd9652e8..35b89e8389 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-get/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":46,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":12,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -134,66 +44,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":28,"end":30,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 33, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":33,"end":44,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":37,"end":39,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":38,"end":39,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -205,18 +70,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":42,"end":44,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/output.json index 67e2f41f4c..c826d1bd51 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-method/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":42,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":12,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -134,66 +44,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":28,"end":30,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 33, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":33,"end":40,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":33,"end":35,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -204,18 +69,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":38,"end":40,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":9}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/output.json index ef06223a73..e337e3d268 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-instance-set/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":47,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":12,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -134,66 +44,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":28,"end":30,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 33, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":33,"end":45,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":37,"end":39,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":38,"end":39,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -205,36 +70,13 @@ "params": [ { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "_" - }, + "start":40,"end":41,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 43, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":43,"end":45,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":14}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/output.json index e0271651aa..1039c1e056 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-field/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":49,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":12,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -134,83 +44,27 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":28,"end":30,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}}, "body": [], "directives": [] } }, { "type": "ClassPrivateProperty", - "start": 33, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":33,"end":47,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":40,"end":42,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":41,"end":42,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":45,"end":46,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/output.json index dd680abb98..6e37550db8 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-get/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:13)" ], "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":53,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":12,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -134,66 +44,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":28,"end":30,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 33, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":33,"end":51,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":44,"end":46,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":45,"end":46,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -205,18 +70,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 49, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":49,"end":51,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/output.json index 297ceb941b..98629c2614 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-method/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":49,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":12,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -134,66 +44,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":28,"end":30,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 33, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":33,"end":47,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":40,"end":42,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":41,"end":42,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -204,18 +69,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 45, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":45,"end":47,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/output.json index cb14ff5bd5..91b5799d04 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-get-static-set/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":54,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":12,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -131,66 +41,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":28,"end":30,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 33, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":33,"end":52,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":44,"end":46,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":45,"end":46,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -202,36 +67,13 @@ "params": [ { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "_" - }, + "start":47,"end":48,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 50, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":50,"end":52,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/output.json index e34c853586..ebc7cc92dc 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-field/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":38,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -133,83 +43,27 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "body": [], "directives": [] } }, { "type": "ClassPrivateProperty", - "start": 29, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":29,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":29,"end":31,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":30,"end":31,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/output.json index c6b5cb7b3f..e8403e51a8 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-get/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":42,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -133,66 +43,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 29, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":29,"end":40,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":33,"end":35,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -204,18 +69,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":38,"end":40,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/output.json index 56572b5658..2548111835 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-method/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":38,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -133,66 +43,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 29, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":29,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":29,"end":31,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":30,"end":31,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -203,18 +68,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":34,"end":36,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":9}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/output.json index b8a0773cf4..0e28cc4938 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-instance-set/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":43,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -133,66 +43,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 29, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":29,"end":41,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":33,"end":35,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -204,36 +69,13 @@ "params": [ { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "_" - }, + "start":36,"end":37,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":39,"end":41,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":14}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/output.json index dfaf6f688e..4abec1e40b 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-field/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":45,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -133,83 +43,27 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "body": [], "directives": [] } }, { "type": "ClassPrivateProperty", - "start": 29, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":29,"end":43,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":36,"end":38,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":37,"end":38,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":41,"end":42,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/output.json index e019b3c9aa..967cd567b4 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-get/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:13)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":49,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -133,66 +43,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 29, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":29,"end":47,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":40,"end":42,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":41,"end":42,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -204,18 +69,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 45, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":45,"end":47,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/output.json index 029d9cd6f8..3b74b77a4b 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-method/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":45,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -133,66 +43,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 29, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":29,"end":43,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":36,"end":38,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":37,"end":38,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -203,18 +68,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":41,"end":43,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/output.json index d788eda7fd..b611d45935 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-method-static-set/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:13)" ], "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":50,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -133,66 +43,21 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 29, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":29,"end":48,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":40,"end":42,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":41,"end":42,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -204,36 +69,13 @@ "params": [ { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "_" - }, + "start":43,"end":44,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 46, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":46,"end":48,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/output.json index b50939f384..bbbd7d10be 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-field/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":43,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":12,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -134,101 +44,33 @@ "params": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "_" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } }, { "type": "ClassPrivateProperty", - "start": 34, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":34,"end":41,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":34,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":35,"end":36,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":39,"end":40,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/output.json index ddea1a7567..0b33c76ec3 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-get/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":47,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":12,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -134,84 +44,27 @@ "params": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "_" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 34, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":34,"end":45,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":38,"end":40,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":39,"end":40,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -223,18 +76,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 43, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":43,"end":45,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/output.json index 3b9334d912..3d2ee18645 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-method/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":43,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":12,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -134,84 +44,27 @@ "params": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "_" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 34, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":34,"end":41,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":34,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":35,"end":36,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -222,18 +75,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":39,"end":41,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":9}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/output.json index b56cf90f93..241a017c8e 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-instance-set/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:6)" ], "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":48,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":12,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -134,84 +44,27 @@ "params": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "_" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 34, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":34,"end":46,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":38,"end":40,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "x" - }, + "start":39,"end":40,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"x"}, "name": "x" } }, @@ -223,36 +76,13 @@ "params": [ { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "_" - }, + "start":41,"end":42,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":44,"end":46,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":14}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/output.json index c063c6722c..ae3787b174 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-field/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":50,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":12,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -134,101 +44,33 @@ "params": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "_" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } }, { "type": "ClassPrivateProperty", - "start": 34, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":34,"end":48,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":41,"end":43,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":42,"end":43,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":46,"end":47,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/output.json index 06b5a7c528..0b825cb17d 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-get/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":54,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":12,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -131,84 +41,27 @@ "params": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "_" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 34, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":34,"end":52,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 45, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":45,"end":47,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":46,"end":47,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -220,18 +73,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 50, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":50,"end":52,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/output.json index 78b1736950..6df9c23ccf 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-method/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:9)" ], "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":50,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":12,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -134,84 +44,27 @@ "params": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "_" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 34, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":34,"end":48,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":41,"end":43,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":42,"end":43,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -222,18 +75,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 46, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":46,"end":48,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/output.json index 146f1c39f3..dff968e979 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-names-duplicated/static-set-static-set/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Duplicate private name #x (3:13)" ], "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":55,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":12,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -134,84 +44,27 @@ "params": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "_" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } }, { "type": "ClassPrivateMethod", - "start": 34, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":34,"end":53,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":21}}, "static": true, "key": { "type": "PrivateName", - "start": 45, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":45,"end":47,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15}}, "id": { "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":46,"end":47,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -223,36 +76,13 @@ "params": [ { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "_" - }, + "start":48,"end":49,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17},"identifierName":"_"}, "name": "_" } ], "body": { "type": "BlockStatement", - "start": 51, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":51,"end":53,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-success/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-success/output.json index 7b8015061d..84dfd671cc 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-success/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/asi-success/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":10,"end":23,"loc":{"start":{"line":1,"column":10},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":14,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "static": false, "key": { "type": "PrivateName", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":14,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -127,48 +37,14 @@ }, { "type": "ClassPrivateProperty", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":19,"end":21,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "static": false, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":19,"end":21,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "y" - }, + "start":20,"end":21,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"y"}, "name": "y" } }, diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/output.json index ebac6a0e3b..51393c7016 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-async-in-private-property/output.json @@ -1,174 +1,51 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":40,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":12,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":28}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "p" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"p"}, "name": "p" } }, "value": { "type": "ArrowFunctionExpression", - "start": 17, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":17,"end":37,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":27}}, "id": null, "generator": false, "async": true, "params": [], "body": { "type": "AwaitExpression", - "start": 29, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":29,"end":37,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":27}}, "argument": { "type": "NumericLiteral", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":35,"end":37,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":27}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/output.json index cc5429e9fc..43274b4f1a 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/await-in-private-property-in-async/output.json @@ -1,221 +1,64 @@ { "type": "File", - "start": 0, - "end": 97, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":97,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 97, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":97,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 97, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":97,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 97, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":97,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "id": null, "generator": false, "async": true, "params": [], "body": { "type": "BlockStatement", - "start": 12, - "end": 97, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":12,"end":97,"loc":{"start":{"line":1,"column":12},"end":{"line":6,"column":1}}, "body": [ { "type": "ClassDeclaration", - "start": 16, - "end": 95, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":16,"end":95,"loc":{"start":{"line":2,"column":2},"end":{"line":5,"column":3}}, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "C" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 24, - "end": 95, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":24,"end":95,"loc":{"start":{"line":2,"column":10},"end":{"line":5,"column":3}}, "body": [ { "type": "ClassPrivateProperty", - "start": 75, - "end": 91, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 20 - } - }, + "start":75,"end":91,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":20}}, "static": false, "key": { "type": "PrivateName", - "start": 75, - "end": 77, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 6 - } - }, + "start":75,"end":77,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":6}}, "id": { "type": "Identifier", - "start": 76, - "end": 77, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 6 - }, - "identifierName": "p" - }, + "start":76,"end":77,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":6},"identifierName":"p"}, "name": "p" } }, "value": { "type": "BinaryExpression", - "start": 80, - "end": 90, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 19 - } - }, + "start":80,"end":90,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":19}}, "left": { "type": "Identifier", - "start": 80, - "end": 85, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 14 - }, - "identifierName": "await" - }, + "start":80,"end":85,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":14},"identifierName":"await"}, "name": "await" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 88, - "end": 90, - "loc": { - "start": { - "line": 4, - "column": 17 - }, - "end": { - "line": 4, - "column": 19 - } - }, + "start":88,"end":90,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":19}}, "extra": { "rawValue": 42, "raw": "42" @@ -227,18 +70,7 @@ { "type": "CommentLine", "value": " here await is an identifier reference", - "start": 30, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 44 - } - } + "start":30,"end":70,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} } ] } @@ -257,18 +89,7 @@ { "type": "CommentLine", "value": " here await is an identifier reference", - "start": 30, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 44 - } - } + "start":30,"end":70,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/output.json index 1bd1092fae..61bcf07c5a 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-outer-class/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "B" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"B"}, "name": "B" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":8,"end":73,"loc":{"start":{"line":1,"column":8},"end":{"line":9,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":12,"end":64,"loc":{"start":{"line":2,"column":2},"end":{"line":6,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "meth" - }, + "start":12,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6},"identifierName":"meth"}, "name": "meth" }, "computed": false, @@ -116,171 +37,47 @@ "params": [], "body": { "type": "BlockStatement", - "start": 19, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":19,"end":64,"loc":{"start":{"line":2,"column":9},"end":{"line":6,"column":3}}, "body": [ { "type": "ClassDeclaration", - "start": 25, - "end": 60, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":25,"end":60,"loc":{"start":{"line":3,"column":4},"end":{"line":5,"column":5}}, "id": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "A" - }, + "start":31,"end":32,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 33, - "end": 60, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":33,"end":60,"loc":{"start":{"line":3,"column":12},"end":{"line":5,"column":5}}, "body": [ { "type": "ClassPrivateProperty", - "start": 41, - "end": 54, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 19 - } - }, + "start":41,"end":54,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":19}}, "static": false, "key": { "type": "PrivateName", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 8 - } - }, + "start":41,"end":43,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":8}}, "id": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 8 - }, - "identifierName": "x" - }, + "start":42,"end":43,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":8},"identifierName":"x"}, "name": "x" } }, "value": { "type": "MemberExpression", - "start": 46, - "end": 53, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":46,"end":53,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":18}}, "object": { "type": "ThisExpression", - "start": 46, - "end": 50, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 15 - } - } + "start":46,"end":50,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":15}} }, "property": { "type": "PrivateName", - "start": 51, - "end": 53, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":51,"end":53,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":18}}, "id": { "type": "Identifier", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 4, - "column": 17 - }, - "end": { - "line": 4, - "column": 18 - }, - "identifierName": "y" - }, + "start":52,"end":53,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":18},"identifierName":"y"}, "name": "y" } }, @@ -296,48 +93,14 @@ }, { "type": "ClassPrivateProperty", - "start": 68, - "end": 71, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 5 - } - }, + "start":68,"end":71,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":5}}, "static": false, "key": { "type": "PrivateName", - "start": 68, - "end": 70, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 4 - } - }, + "start":68,"end":70,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":4}}, "id": { "type": "Identifier", - "start": 69, - "end": 70, - "loc": { - "start": { - "line": 8, - "column": 3 - }, - "end": { - "line": 8, - "column": 4 - }, - "identifierName": "y" - }, + "start":69,"end":70,"loc":{"start":{"line":8,"column":3},"end":{"line":8,"column":4},"identifierName":"y"}, "name": "y" } }, diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/output.json index 3c7ad5de93..f610c07abe 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/declared-later-same-class/output.json @@ -1,186 +1,51 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":33,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":12,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "MemberExpression", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":17,"end":24,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":14}}, "object": { "type": "ThisExpression", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 11 - } - } + "start":17,"end":21,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":11}} }, "property": { "type": "PrivateName", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "y" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"y"}, "name": "y" } }, @@ -189,48 +54,14 @@ }, { "type": "ClassPrivateProperty", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":28,"end":31,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5}}, "static": false, "key": { "type": "PrivateName", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":28,"end":30,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "y" - }, + "start":29,"end":30,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"y"}, "name": "y" } }, diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json index 1f5d18e550..edd09ae38e 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-delete-private-property/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ "SyntaxError: Deleting a private field is not allowed (4:4)" ], "program": { "type": "Program", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":10,"end":61,"loc":{"start":{"line":1,"column":10},"end":{"line":6,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5}}, "static": false, "key": { "type": "PrivateName", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":14,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -130,34 +40,11 @@ }, { "type": "ClassMethod", - "start": 20, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":20,"end":59,"loc":{"start":{"line":3,"column":2},"end":{"line":5,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":20,"end":31,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -168,107 +55,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 34, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":34,"end":59,"loc":{"start":{"line":3,"column":16},"end":{"line":5,"column":3}}, "body": [ { "type": "ExpressionStatement", - "start": 40, - "end": 55, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 19 - } - }, + "start":40,"end":55,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":19}}, "expression": { "type": "UnaryExpression", - "start": 40, - "end": 54, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":40,"end":54,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":18}}, "operator": "delete", "prefix": true, "argument": { "type": "MemberExpression", - "start": 47, - "end": 54, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":47,"end":54,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":18}}, "object": { "type": "ThisExpression", - "start": 47, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 15 - } - } + "start":47,"end":51,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":15}} }, "property": { "type": "PrivateName", - "start": 52, - "end": 54, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":52,"end":54,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":18}}, "id": { "type": "Identifier", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 4, - "column": 17 - }, - "end": { - "line": 4, - "column": 18 - }, - "identifierName": "x" - }, + "start":53,"end":54,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":18},"identifierName":"x"}, "name": "x" } }, diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json index 1f4da38f9f..56f268a847 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-name-constructor/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Classes may not have a private field named '#constructor' (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":29,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":14,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "static": false, "key": { "type": "PrivateName", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":14,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 15, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "constructor" - }, + "start":15,"end":26,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":14},"identifierName":"constructor"}, "name": "constructor" } }, diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/output.json index 34003e4e92..8e3342fe9f 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/failure-spaces/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Unexpected space between # and identifier (2:3)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "Spaces" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"Spaces"}, "name": "Spaces" }, "superClass": null, "body": { "type": "ClassBody", - "start": 13, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":13,"end":34,"loc":{"start":{"line":1,"column":13},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 17, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":17,"end":32,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}}, "static": false, "key": { "type": "PrivateName", - "start": 17, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":17,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "id": { "type": "Identifier", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "wrongSpaces" - }, + "start":20,"end":31,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":16},"identifierName":"wrongSpaces"}, "name": "wrongSpaces" } }, diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/inline/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/inline/output.json index fed43d6977..041c7fcf4f 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/inline/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/inline/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":8,"end":19,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":19}}, "body": [ { "type": "ClassPrivateProperty", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" } }, @@ -127,48 +37,14 @@ }, { "type": "ClassPrivateProperty", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "static": false, "key": { "type": "PrivateName", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "y" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"y"}, "name": "y" } }, @@ -179,112 +55,33 @@ }, { "type": "ClassDeclaration", - "start": 21, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":21,"end":48,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":27}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "B" - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7},"identifierName":"B"}, "name": "B" }, "superClass": null, "body": { "type": "ClassBody", - "start": 29, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":29,"end":48,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":27}}, "body": [ { "type": "ClassPrivateProperty", - "start": 31, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":31,"end":38,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":17}}, "static": false, "key": { "type": "PrivateName", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":31,"end":33,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":12}}, "id": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 12 - }, - "identifierName": "x" - }, + "start":32,"end":33,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":12},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":36,"end":37,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":16}}, "extra": { "rawValue": 0, "raw": "0" @@ -294,65 +91,20 @@ }, { "type": "ClassPrivateProperty", - "start": 39, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":39,"end":46,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":25}}, "static": false, "key": { "type": "PrivateName", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":39,"end":41,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":20}}, "id": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 20 - }, - "identifierName": "y" - }, + "start":40,"end":41,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":20},"identifierName":"y"}, "name": "y" } }, "value": { "type": "NumericLiteral", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 23 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":44,"end":45,"loc":{"start":{"line":3,"column":23},"end":{"line":3,"column":24}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/output.json index d8c6109cf9..8a1f3e4581 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring-arguments/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p). (3:11)" ], "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":46,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "extra": { "rawValue": 1, "raw": "1" @@ -149,147 +48,45 @@ }, { "type": "ClassPrivateProperty", - "start": 22, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":22,"end":44,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":24}}, "static": false, "key": { "type": "PrivateName", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":22,"end":24,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "p" - }, + "start":23,"end":24,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"p"}, "name": "p" } }, "value": { "type": "ArrowFunctionExpression", - "start": 27, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":27,"end":44,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":24}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 28, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":28,"end":37,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":17}}, "properties": [ { "type": "ObjectProperty", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":30,"end":35,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":15}}, "method": false, "key": { "type": "PrivateName", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":30,"end":32,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":12}}, "id": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 12 - }, - "identifierName": "x" - }, + "start":31,"end":32,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":12},"identifierName":"x"}, "name": "x" } }, "shorthand": false, "value": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15},"identifierName":"x"}, "name": "x" } } @@ -298,18 +95,7 @@ ], "body": { "type": "BlockStatement", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":42,"end":44,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":24}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/output.json index 73b7c25794..0f46840ba8 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-destructuring/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ "SyntaxError: Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p). (4:12)" ], "program": { "type": "Program", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":8,"end":59,"loc":{"start":{"line":1,"column":8},"end":{"line":6,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "extra": { "rawValue": 1, "raw": "1" @@ -149,34 +48,11 @@ }, { "type": "ClassMethod", - "start": 22, - "end": 57, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":22,"end":57,"loc":{"start":{"line":3,"column":2},"end":{"line":5,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "m" - }, + "start":22,"end":23,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"m"}, "name": "m" }, "computed": false, @@ -187,126 +63,36 @@ "params": [], "body": { "type": "BlockStatement", - "start": 26, - "end": 57, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":26,"end":57,"loc":{"start":{"line":3,"column":6},"end":{"line":5,"column":3}}, "body": [ { "type": "VariableDeclaration", - "start": 32, - "end": 53, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":32,"end":53,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 38, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 24 - } - }, + "start":38,"end":52,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":24}}, "id": { "type": "ObjectPattern", - "start": 38, - "end": 45, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 17 - } - }, + "start":38,"end":45,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":17}}, "properties": [ { "type": "ObjectProperty", - "start": 39, - "end": 44, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 16 - } - }, + "start":39,"end":44,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":16}}, "method": false, "key": { "type": "PrivateName", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":39,"end":41,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":13}}, "id": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 13 - }, - "identifierName": "x" - }, + "start":40,"end":41,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":13},"identifierName":"x"}, "name": "x" } }, "shorthand": false, "value": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 16 - }, - "identifierName": "x" - }, + "start":43,"end":44,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":16},"identifierName":"x"}, "name": "x" } } @@ -314,18 +100,7 @@ }, "init": { "type": "ThisExpression", - "start": 48, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 20 - }, - "end": { - "line": 4, - "column": 24 - } - } + "start":48,"end":52,"loc":{"start":{"line":4,"column":20},"end":{"line":4,"column":24}} } } ], diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/output.json index 7a5716ee67..7c27ba1380 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-object-method/output.json @@ -1,208 +1,62 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p). (2:11)" ], "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":32,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":12,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "p" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"p"}, "name": "p" } }, "value": { "type": "ObjectExpression", - "start": 18, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":18,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":18}}, "properties": [ { "type": "ObjectProperty", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":20,"end":26,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}}, "method": false, "key": { "type": "PrivateName", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":20,"end":22,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":12}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"x"}, "name": "x" } }, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/output.json index 3422be4603..abaf592123 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/invalid-ts-type-literal/output.json @@ -1,157 +1,45 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Private names can only be used as the name of a class element (i.e. class C { #p = 42; #m() {} } )\n or a property of member expression (i.e. this.#p). (2:3)" ], "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":28,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "body": [ { "type": "TSPropertySignature", - "start": 16, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":16,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "p" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"p"}, "name": "p" } }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":18,"end":26,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":12}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 12 - } - } + "start":20,"end":26,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":12}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/nested/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/nested/output.json index 085141ac53..6aabfae0aa 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/nested/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/nested/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 782, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 39, - "column": 1 - } - }, + "start":0,"end":782,"loc":{"start":{"line":1,"column":0},"end":{"line":39,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 782, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 39, - "column": 1 - } - }, + "start":0,"end":782,"loc":{"start":{"line":1,"column":0},"end":{"line":39,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 782, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 39, - "column": 1 - } - }, + "start":0,"end":782,"loc":{"start":{"line":1,"column":0},"end":{"line":39,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "Point" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"Point"}, "name": "Point" }, "superClass": null, "body": { "type": "ClassBody", - "start": 12, - "end": 782, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 39, - "column": 1 - } - }, + "start":12,"end":782,"loc":{"start":{"line":1,"column":12},"end":{"line":39,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":16,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "extra": { "rawValue": 1, "raw": "1" @@ -146,65 +45,20 @@ }, { "type": "ClassPrivateProperty", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":26,"end":33,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":26,"end":28,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "y" - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"y"}, "name": "y" } }, "value": { "type": "NumericLiteral", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":31,"end":32,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, "extra": { "rawValue": 2, "raw": "2" @@ -214,34 +68,11 @@ }, { "type": "ClassMethod", - "start": 37, - "end": 527, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 28, - "column": 3 - } - }, + "start":37,"end":527,"loc":{"start":{"line":5,"column":2},"end":{"line":28,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 37, - "end": 48, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":37,"end":48,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -252,49 +83,15 @@ "params": [ { "type": "AssignmentPattern", - "start": 49, - "end": 54, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 19 - } - }, + "start":49,"end":54,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":19}}, "left": { "type": "Identifier", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 15 - }, - "identifierName": "x" - }, + "start":49,"end":50,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":15},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 5, - "column": 18 - }, - "end": { - "line": 5, - "column": 19 - } - }, + "start":53,"end":54,"loc":{"start":{"line":5,"column":18},"end":{"line":5,"column":19}}, "extra": { "rawValue": 0, "raw": "0" @@ -304,49 +101,15 @@ }, { "type": "AssignmentPattern", - "start": 56, - "end": 61, - "loc": { - "start": { - "line": 5, - "column": 21 - }, - "end": { - "line": 5, - "column": 26 - } - }, + "start":56,"end":61,"loc":{"start":{"line":5,"column":21},"end":{"line":5,"column":26}}, "left": { "type": "Identifier", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 5, - "column": 21 - }, - "end": { - "line": 5, - "column": 22 - }, - "identifierName": "y" - }, + "start":56,"end":57,"loc":{"start":{"line":5,"column":21},"end":{"line":5,"column":22},"identifierName":"y"}, "name": "y" }, "right": { "type": "NumericLiteral", - "start": 60, - "end": 61, - "loc": { - "start": { - "line": 5, - "column": 25 - }, - "end": { - "line": 5, - "column": 26 - } - }, + "start":60,"end":61,"loc":{"start":{"line":5,"column":25},"end":{"line":5,"column":26}}, "extra": { "rawValue": 0, "raw": "0" @@ -357,106 +120,28 @@ ], "body": { "type": "BlockStatement", - "start": 63, - "end": 527, - "loc": { - "start": { - "line": 5, - "column": 28 - }, - "end": { - "line": 28, - "column": 3 - } - }, + "start":63,"end":527,"loc":{"start":{"line":5,"column":28},"end":{"line":28,"column":3}}, "body": [ { "type": "ExpressionStatement", - "start": 69, - "end": 82, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":69,"end":82,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":17}}, "expression": { "type": "AssignmentExpression", - "start": 69, - "end": 81, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 16 - } - }, + "start":69,"end":81,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":16}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 69, - "end": 76, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 11 - } - }, + "start":69,"end":76,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":11}}, "object": { "type": "ThisExpression", - "start": 69, - "end": 73, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 8 - } - } + "start":69,"end":73,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":8}} }, "property": { "type": "PrivateName", - "start": 74, - "end": 76, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 11 - } - }, + "start":74,"end":76,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":11}}, "id": { "type": "Identifier", - "start": 75, - "end": 76, - "loc": { - "start": { - "line": 6, - "column": 10 - }, - "end": { - "line": 6, - "column": 11 - }, - "identifierName": "x" - }, + "start":75,"end":76,"loc":{"start":{"line":6,"column":10},"end":{"line":6,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -464,35 +149,12 @@ }, "right": { "type": "UnaryExpression", - "start": 79, - "end": 81, - "loc": { - "start": { - "line": 6, - "column": 14 - }, - "end": { - "line": 6, - "column": 16 - } - }, + "start":79,"end":81,"loc":{"start":{"line":6,"column":14},"end":{"line":6,"column":16}}, "operator": "+", "prefix": true, "argument": { "type": "Identifier", - "start": 80, - "end": 81, - "loc": { - "start": { - "line": 6, - "column": 15 - }, - "end": { - "line": 6, - "column": 16 - }, - "identifierName": "x" - }, + "start":80,"end":81,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":16},"identifierName":"x"}, "name": "x" } } @@ -500,91 +162,24 @@ }, { "type": "ExpressionStatement", - "start": 87, - "end": 100, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 17 - } - }, + "start":87,"end":100,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":17}}, "expression": { "type": "AssignmentExpression", - "start": 87, - "end": 99, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 16 - } - }, + "start":87,"end":99,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":16}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 87, - "end": 94, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 11 - } - }, + "start":87,"end":94,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":11}}, "object": { "type": "ThisExpression", - "start": 87, - "end": 91, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 8 - } - } + "start":87,"end":91,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":8}} }, "property": { "type": "PrivateName", - "start": 92, - "end": 94, - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 11 - } - }, + "start":92,"end":94,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":11}}, "id": { "type": "Identifier", - "start": 93, - "end": 94, - "loc": { - "start": { - "line": 7, - "column": 10 - }, - "end": { - "line": 7, - "column": 11 - }, - "identifierName": "y" - }, + "start":93,"end":94,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":11},"identifierName":"y"}, "name": "y" } }, @@ -592,35 +187,12 @@ }, "right": { "type": "UnaryExpression", - "start": 97, - "end": 99, - "loc": { - "start": { - "line": 7, - "column": 14 - }, - "end": { - "line": 7, - "column": 16 - } - }, + "start":97,"end":99,"loc":{"start":{"line":7,"column":14},"end":{"line":7,"column":16}}, "operator": "+", "prefix": true, "argument": { "type": "Identifier", - "start": 98, - "end": 99, - "loc": { - "start": { - "line": 7, - "column": 15 - }, - "end": { - "line": 7, - "column": 16 - }, - "identifierName": "y" - }, + "start":98,"end":99,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":16},"identifierName":"y"}, "name": "y" } } @@ -628,173 +200,50 @@ }, { "type": "ExpressionStatement", - "start": 106, - "end": 523, - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 27, - "column": 6 - } - }, + "start":106,"end":523,"loc":{"start":{"line":9,"column":4},"end":{"line":27,"column":6}}, "expression": { "type": "AssignmentExpression", - "start": 106, - "end": 522, - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 27, - "column": 5 - } - }, + "start":106,"end":522,"loc":{"start":{"line":9,"column":4},"end":{"line":27,"column":5}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 106, - "end": 114, - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 9, - "column": 12 - } - }, + "start":106,"end":114,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":12}}, "object": { "type": "ThisExpression", - "start": 106, - "end": 110, - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 9, - "column": 8 - } - } + "start":106,"end":110,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":8}} }, "property": { "type": "Identifier", - "start": 111, - "end": 114, - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 9, - "column": 12 - }, - "identifierName": "foo" - }, + "start":111,"end":114,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":12},"identifierName":"foo"}, "name": "foo" }, "computed": false }, "right": { "type": "ClassExpression", - "start": 117, - "end": 522, - "loc": { - "start": { - "line": 9, - "column": 15 - }, - "end": { - "line": 27, - "column": 5 - } - }, + "start":117,"end":522,"loc":{"start":{"line":9,"column":15},"end":{"line":27,"column":5}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "start": 123, - "end": 522, - "loc": { - "start": { - "line": 9, - "column": 21 - }, - "end": { - "line": 27, - "column": 5 - } - }, + "start":123,"end":522,"loc":{"start":{"line":9,"column":21},"end":{"line":27,"column":5}}, "body": [ { "type": "ClassPrivateProperty", - "start": 131, - "end": 138, - "loc": { - "start": { - "line": 10, - "column": 6 - }, - "end": { - "line": 10, - "column": 13 - } - }, + "start":131,"end":138,"loc":{"start":{"line":10,"column":6},"end":{"line":10,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 131, - "end": 133, - "loc": { - "start": { - "line": 10, - "column": 6 - }, - "end": { - "line": 10, - "column": 8 - } - }, + "start":131,"end":133,"loc":{"start":{"line":10,"column":6},"end":{"line":10,"column":8}}, "id": { "type": "Identifier", - "start": 132, - "end": 133, - "loc": { - "start": { - "line": 10, - "column": 7 - }, - "end": { - "line": 10, - "column": 8 - }, - "identifierName": "x" - }, + "start":132,"end":133,"loc":{"start":{"line":10,"column":7},"end":{"line":10,"column":8},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 136, - "end": 137, - "loc": { - "start": { - "line": 10, - "column": 11 - }, - "end": { - "line": 10, - "column": 12 - } - }, + "start":136,"end":137,"loc":{"start":{"line":10,"column":11},"end":{"line":10,"column":12}}, "extra": { "rawValue": 1, "raw": "1" @@ -804,65 +253,20 @@ }, { "type": "ClassPrivateProperty", - "start": 145, - "end": 152, - "loc": { - "start": { - "line": 11, - "column": 6 - }, - "end": { - "line": 11, - "column": 13 - } - }, + "start":145,"end":152,"loc":{"start":{"line":11,"column":6},"end":{"line":11,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 145, - "end": 147, - "loc": { - "start": { - "line": 11, - "column": 6 - }, - "end": { - "line": 11, - "column": 8 - } - }, + "start":145,"end":147,"loc":{"start":{"line":11,"column":6},"end":{"line":11,"column":8}}, "id": { "type": "Identifier", - "start": 146, - "end": 147, - "loc": { - "start": { - "line": 11, - "column": 7 - }, - "end": { - "line": 11, - "column": 8 - }, - "identifierName": "y" - }, + "start":146,"end":147,"loc":{"start":{"line":11,"column":7},"end":{"line":11,"column":8},"identifierName":"y"}, "name": "y" } }, "value": { "type": "NumericLiteral", - "start": 150, - "end": 151, - "loc": { - "start": { - "line": 11, - "column": 11 - }, - "end": { - "line": 11, - "column": 12 - } - }, + "start":150,"end":151,"loc":{"start":{"line":11,"column":11},"end":{"line":11,"column":12}}, "extra": { "rawValue": 2, "raw": "2" @@ -872,34 +276,11 @@ }, { "type": "ClassMethod", - "start": 160, - "end": 239, - "loc": { - "start": { - "line": 13, - "column": 6 - }, - "end": { - "line": 16, - "column": 7 - } - }, + "start":160,"end":239,"loc":{"start":{"line":13,"column":6},"end":{"line":16,"column":7}}, "static": false, "key": { "type": "Identifier", - "start": 160, - "end": 171, - "loc": { - "start": { - "line": 13, - "column": 6 - }, - "end": { - "line": 13, - "column": 17 - }, - "identifierName": "constructor" - }, + "start":160,"end":171,"loc":{"start":{"line":13,"column":6},"end":{"line":13,"column":17},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -910,49 +291,15 @@ "params": [ { "type": "AssignmentPattern", - "start": 172, - "end": 177, - "loc": { - "start": { - "line": 13, - "column": 18 - }, - "end": { - "line": 13, - "column": 23 - } - }, + "start":172,"end":177,"loc":{"start":{"line":13,"column":18},"end":{"line":13,"column":23}}, "left": { "type": "Identifier", - "start": 172, - "end": 173, - "loc": { - "start": { - "line": 13, - "column": 18 - }, - "end": { - "line": 13, - "column": 19 - }, - "identifierName": "x" - }, + "start":172,"end":173,"loc":{"start":{"line":13,"column":18},"end":{"line":13,"column":19},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 176, - "end": 177, - "loc": { - "start": { - "line": 13, - "column": 22 - }, - "end": { - "line": 13, - "column": 23 - } - }, + "start":176,"end":177,"loc":{"start":{"line":13,"column":22},"end":{"line":13,"column":23}}, "extra": { "rawValue": 0, "raw": "0" @@ -962,49 +309,15 @@ }, { "type": "AssignmentPattern", - "start": 179, - "end": 184, - "loc": { - "start": { - "line": 13, - "column": 25 - }, - "end": { - "line": 13, - "column": 30 - } - }, + "start":179,"end":184,"loc":{"start":{"line":13,"column":25},"end":{"line":13,"column":30}}, "left": { "type": "Identifier", - "start": 179, - "end": 180, - "loc": { - "start": { - "line": 13, - "column": 25 - }, - "end": { - "line": 13, - "column": 26 - }, - "identifierName": "y" - }, + "start":179,"end":180,"loc":{"start":{"line":13,"column":25},"end":{"line":13,"column":26},"identifierName":"y"}, "name": "y" }, "right": { "type": "NumericLiteral", - "start": 183, - "end": 184, - "loc": { - "start": { - "line": 13, - "column": 29 - }, - "end": { - "line": 13, - "column": 30 - } - }, + "start":183,"end":184,"loc":{"start":{"line":13,"column":29},"end":{"line":13,"column":30}}, "extra": { "rawValue": 0, "raw": "0" @@ -1015,106 +328,28 @@ ], "body": { "type": "BlockStatement", - "start": 186, - "end": 239, - "loc": { - "start": { - "line": 13, - "column": 32 - }, - "end": { - "line": 16, - "column": 7 - } - }, + "start":186,"end":239,"loc":{"start":{"line":13,"column":32},"end":{"line":16,"column":7}}, "body": [ { "type": "ExpressionStatement", - "start": 196, - "end": 209, - "loc": { - "start": { - "line": 14, - "column": 8 - }, - "end": { - "line": 14, - "column": 21 - } - }, + "start":196,"end":209,"loc":{"start":{"line":14,"column":8},"end":{"line":14,"column":21}}, "expression": { "type": "AssignmentExpression", - "start": 196, - "end": 208, - "loc": { - "start": { - "line": 14, - "column": 8 - }, - "end": { - "line": 14, - "column": 20 - } - }, + "start":196,"end":208,"loc":{"start":{"line":14,"column":8},"end":{"line":14,"column":20}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 196, - "end": 203, - "loc": { - "start": { - "line": 14, - "column": 8 - }, - "end": { - "line": 14, - "column": 15 - } - }, + "start":196,"end":203,"loc":{"start":{"line":14,"column":8},"end":{"line":14,"column":15}}, "object": { "type": "ThisExpression", - "start": 196, - "end": 200, - "loc": { - "start": { - "line": 14, - "column": 8 - }, - "end": { - "line": 14, - "column": 12 - } - } + "start":196,"end":200,"loc":{"start":{"line":14,"column":8},"end":{"line":14,"column":12}} }, "property": { "type": "PrivateName", - "start": 201, - "end": 203, - "loc": { - "start": { - "line": 14, - "column": 13 - }, - "end": { - "line": 14, - "column": 15 - } - }, + "start":201,"end":203,"loc":{"start":{"line":14,"column":13},"end":{"line":14,"column":15}}, "id": { "type": "Identifier", - "start": 202, - "end": 203, - "loc": { - "start": { - "line": 14, - "column": 14 - }, - "end": { - "line": 14, - "column": 15 - }, - "identifierName": "x" - }, + "start":202,"end":203,"loc":{"start":{"line":14,"column":14},"end":{"line":14,"column":15},"identifierName":"x"}, "name": "x" } }, @@ -1122,35 +357,12 @@ }, "right": { "type": "UnaryExpression", - "start": 206, - "end": 208, - "loc": { - "start": { - "line": 14, - "column": 18 - }, - "end": { - "line": 14, - "column": 20 - } - }, + "start":206,"end":208,"loc":{"start":{"line":14,"column":18},"end":{"line":14,"column":20}}, "operator": "+", "prefix": true, "argument": { "type": "Identifier", - "start": 207, - "end": 208, - "loc": { - "start": { - "line": 14, - "column": 19 - }, - "end": { - "line": 14, - "column": 20 - }, - "identifierName": "x" - }, + "start":207,"end":208,"loc":{"start":{"line":14,"column":19},"end":{"line":14,"column":20},"identifierName":"x"}, "name": "x" } } @@ -1158,91 +370,24 @@ }, { "type": "ExpressionStatement", - "start": 218, - "end": 231, - "loc": { - "start": { - "line": 15, - "column": 8 - }, - "end": { - "line": 15, - "column": 21 - } - }, + "start":218,"end":231,"loc":{"start":{"line":15,"column":8},"end":{"line":15,"column":21}}, "expression": { "type": "AssignmentExpression", - "start": 218, - "end": 230, - "loc": { - "start": { - "line": 15, - "column": 8 - }, - "end": { - "line": 15, - "column": 20 - } - }, + "start":218,"end":230,"loc":{"start":{"line":15,"column":8},"end":{"line":15,"column":20}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 218, - "end": 225, - "loc": { - "start": { - "line": 15, - "column": 8 - }, - "end": { - "line": 15, - "column": 15 - } - }, + "start":218,"end":225,"loc":{"start":{"line":15,"column":8},"end":{"line":15,"column":15}}, "object": { "type": "ThisExpression", - "start": 218, - "end": 222, - "loc": { - "start": { - "line": 15, - "column": 8 - }, - "end": { - "line": 15, - "column": 12 - } - } + "start":218,"end":222,"loc":{"start":{"line":15,"column":8},"end":{"line":15,"column":12}} }, "property": { "type": "PrivateName", - "start": 223, - "end": 225, - "loc": { - "start": { - "line": 15, - "column": 13 - }, - "end": { - "line": 15, - "column": 15 - } - }, + "start":223,"end":225,"loc":{"start":{"line":15,"column":13},"end":{"line":15,"column":15}}, "id": { "type": "Identifier", - "start": 224, - "end": 225, - "loc": { - "start": { - "line": 15, - "column": 14 - }, - "end": { - "line": 15, - "column": 15 - }, - "identifierName": "y" - }, + "start":224,"end":225,"loc":{"start":{"line":15,"column":14},"end":{"line":15,"column":15},"identifierName":"y"}, "name": "y" } }, @@ -1250,35 +395,12 @@ }, "right": { "type": "UnaryExpression", - "start": 228, - "end": 230, - "loc": { - "start": { - "line": 15, - "column": 18 - }, - "end": { - "line": 15, - "column": 20 - } - }, + "start":228,"end":230,"loc":{"start":{"line":15,"column":18},"end":{"line":15,"column":20}}, "operator": "+", "prefix": true, "argument": { "type": "Identifier", - "start": 229, - "end": 230, - "loc": { - "start": { - "line": 15, - "column": 19 - }, - "end": { - "line": 15, - "column": 20 - }, - "identifierName": "y" - }, + "start":229,"end":230,"loc":{"start":{"line":15,"column":19},"end":{"line":15,"column":20},"identifierName":"y"}, "name": "y" } } @@ -1290,34 +412,11 @@ }, { "type": "ClassMethod", - "start": 247, - "end": 273, - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 32 - } - }, + "start":247,"end":273,"loc":{"start":{"line":18,"column":6},"end":{"line":18,"column":32}}, "static": false, "key": { "type": "Identifier", - "start": 251, - "end": 252, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 11 - }, - "identifierName": "x" - }, + "start":251,"end":252,"loc":{"start":{"line":18,"column":10},"end":{"line":18,"column":11},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -1328,91 +427,24 @@ "params": [], "body": { "type": "BlockStatement", - "start": 255, - "end": 273, - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 32 - } - }, + "start":255,"end":273,"loc":{"start":{"line":18,"column":14},"end":{"line":18,"column":32}}, "body": [ { "type": "ReturnStatement", - "start": 257, - "end": 271, - "loc": { - "start": { - "line": 18, - "column": 16 - }, - "end": { - "line": 18, - "column": 30 - } - }, + "start":257,"end":271,"loc":{"start":{"line":18,"column":16},"end":{"line":18,"column":30}}, "argument": { "type": "MemberExpression", - "start": 264, - "end": 271, - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 30 - } - }, + "start":264,"end":271,"loc":{"start":{"line":18,"column":23},"end":{"line":18,"column":30}}, "object": { "type": "ThisExpression", - "start": 264, - "end": 268, - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 27 - } - } + "start":264,"end":268,"loc":{"start":{"line":18,"column":23},"end":{"line":18,"column":27}} }, "property": { "type": "PrivateName", - "start": 269, - "end": 271, - "loc": { - "start": { - "line": 18, - "column": 28 - }, - "end": { - "line": 18, - "column": 30 - } - }, + "start":269,"end":271,"loc":{"start":{"line":18,"column":28},"end":{"line":18,"column":30}}, "id": { "type": "Identifier", - "start": 270, - "end": 271, - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 30 - }, - "identifierName": "x" - }, + "start":270,"end":271,"loc":{"start":{"line":18,"column":29},"end":{"line":18,"column":30},"identifierName":"x"}, "name": "x" } }, @@ -1425,34 +457,11 @@ }, { "type": "ClassMethod", - "start": 280, - "end": 313, - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 39 - } - }, + "start":280,"end":313,"loc":{"start":{"line":19,"column":6},"end":{"line":19,"column":39}}, "static": false, "key": { "type": "Identifier", - "start": 284, - "end": 285, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 11 - }, - "identifierName": "x" - }, + "start":284,"end":285,"loc":{"start":{"line":19,"column":10},"end":{"line":19,"column":11},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -1463,124 +472,34 @@ "params": [ { "type": "Identifier", - "start": 286, - "end": 291, - "loc": { - "start": { - "line": 19, - "column": 12 - }, - "end": { - "line": 19, - "column": 17 - }, - "identifierName": "value" - }, + "start":286,"end":291,"loc":{"start":{"line":19,"column":12},"end":{"line":19,"column":17},"identifierName":"value"}, "name": "value" } ], "body": { "type": "BlockStatement", - "start": 293, - "end": 313, - "loc": { - "start": { - "line": 19, - "column": 19 - }, - "end": { - "line": 19, - "column": 39 - } - }, + "start":293,"end":313,"loc":{"start":{"line":19,"column":19},"end":{"line":19,"column":39}}, "body": [ { "type": "ExpressionStatement", - "start": 295, - "end": 311, - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 37 - } - }, + "start":295,"end":311,"loc":{"start":{"line":19,"column":21},"end":{"line":19,"column":37}}, "expression": { "type": "AssignmentExpression", - "start": 295, - "end": 311, - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 37 - } - }, + "start":295,"end":311,"loc":{"start":{"line":19,"column":21},"end":{"line":19,"column":37}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 295, - "end": 302, - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 28 - } - }, + "start":295,"end":302,"loc":{"start":{"line":19,"column":21},"end":{"line":19,"column":28}}, "object": { "type": "ThisExpression", - "start": 295, - "end": 299, - "loc": { - "start": { - "line": 19, - "column": 21 - }, - "end": { - "line": 19, - "column": 25 - } - } + "start":295,"end":299,"loc":{"start":{"line":19,"column":21},"end":{"line":19,"column":25}} }, "property": { "type": "PrivateName", - "start": 300, - "end": 302, - "loc": { - "start": { - "line": 19, - "column": 26 - }, - "end": { - "line": 19, - "column": 28 - } - }, + "start":300,"end":302,"loc":{"start":{"line":19,"column":26},"end":{"line":19,"column":28}}, "id": { "type": "Identifier", - "start": 301, - "end": 302, - "loc": { - "start": { - "line": 19, - "column": 27 - }, - "end": { - "line": 19, - "column": 28 - }, - "identifierName": "x" - }, + "start":301,"end":302,"loc":{"start":{"line":19,"column":27},"end":{"line":19,"column":28},"identifierName":"x"}, "name": "x" } }, @@ -1588,35 +507,12 @@ }, "right": { "type": "UnaryExpression", - "start": 305, - "end": 311, - "loc": { - "start": { - "line": 19, - "column": 31 - }, - "end": { - "line": 19, - "column": 37 - } - }, + "start":305,"end":311,"loc":{"start":{"line":19,"column":31},"end":{"line":19,"column":37}}, "operator": "+", "prefix": true, "argument": { "type": "Identifier", - "start": 306, - "end": 311, - "loc": { - "start": { - "line": 19, - "column": 32 - }, - "end": { - "line": 19, - "column": 37 - }, - "identifierName": "value" - }, + "start":306,"end":311,"loc":{"start":{"line":19,"column":32},"end":{"line":19,"column":37},"identifierName":"value"}, "name": "value" } } @@ -1628,34 +524,11 @@ }, { "type": "ClassMethod", - "start": 321, - "end": 347, - "loc": { - "start": { - "line": 21, - "column": 6 - }, - "end": { - "line": 21, - "column": 32 - } - }, + "start":321,"end":347,"loc":{"start":{"line":21,"column":6},"end":{"line":21,"column":32}}, "static": false, "key": { "type": "Identifier", - "start": 325, - "end": 326, - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 11 - }, - "identifierName": "y" - }, + "start":325,"end":326,"loc":{"start":{"line":21,"column":10},"end":{"line":21,"column":11},"identifierName":"y"}, "name": "y" }, "computed": false, @@ -1666,91 +539,24 @@ "params": [], "body": { "type": "BlockStatement", - "start": 329, - "end": 347, - "loc": { - "start": { - "line": 21, - "column": 14 - }, - "end": { - "line": 21, - "column": 32 - } - }, + "start":329,"end":347,"loc":{"start":{"line":21,"column":14},"end":{"line":21,"column":32}}, "body": [ { "type": "ReturnStatement", - "start": 331, - "end": 345, - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 30 - } - }, + "start":331,"end":345,"loc":{"start":{"line":21,"column":16},"end":{"line":21,"column":30}}, "argument": { "type": "MemberExpression", - "start": 338, - "end": 345, - "loc": { - "start": { - "line": 21, - "column": 23 - }, - "end": { - "line": 21, - "column": 30 - } - }, + "start":338,"end":345,"loc":{"start":{"line":21,"column":23},"end":{"line":21,"column":30}}, "object": { "type": "ThisExpression", - "start": 338, - "end": 342, - "loc": { - "start": { - "line": 21, - "column": 23 - }, - "end": { - "line": 21, - "column": 27 - } - } + "start":338,"end":342,"loc":{"start":{"line":21,"column":23},"end":{"line":21,"column":27}} }, "property": { "type": "PrivateName", - "start": 343, - "end": 345, - "loc": { - "start": { - "line": 21, - "column": 28 - }, - "end": { - "line": 21, - "column": 30 - } - }, + "start":343,"end":345,"loc":{"start":{"line":21,"column":28},"end":{"line":21,"column":30}}, "id": { "type": "Identifier", - "start": 344, - "end": 345, - "loc": { - "start": { - "line": 21, - "column": 29 - }, - "end": { - "line": 21, - "column": 30 - }, - "identifierName": "y" - }, + "start":344,"end":345,"loc":{"start":{"line":21,"column":29},"end":{"line":21,"column":30},"identifierName":"y"}, "name": "y" } }, @@ -1763,34 +569,11 @@ }, { "type": "ClassMethod", - "start": 354, - "end": 387, - "loc": { - "start": { - "line": 22, - "column": 6 - }, - "end": { - "line": 22, - "column": 39 - } - }, + "start":354,"end":387,"loc":{"start":{"line":22,"column":6},"end":{"line":22,"column":39}}, "static": false, "key": { "type": "Identifier", - "start": 358, - "end": 359, - "loc": { - "start": { - "line": 22, - "column": 10 - }, - "end": { - "line": 22, - "column": 11 - }, - "identifierName": "y" - }, + "start":358,"end":359,"loc":{"start":{"line":22,"column":10},"end":{"line":22,"column":11},"identifierName":"y"}, "name": "y" }, "computed": false, @@ -1801,124 +584,34 @@ "params": [ { "type": "Identifier", - "start": 360, - "end": 365, - "loc": { - "start": { - "line": 22, - "column": 12 - }, - "end": { - "line": 22, - "column": 17 - }, - "identifierName": "value" - }, + "start":360,"end":365,"loc":{"start":{"line":22,"column":12},"end":{"line":22,"column":17},"identifierName":"value"}, "name": "value" } ], "body": { "type": "BlockStatement", - "start": 367, - "end": 387, - "loc": { - "start": { - "line": 22, - "column": 19 - }, - "end": { - "line": 22, - "column": 39 - } - }, + "start":367,"end":387,"loc":{"start":{"line":22,"column":19},"end":{"line":22,"column":39}}, "body": [ { "type": "ExpressionStatement", - "start": 369, - "end": 385, - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 37 - } - }, + "start":369,"end":385,"loc":{"start":{"line":22,"column":21},"end":{"line":22,"column":37}}, "expression": { "type": "AssignmentExpression", - "start": 369, - "end": 385, - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 37 - } - }, + "start":369,"end":385,"loc":{"start":{"line":22,"column":21},"end":{"line":22,"column":37}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 369, - "end": 376, - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 28 - } - }, + "start":369,"end":376,"loc":{"start":{"line":22,"column":21},"end":{"line":22,"column":28}}, "object": { "type": "ThisExpression", - "start": 369, - "end": 373, - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 25 - } - } + "start":369,"end":373,"loc":{"start":{"line":22,"column":21},"end":{"line":22,"column":25}} }, "property": { "type": "PrivateName", - "start": 374, - "end": 376, - "loc": { - "start": { - "line": 22, - "column": 26 - }, - "end": { - "line": 22, - "column": 28 - } - }, + "start":374,"end":376,"loc":{"start":{"line":22,"column":26},"end":{"line":22,"column":28}}, "id": { "type": "Identifier", - "start": 375, - "end": 376, - "loc": { - "start": { - "line": 22, - "column": 27 - }, - "end": { - "line": 22, - "column": 28 - }, - "identifierName": "y" - }, + "start":375,"end":376,"loc":{"start":{"line":22,"column":27},"end":{"line":22,"column":28},"identifierName":"y"}, "name": "y" } }, @@ -1926,35 +619,12 @@ }, "right": { "type": "UnaryExpression", - "start": 379, - "end": 385, - "loc": { - "start": { - "line": 22, - "column": 31 - }, - "end": { - "line": 22, - "column": 37 - } - }, + "start":379,"end":385,"loc":{"start":{"line":22,"column":31},"end":{"line":22,"column":37}}, "operator": "+", "prefix": true, "argument": { "type": "Identifier", - "start": 380, - "end": 385, - "loc": { - "start": { - "line": 22, - "column": 32 - }, - "end": { - "line": 22, - "column": 37 - }, - "identifierName": "value" - }, + "start":380,"end":385,"loc":{"start":{"line":22,"column":32},"end":{"line":22,"column":37},"identifierName":"value"}, "name": "value" } } @@ -1966,34 +636,11 @@ }, { "type": "ClassMethod", - "start": 395, - "end": 452, - "loc": { - "start": { - "line": 24, - "column": 6 - }, - "end": { - "line": 24, - "column": 63 - } - }, + "start":395,"end":452,"loc":{"start":{"line":24,"column":6},"end":{"line":24,"column":63}}, "static": false, "key": { "type": "Identifier", - "start": 395, - "end": 401, - "loc": { - "start": { - "line": 24, - "column": 6 - }, - "end": { - "line": 24, - "column": 12 - }, - "identifierName": "equals" - }, + "start":395,"end":401,"loc":{"start":{"line":24,"column":6},"end":{"line":24,"column":12},"identifierName":"equals"}, "name": "equals" }, "computed": false, @@ -2004,137 +651,36 @@ "params": [ { "type": "Identifier", - "start": 402, - "end": 403, - "loc": { - "start": { - "line": 24, - "column": 13 - }, - "end": { - "line": 24, - "column": 14 - }, - "identifierName": "p" - }, + "start":402,"end":403,"loc":{"start":{"line":24,"column":13},"end":{"line":24,"column":14},"identifierName":"p"}, "name": "p" } ], "body": { "type": "BlockStatement", - "start": 405, - "end": 452, - "loc": { - "start": { - "line": 24, - "column": 16 - }, - "end": { - "line": 24, - "column": 63 - } - }, + "start":405,"end":452,"loc":{"start":{"line":24,"column":16},"end":{"line":24,"column":63}}, "body": [ { "type": "ReturnStatement", - "start": 407, - "end": 450, - "loc": { - "start": { - "line": 24, - "column": 18 - }, - "end": { - "line": 24, - "column": 61 - } - }, + "start":407,"end":450,"loc":{"start":{"line":24,"column":18},"end":{"line":24,"column":61}}, "argument": { "type": "LogicalExpression", - "start": 414, - "end": 450, - "loc": { - "start": { - "line": 24, - "column": 25 - }, - "end": { - "line": 24, - "column": 61 - } - }, + "start":414,"end":450,"loc":{"start":{"line":24,"column":25},"end":{"line":24,"column":61}}, "left": { "type": "BinaryExpression", - "start": 414, - "end": 430, - "loc": { - "start": { - "line": 24, - "column": 25 - }, - "end": { - "line": 24, - "column": 41 - } - }, + "start":414,"end":430,"loc":{"start":{"line":24,"column":25},"end":{"line":24,"column":41}}, "left": { "type": "MemberExpression", - "start": 414, - "end": 421, - "loc": { - "start": { - "line": 24, - "column": 25 - }, - "end": { - "line": 24, - "column": 32 - } - }, + "start":414,"end":421,"loc":{"start":{"line":24,"column":25},"end":{"line":24,"column":32}}, "object": { "type": "ThisExpression", - "start": 414, - "end": 418, - "loc": { - "start": { - "line": 24, - "column": 25 - }, - "end": { - "line": 24, - "column": 29 - } - } + "start":414,"end":418,"loc":{"start":{"line":24,"column":25},"end":{"line":24,"column":29}} }, "property": { "type": "PrivateName", - "start": 419, - "end": 421, - "loc": { - "start": { - "line": 24, - "column": 30 - }, - "end": { - "line": 24, - "column": 32 - } - }, + "start":419,"end":421,"loc":{"start":{"line":24,"column":30},"end":{"line":24,"column":32}}, "id": { "type": "Identifier", - "start": 420, - "end": 421, - "loc": { - "start": { - "line": 24, - "column": 31 - }, - "end": { - "line": 24, - "column": 32 - }, - "identifierName": "x" - }, + "start":420,"end":421,"loc":{"start":{"line":24,"column":31},"end":{"line":24,"column":32},"identifierName":"x"}, "name": "x" } }, @@ -2143,64 +689,18 @@ "operator": "===", "right": { "type": "MemberExpression", - "start": 426, - "end": 430, - "loc": { - "start": { - "line": 24, - "column": 37 - }, - "end": { - "line": 24, - "column": 41 - } - }, + "start":426,"end":430,"loc":{"start":{"line":24,"column":37},"end":{"line":24,"column":41}}, "object": { "type": "Identifier", - "start": 426, - "end": 427, - "loc": { - "start": { - "line": 24, - "column": 37 - }, - "end": { - "line": 24, - "column": 38 - }, - "identifierName": "p" - }, + "start":426,"end":427,"loc":{"start":{"line":24,"column":37},"end":{"line":24,"column":38},"identifierName":"p"}, "name": "p" }, "property": { "type": "PrivateName", - "start": 428, - "end": 430, - "loc": { - "start": { - "line": 24, - "column": 39 - }, - "end": { - "line": 24, - "column": 41 - } - }, + "start":428,"end":430,"loc":{"start":{"line":24,"column":39},"end":{"line":24,"column":41}}, "id": { "type": "Identifier", - "start": 429, - "end": 430, - "loc": { - "start": { - "line": 24, - "column": 40 - }, - "end": { - "line": 24, - "column": 41 - }, - "identifierName": "x" - }, + "start":429,"end":430,"loc":{"start":{"line":24,"column":40},"end":{"line":24,"column":41},"identifierName":"x"}, "name": "x" } }, @@ -2210,76 +710,20 @@ "operator": "&&", "right": { "type": "BinaryExpression", - "start": 434, - "end": 450, - "loc": { - "start": { - "line": 24, - "column": 45 - }, - "end": { - "line": 24, - "column": 61 - } - }, + "start":434,"end":450,"loc":{"start":{"line":24,"column":45},"end":{"line":24,"column":61}}, "left": { "type": "MemberExpression", - "start": 434, - "end": 441, - "loc": { - "start": { - "line": 24, - "column": 45 - }, - "end": { - "line": 24, - "column": 52 - } - }, + "start":434,"end":441,"loc":{"start":{"line":24,"column":45},"end":{"line":24,"column":52}}, "object": { "type": "ThisExpression", - "start": 434, - "end": 438, - "loc": { - "start": { - "line": 24, - "column": 45 - }, - "end": { - "line": 24, - "column": 49 - } - } + "start":434,"end":438,"loc":{"start":{"line":24,"column":45},"end":{"line":24,"column":49}} }, "property": { "type": "PrivateName", - "start": 439, - "end": 441, - "loc": { - "start": { - "line": 24, - "column": 50 - }, - "end": { - "line": 24, - "column": 52 - } - }, + "start":439,"end":441,"loc":{"start":{"line":24,"column":50},"end":{"line":24,"column":52}}, "id": { "type": "Identifier", - "start": 440, - "end": 441, - "loc": { - "start": { - "line": 24, - "column": 51 - }, - "end": { - "line": 24, - "column": 52 - }, - "identifierName": "y" - }, + "start":440,"end":441,"loc":{"start":{"line":24,"column":51},"end":{"line":24,"column":52},"identifierName":"y"}, "name": "y" } }, @@ -2288,64 +732,18 @@ "operator": "===", "right": { "type": "MemberExpression", - "start": 446, - "end": 450, - "loc": { - "start": { - "line": 24, - "column": 57 - }, - "end": { - "line": 24, - "column": 61 - } - }, + "start":446,"end":450,"loc":{"start":{"line":24,"column":57},"end":{"line":24,"column":61}}, "object": { "type": "Identifier", - "start": 446, - "end": 447, - "loc": { - "start": { - "line": 24, - "column": 57 - }, - "end": { - "line": 24, - "column": 58 - }, - "identifierName": "p" - }, + "start":446,"end":447,"loc":{"start":{"line":24,"column":57},"end":{"line":24,"column":58},"identifierName":"p"}, "name": "p" }, "property": { "type": "PrivateName", - "start": 448, - "end": 450, - "loc": { - "start": { - "line": 24, - "column": 59 - }, - "end": { - "line": 24, - "column": 61 - } - }, + "start":448,"end":450,"loc":{"start":{"line":24,"column":59},"end":{"line":24,"column":61}}, "id": { "type": "Identifier", - "start": 449, - "end": 450, - "loc": { - "start": { - "line": 24, - "column": 60 - }, - "end": { - "line": 24, - "column": 61 - }, - "identifierName": "y" - }, + "start":449,"end":450,"loc":{"start":{"line":24,"column":60},"end":{"line":24,"column":61},"identifierName":"y"}, "name": "y" } }, @@ -2360,34 +758,11 @@ }, { "type": "ClassMethod", - "start": 460, - "end": 516, - "loc": { - "start": { - "line": 26, - "column": 6 - }, - "end": { - "line": 26, - "column": 62 - } - }, + "start":460,"end":516,"loc":{"start":{"line":26,"column":6},"end":{"line":26,"column":62}}, "static": false, "key": { "type": "Identifier", - "start": 460, - "end": 468, - "loc": { - "start": { - "line": 26, - "column": 6 - }, - "end": { - "line": 26, - "column": 14 - }, - "identifierName": "toString" - }, + "start":460,"end":468,"loc":{"start":{"line":26,"column":6},"end":{"line":26,"column":14},"identifierName":"toString"}, "name": "toString" }, "computed": false, @@ -2398,106 +773,28 @@ "params": [], "body": { "type": "BlockStatement", - "start": 471, - "end": 516, - "loc": { - "start": { - "line": 26, - "column": 17 - }, - "end": { - "line": 26, - "column": 62 - } - }, + "start":471,"end":516,"loc":{"start":{"line":26,"column":17},"end":{"line":26,"column":62}}, "body": [ { "type": "ReturnStatement", - "start": 473, - "end": 514, - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 60 - } - }, + "start":473,"end":514,"loc":{"start":{"line":26,"column":19},"end":{"line":26,"column":60}}, "argument": { "type": "TemplateLiteral", - "start": 480, - "end": 514, - "loc": { - "start": { - "line": 26, - "column": 26 - }, - "end": { - "line": 26, - "column": 60 - } - }, + "start":480,"end":514,"loc":{"start":{"line":26,"column":26},"end":{"line":26,"column":60}}, "expressions": [ { "type": "MemberExpression", - "start": 490, - "end": 497, - "loc": { - "start": { - "line": 26, - "column": 36 - }, - "end": { - "line": 26, - "column": 43 - } - }, + "start":490,"end":497,"loc":{"start":{"line":26,"column":36},"end":{"line":26,"column":43}}, "object": { "type": "ThisExpression", - "start": 490, - "end": 494, - "loc": { - "start": { - "line": 26, - "column": 36 - }, - "end": { - "line": 26, - "column": 40 - } - } + "start":490,"end":494,"loc":{"start":{"line":26,"column":36},"end":{"line":26,"column":40}} }, "property": { "type": "PrivateName", - "start": 495, - "end": 497, - "loc": { - "start": { - "line": 26, - "column": 41 - }, - "end": { - "line": 26, - "column": 43 - } - }, + "start":495,"end":497,"loc":{"start":{"line":26,"column":41},"end":{"line":26,"column":43}}, "id": { "type": "Identifier", - "start": 496, - "end": 497, - "loc": { - "start": { - "line": 26, - "column": 42 - }, - "end": { - "line": 26, - "column": 43 - }, - "identifierName": "x" - }, + "start":496,"end":497,"loc":{"start":{"line":26,"column":42},"end":{"line":26,"column":43},"identifierName":"x"}, "name": "x" } }, @@ -2505,62 +802,17 @@ }, { "type": "MemberExpression", - "start": 503, - "end": 510, - "loc": { - "start": { - "line": 26, - "column": 49 - }, - "end": { - "line": 26, - "column": 56 - } - }, + "start":503,"end":510,"loc":{"start":{"line":26,"column":49},"end":{"line":26,"column":56}}, "object": { "type": "ThisExpression", - "start": 503, - "end": 507, - "loc": { - "start": { - "line": 26, - "column": 49 - }, - "end": { - "line": 26, - "column": 53 - } - } + "start":503,"end":507,"loc":{"start":{"line":26,"column":49},"end":{"line":26,"column":53}} }, "property": { "type": "PrivateName", - "start": 508, - "end": 510, - "loc": { - "start": { - "line": 26, - "column": 54 - }, - "end": { - "line": 26, - "column": 56 - } - }, + "start":508,"end":510,"loc":{"start":{"line":26,"column":54},"end":{"line":26,"column":56}}, "id": { "type": "Identifier", - "start": 509, - "end": 510, - "loc": { - "start": { - "line": 26, - "column": 55 - }, - "end": { - "line": 26, - "column": 56 - }, - "identifierName": "y" - }, + "start":509,"end":510,"loc":{"start":{"line":26,"column":55},"end":{"line":26,"column":56},"identifierName":"y"}, "name": "y" } }, @@ -2570,18 +822,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 481, - "end": 487, - "loc": { - "start": { - "line": 26, - "column": 27 - }, - "end": { - "line": 26, - "column": 33 - } - }, + "start":481,"end":487,"loc":{"start":{"line":26,"column":27},"end":{"line":26,"column":33}}, "value": { "raw": "Point<", "cooked": "Point<" @@ -2590,18 +831,7 @@ }, { "type": "TemplateElement", - "start": 499, - "end": 500, - "loc": { - "start": { - "line": 26, - "column": 45 - }, - "end": { - "line": 26, - "column": 46 - } - }, + "start":499,"end":500,"loc":{"start":{"line":26,"column":45},"end":{"line":26,"column":46}}, "value": { "raw": ",", "cooked": "," @@ -2610,18 +840,7 @@ }, { "type": "TemplateElement", - "start": 512, - "end": 513, - "loc": { - "start": { - "line": 26, - "column": 58 - }, - "end": { - "line": 26, - "column": 59 - } - }, + "start":512,"end":513,"loc":{"start":{"line":26,"column":58},"end":{"line":26,"column":59}}, "value": { "raw": ">", "cooked": ">" @@ -2646,34 +865,11 @@ }, { "type": "ClassMethod", - "start": 531, - "end": 557, - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 30, - "column": 28 - } - }, + "start":531,"end":557,"loc":{"start":{"line":30,"column":2},"end":{"line":30,"column":28}}, "static": false, "key": { "type": "Identifier", - "start": 535, - "end": 536, - "loc": { - "start": { - "line": 30, - "column": 6 - }, - "end": { - "line": 30, - "column": 7 - }, - "identifierName": "x" - }, + "start":535,"end":536,"loc":{"start":{"line":30,"column":6},"end":{"line":30,"column":7},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -2684,91 +880,24 @@ "params": [], "body": { "type": "BlockStatement", - "start": 539, - "end": 557, - "loc": { - "start": { - "line": 30, - "column": 10 - }, - "end": { - "line": 30, - "column": 28 - } - }, + "start":539,"end":557,"loc":{"start":{"line":30,"column":10},"end":{"line":30,"column":28}}, "body": [ { "type": "ReturnStatement", - "start": 541, - "end": 555, - "loc": { - "start": { - "line": 30, - "column": 12 - }, - "end": { - "line": 30, - "column": 26 - } - }, + "start":541,"end":555,"loc":{"start":{"line":30,"column":12},"end":{"line":30,"column":26}}, "argument": { "type": "MemberExpression", - "start": 548, - "end": 555, - "loc": { - "start": { - "line": 30, - "column": 19 - }, - "end": { - "line": 30, - "column": 26 - } - }, + "start":548,"end":555,"loc":{"start":{"line":30,"column":19},"end":{"line":30,"column":26}}, "object": { "type": "ThisExpression", - "start": 548, - "end": 552, - "loc": { - "start": { - "line": 30, - "column": 19 - }, - "end": { - "line": 30, - "column": 23 - } - } + "start":548,"end":552,"loc":{"start":{"line":30,"column":19},"end":{"line":30,"column":23}} }, "property": { "type": "PrivateName", - "start": 553, - "end": 555, - "loc": { - "start": { - "line": 30, - "column": 24 - }, - "end": { - "line": 30, - "column": 26 - } - }, + "start":553,"end":555,"loc":{"start":{"line":30,"column":24},"end":{"line":30,"column":26}}, "id": { "type": "Identifier", - "start": 554, - "end": 555, - "loc": { - "start": { - "line": 30, - "column": 25 - }, - "end": { - "line": 30, - "column": 26 - }, - "identifierName": "x" - }, + "start":554,"end":555,"loc":{"start":{"line":30,"column":25},"end":{"line":30,"column":26},"identifierName":"x"}, "name": "x" } }, @@ -2781,34 +910,11 @@ }, { "type": "ClassMethod", - "start": 560, - "end": 593, - "loc": { - "start": { - "line": 31, - "column": 2 - }, - "end": { - "line": 31, - "column": 35 - } - }, + "start":560,"end":593,"loc":{"start":{"line":31,"column":2},"end":{"line":31,"column":35}}, "static": false, "key": { "type": "Identifier", - "start": 564, - "end": 565, - "loc": { - "start": { - "line": 31, - "column": 6 - }, - "end": { - "line": 31, - "column": 7 - }, - "identifierName": "x" - }, + "start":564,"end":565,"loc":{"start":{"line":31,"column":6},"end":{"line":31,"column":7},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -2819,124 +925,34 @@ "params": [ { "type": "Identifier", - "start": 566, - "end": 571, - "loc": { - "start": { - "line": 31, - "column": 8 - }, - "end": { - "line": 31, - "column": 13 - }, - "identifierName": "value" - }, + "start":566,"end":571,"loc":{"start":{"line":31,"column":8},"end":{"line":31,"column":13},"identifierName":"value"}, "name": "value" } ], "body": { "type": "BlockStatement", - "start": 573, - "end": 593, - "loc": { - "start": { - "line": 31, - "column": 15 - }, - "end": { - "line": 31, - "column": 35 - } - }, + "start":573,"end":593,"loc":{"start":{"line":31,"column":15},"end":{"line":31,"column":35}}, "body": [ { "type": "ExpressionStatement", - "start": 575, - "end": 591, - "loc": { - "start": { - "line": 31, - "column": 17 - }, - "end": { - "line": 31, - "column": 33 - } - }, + "start":575,"end":591,"loc":{"start":{"line":31,"column":17},"end":{"line":31,"column":33}}, "expression": { "type": "AssignmentExpression", - "start": 575, - "end": 591, - "loc": { - "start": { - "line": 31, - "column": 17 - }, - "end": { - "line": 31, - "column": 33 - } - }, + "start":575,"end":591,"loc":{"start":{"line":31,"column":17},"end":{"line":31,"column":33}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 575, - "end": 582, - "loc": { - "start": { - "line": 31, - "column": 17 - }, - "end": { - "line": 31, - "column": 24 - } - }, + "start":575,"end":582,"loc":{"start":{"line":31,"column":17},"end":{"line":31,"column":24}}, "object": { "type": "ThisExpression", - "start": 575, - "end": 579, - "loc": { - "start": { - "line": 31, - "column": 17 - }, - "end": { - "line": 31, - "column": 21 - } - } + "start":575,"end":579,"loc":{"start":{"line":31,"column":17},"end":{"line":31,"column":21}} }, "property": { "type": "PrivateName", - "start": 580, - "end": 582, - "loc": { - "start": { - "line": 31, - "column": 22 - }, - "end": { - "line": 31, - "column": 24 - } - }, + "start":580,"end":582,"loc":{"start":{"line":31,"column":22},"end":{"line":31,"column":24}}, "id": { "type": "Identifier", - "start": 581, - "end": 582, - "loc": { - "start": { - "line": 31, - "column": 23 - }, - "end": { - "line": 31, - "column": 24 - }, - "identifierName": "x" - }, + "start":581,"end":582,"loc":{"start":{"line":31,"column":23},"end":{"line":31,"column":24},"identifierName":"x"}, "name": "x" } }, @@ -2944,35 +960,12 @@ }, "right": { "type": "UnaryExpression", - "start": 585, - "end": 591, - "loc": { - "start": { - "line": 31, - "column": 27 - }, - "end": { - "line": 31, - "column": 33 - } - }, + "start":585,"end":591,"loc":{"start":{"line":31,"column":27},"end":{"line":31,"column":33}}, "operator": "+", "prefix": true, "argument": { "type": "Identifier", - "start": 586, - "end": 591, - "loc": { - "start": { - "line": 31, - "column": 28 - }, - "end": { - "line": 31, - "column": 33 - }, - "identifierName": "value" - }, + "start":586,"end":591,"loc":{"start":{"line":31,"column":28},"end":{"line":31,"column":33},"identifierName":"value"}, "name": "value" } } @@ -2984,34 +977,11 @@ }, { "type": "ClassMethod", - "start": 597, - "end": 623, - "loc": { - "start": { - "line": 33, - "column": 2 - }, - "end": { - "line": 33, - "column": 28 - } - }, + "start":597,"end":623,"loc":{"start":{"line":33,"column":2},"end":{"line":33,"column":28}}, "static": false, "key": { "type": "Identifier", - "start": 601, - "end": 602, - "loc": { - "start": { - "line": 33, - "column": 6 - }, - "end": { - "line": 33, - "column": 7 - }, - "identifierName": "y" - }, + "start":601,"end":602,"loc":{"start":{"line":33,"column":6},"end":{"line":33,"column":7},"identifierName":"y"}, "name": "y" }, "computed": false, @@ -3022,91 +992,24 @@ "params": [], "body": { "type": "BlockStatement", - "start": 605, - "end": 623, - "loc": { - "start": { - "line": 33, - "column": 10 - }, - "end": { - "line": 33, - "column": 28 - } - }, + "start":605,"end":623,"loc":{"start":{"line":33,"column":10},"end":{"line":33,"column":28}}, "body": [ { "type": "ReturnStatement", - "start": 607, - "end": 621, - "loc": { - "start": { - "line": 33, - "column": 12 - }, - "end": { - "line": 33, - "column": 26 - } - }, + "start":607,"end":621,"loc":{"start":{"line":33,"column":12},"end":{"line":33,"column":26}}, "argument": { "type": "MemberExpression", - "start": 614, - "end": 621, - "loc": { - "start": { - "line": 33, - "column": 19 - }, - "end": { - "line": 33, - "column": 26 - } - }, + "start":614,"end":621,"loc":{"start":{"line":33,"column":19},"end":{"line":33,"column":26}}, "object": { "type": "ThisExpression", - "start": 614, - "end": 618, - "loc": { - "start": { - "line": 33, - "column": 19 - }, - "end": { - "line": 33, - "column": 23 - } - } + "start":614,"end":618,"loc":{"start":{"line":33,"column":19},"end":{"line":33,"column":23}} }, "property": { "type": "PrivateName", - "start": 619, - "end": 621, - "loc": { - "start": { - "line": 33, - "column": 24 - }, - "end": { - "line": 33, - "column": 26 - } - }, + "start":619,"end":621,"loc":{"start":{"line":33,"column":24},"end":{"line":33,"column":26}}, "id": { "type": "Identifier", - "start": 620, - "end": 621, - "loc": { - "start": { - "line": 33, - "column": 25 - }, - "end": { - "line": 33, - "column": 26 - }, - "identifierName": "y" - }, + "start":620,"end":621,"loc":{"start":{"line":33,"column":25},"end":{"line":33,"column":26},"identifierName":"y"}, "name": "y" } }, @@ -3119,34 +1022,11 @@ }, { "type": "ClassMethod", - "start": 626, - "end": 659, - "loc": { - "start": { - "line": 34, - "column": 2 - }, - "end": { - "line": 34, - "column": 35 - } - }, + "start":626,"end":659,"loc":{"start":{"line":34,"column":2},"end":{"line":34,"column":35}}, "static": false, "key": { "type": "Identifier", - "start": 630, - "end": 631, - "loc": { - "start": { - "line": 34, - "column": 6 - }, - "end": { - "line": 34, - "column": 7 - }, - "identifierName": "y" - }, + "start":630,"end":631,"loc":{"start":{"line":34,"column":6},"end":{"line":34,"column":7},"identifierName":"y"}, "name": "y" }, "computed": false, @@ -3157,124 +1037,34 @@ "params": [ { "type": "Identifier", - "start": 632, - "end": 637, - "loc": { - "start": { - "line": 34, - "column": 8 - }, - "end": { - "line": 34, - "column": 13 - }, - "identifierName": "value" - }, + "start":632,"end":637,"loc":{"start":{"line":34,"column":8},"end":{"line":34,"column":13},"identifierName":"value"}, "name": "value" } ], "body": { "type": "BlockStatement", - "start": 639, - "end": 659, - "loc": { - "start": { - "line": 34, - "column": 15 - }, - "end": { - "line": 34, - "column": 35 - } - }, + "start":639,"end":659,"loc":{"start":{"line":34,"column":15},"end":{"line":34,"column":35}}, "body": [ { "type": "ExpressionStatement", - "start": 641, - "end": 657, - "loc": { - "start": { - "line": 34, - "column": 17 - }, - "end": { - "line": 34, - "column": 33 - } - }, + "start":641,"end":657,"loc":{"start":{"line":34,"column":17},"end":{"line":34,"column":33}}, "expression": { "type": "AssignmentExpression", - "start": 641, - "end": 657, - "loc": { - "start": { - "line": 34, - "column": 17 - }, - "end": { - "line": 34, - "column": 33 - } - }, + "start":641,"end":657,"loc":{"start":{"line":34,"column":17},"end":{"line":34,"column":33}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 641, - "end": 648, - "loc": { - "start": { - "line": 34, - "column": 17 - }, - "end": { - "line": 34, - "column": 24 - } - }, + "start":641,"end":648,"loc":{"start":{"line":34,"column":17},"end":{"line":34,"column":24}}, "object": { "type": "ThisExpression", - "start": 641, - "end": 645, - "loc": { - "start": { - "line": 34, - "column": 17 - }, - "end": { - "line": 34, - "column": 21 - } - } + "start":641,"end":645,"loc":{"start":{"line":34,"column":17},"end":{"line":34,"column":21}} }, "property": { "type": "PrivateName", - "start": 646, - "end": 648, - "loc": { - "start": { - "line": 34, - "column": 22 - }, - "end": { - "line": 34, - "column": 24 - } - }, + "start":646,"end":648,"loc":{"start":{"line":34,"column":22},"end":{"line":34,"column":24}}, "id": { "type": "Identifier", - "start": 647, - "end": 648, - "loc": { - "start": { - "line": 34, - "column": 23 - }, - "end": { - "line": 34, - "column": 24 - }, - "identifierName": "y" - }, + "start":647,"end":648,"loc":{"start":{"line":34,"column":23},"end":{"line":34,"column":24},"identifierName":"y"}, "name": "y" } }, @@ -3282,35 +1072,12 @@ }, "right": { "type": "UnaryExpression", - "start": 651, - "end": 657, - "loc": { - "start": { - "line": 34, - "column": 27 - }, - "end": { - "line": 34, - "column": 33 - } - }, + "start":651,"end":657,"loc":{"start":{"line":34,"column":27},"end":{"line":34,"column":33}}, "operator": "+", "prefix": true, "argument": { "type": "Identifier", - "start": 652, - "end": 657, - "loc": { - "start": { - "line": 34, - "column": 28 - }, - "end": { - "line": 34, - "column": 33 - }, - "identifierName": "value" - }, + "start":652,"end":657,"loc":{"start":{"line":34,"column":28},"end":{"line":34,"column":33},"identifierName":"value"}, "name": "value" } } @@ -3322,34 +1089,11 @@ }, { "type": "ClassMethod", - "start": 663, - "end": 720, - "loc": { - "start": { - "line": 36, - "column": 2 - }, - "end": { - "line": 36, - "column": 59 - } - }, + "start":663,"end":720,"loc":{"start":{"line":36,"column":2},"end":{"line":36,"column":59}}, "static": false, "key": { "type": "Identifier", - "start": 663, - "end": 669, - "loc": { - "start": { - "line": 36, - "column": 2 - }, - "end": { - "line": 36, - "column": 8 - }, - "identifierName": "equals" - }, + "start":663,"end":669,"loc":{"start":{"line":36,"column":2},"end":{"line":36,"column":8},"identifierName":"equals"}, "name": "equals" }, "computed": false, @@ -3360,137 +1104,36 @@ "params": [ { "type": "Identifier", - "start": 670, - "end": 671, - "loc": { - "start": { - "line": 36, - "column": 9 - }, - "end": { - "line": 36, - "column": 10 - }, - "identifierName": "p" - }, + "start":670,"end":671,"loc":{"start":{"line":36,"column":9},"end":{"line":36,"column":10},"identifierName":"p"}, "name": "p" } ], "body": { "type": "BlockStatement", - "start": 673, - "end": 720, - "loc": { - "start": { - "line": 36, - "column": 12 - }, - "end": { - "line": 36, - "column": 59 - } - }, + "start":673,"end":720,"loc":{"start":{"line":36,"column":12},"end":{"line":36,"column":59}}, "body": [ { "type": "ReturnStatement", - "start": 675, - "end": 718, - "loc": { - "start": { - "line": 36, - "column": 14 - }, - "end": { - "line": 36, - "column": 57 - } - }, + "start":675,"end":718,"loc":{"start":{"line":36,"column":14},"end":{"line":36,"column":57}}, "argument": { "type": "LogicalExpression", - "start": 682, - "end": 718, - "loc": { - "start": { - "line": 36, - "column": 21 - }, - "end": { - "line": 36, - "column": 57 - } - }, + "start":682,"end":718,"loc":{"start":{"line":36,"column":21},"end":{"line":36,"column":57}}, "left": { "type": "BinaryExpression", - "start": 682, - "end": 698, - "loc": { - "start": { - "line": 36, - "column": 21 - }, - "end": { - "line": 36, - "column": 37 - } - }, + "start":682,"end":698,"loc":{"start":{"line":36,"column":21},"end":{"line":36,"column":37}}, "left": { "type": "MemberExpression", - "start": 682, - "end": 689, - "loc": { - "start": { - "line": 36, - "column": 21 - }, - "end": { - "line": 36, - "column": 28 - } - }, + "start":682,"end":689,"loc":{"start":{"line":36,"column":21},"end":{"line":36,"column":28}}, "object": { "type": "ThisExpression", - "start": 682, - "end": 686, - "loc": { - "start": { - "line": 36, - "column": 21 - }, - "end": { - "line": 36, - "column": 25 - } - } + "start":682,"end":686,"loc":{"start":{"line":36,"column":21},"end":{"line":36,"column":25}} }, "property": { "type": "PrivateName", - "start": 687, - "end": 689, - "loc": { - "start": { - "line": 36, - "column": 26 - }, - "end": { - "line": 36, - "column": 28 - } - }, + "start":687,"end":689,"loc":{"start":{"line":36,"column":26},"end":{"line":36,"column":28}}, "id": { "type": "Identifier", - "start": 688, - "end": 689, - "loc": { - "start": { - "line": 36, - "column": 27 - }, - "end": { - "line": 36, - "column": 28 - }, - "identifierName": "x" - }, + "start":688,"end":689,"loc":{"start":{"line":36,"column":27},"end":{"line":36,"column":28},"identifierName":"x"}, "name": "x" } }, @@ -3499,64 +1142,18 @@ "operator": "===", "right": { "type": "MemberExpression", - "start": 694, - "end": 698, - "loc": { - "start": { - "line": 36, - "column": 33 - }, - "end": { - "line": 36, - "column": 37 - } - }, + "start":694,"end":698,"loc":{"start":{"line":36,"column":33},"end":{"line":36,"column":37}}, "object": { "type": "Identifier", - "start": 694, - "end": 695, - "loc": { - "start": { - "line": 36, - "column": 33 - }, - "end": { - "line": 36, - "column": 34 - }, - "identifierName": "p" - }, + "start":694,"end":695,"loc":{"start":{"line":36,"column":33},"end":{"line":36,"column":34},"identifierName":"p"}, "name": "p" }, "property": { "type": "PrivateName", - "start": 696, - "end": 698, - "loc": { - "start": { - "line": 36, - "column": 35 - }, - "end": { - "line": 36, - "column": 37 - } - }, + "start":696,"end":698,"loc":{"start":{"line":36,"column":35},"end":{"line":36,"column":37}}, "id": { "type": "Identifier", - "start": 697, - "end": 698, - "loc": { - "start": { - "line": 36, - "column": 36 - }, - "end": { - "line": 36, - "column": 37 - }, - "identifierName": "x" - }, + "start":697,"end":698,"loc":{"start":{"line":36,"column":36},"end":{"line":36,"column":37},"identifierName":"x"}, "name": "x" } }, @@ -3566,76 +1163,20 @@ "operator": "&&", "right": { "type": "BinaryExpression", - "start": 702, - "end": 718, - "loc": { - "start": { - "line": 36, - "column": 41 - }, - "end": { - "line": 36, - "column": 57 - } - }, + "start":702,"end":718,"loc":{"start":{"line":36,"column":41},"end":{"line":36,"column":57}}, "left": { "type": "MemberExpression", - "start": 702, - "end": 709, - "loc": { - "start": { - "line": 36, - "column": 41 - }, - "end": { - "line": 36, - "column": 48 - } - }, + "start":702,"end":709,"loc":{"start":{"line":36,"column":41},"end":{"line":36,"column":48}}, "object": { "type": "ThisExpression", - "start": 702, - "end": 706, - "loc": { - "start": { - "line": 36, - "column": 41 - }, - "end": { - "line": 36, - "column": 45 - } - } + "start":702,"end":706,"loc":{"start":{"line":36,"column":41},"end":{"line":36,"column":45}} }, "property": { "type": "PrivateName", - "start": 707, - "end": 709, - "loc": { - "start": { - "line": 36, - "column": 46 - }, - "end": { - "line": 36, - "column": 48 - } - }, + "start":707,"end":709,"loc":{"start":{"line":36,"column":46},"end":{"line":36,"column":48}}, "id": { "type": "Identifier", - "start": 708, - "end": 709, - "loc": { - "start": { - "line": 36, - "column": 47 - }, - "end": { - "line": 36, - "column": 48 - }, - "identifierName": "y" - }, + "start":708,"end":709,"loc":{"start":{"line":36,"column":47},"end":{"line":36,"column":48},"identifierName":"y"}, "name": "y" } }, @@ -3644,64 +1185,18 @@ "operator": "===", "right": { "type": "MemberExpression", - "start": 714, - "end": 718, - "loc": { - "start": { - "line": 36, - "column": 53 - }, - "end": { - "line": 36, - "column": 57 - } - }, + "start":714,"end":718,"loc":{"start":{"line":36,"column":53},"end":{"line":36,"column":57}}, "object": { "type": "Identifier", - "start": 714, - "end": 715, - "loc": { - "start": { - "line": 36, - "column": 53 - }, - "end": { - "line": 36, - "column": 54 - }, - "identifierName": "p" - }, + "start":714,"end":715,"loc":{"start":{"line":36,"column":53},"end":{"line":36,"column":54},"identifierName":"p"}, "name": "p" }, "property": { "type": "PrivateName", - "start": 716, - "end": 718, - "loc": { - "start": { - "line": 36, - "column": 55 - }, - "end": { - "line": 36, - "column": 57 - } - }, + "start":716,"end":718,"loc":{"start":{"line":36,"column":55},"end":{"line":36,"column":57}}, "id": { "type": "Identifier", - "start": 717, - "end": 718, - "loc": { - "start": { - "line": 36, - "column": 56 - }, - "end": { - "line": 36, - "column": 57 - }, - "identifierName": "y" - }, + "start":717,"end":718,"loc":{"start":{"line":36,"column":56},"end":{"line":36,"column":57},"identifierName":"y"}, "name": "y" } }, @@ -3716,34 +1211,11 @@ }, { "type": "ClassMethod", - "start": 724, - "end": 780, - "loc": { - "start": { - "line": 38, - "column": 2 - }, - "end": { - "line": 38, - "column": 58 - } - }, + "start":724,"end":780,"loc":{"start":{"line":38,"column":2},"end":{"line":38,"column":58}}, "static": false, "key": { "type": "Identifier", - "start": 724, - "end": 732, - "loc": { - "start": { - "line": 38, - "column": 2 - }, - "end": { - "line": 38, - "column": 10 - }, - "identifierName": "toString" - }, + "start":724,"end":732,"loc":{"start":{"line":38,"column":2},"end":{"line":38,"column":10},"identifierName":"toString"}, "name": "toString" }, "computed": false, @@ -3754,106 +1226,28 @@ "params": [], "body": { "type": "BlockStatement", - "start": 735, - "end": 780, - "loc": { - "start": { - "line": 38, - "column": 13 - }, - "end": { - "line": 38, - "column": 58 - } - }, + "start":735,"end":780,"loc":{"start":{"line":38,"column":13},"end":{"line":38,"column":58}}, "body": [ { "type": "ReturnStatement", - "start": 737, - "end": 778, - "loc": { - "start": { - "line": 38, - "column": 15 - }, - "end": { - "line": 38, - "column": 56 - } - }, + "start":737,"end":778,"loc":{"start":{"line":38,"column":15},"end":{"line":38,"column":56}}, "argument": { "type": "TemplateLiteral", - "start": 744, - "end": 778, - "loc": { - "start": { - "line": 38, - "column": 22 - }, - "end": { - "line": 38, - "column": 56 - } - }, + "start":744,"end":778,"loc":{"start":{"line":38,"column":22},"end":{"line":38,"column":56}}, "expressions": [ { "type": "MemberExpression", - "start": 754, - "end": 761, - "loc": { - "start": { - "line": 38, - "column": 32 - }, - "end": { - "line": 38, - "column": 39 - } - }, + "start":754,"end":761,"loc":{"start":{"line":38,"column":32},"end":{"line":38,"column":39}}, "object": { "type": "ThisExpression", - "start": 754, - "end": 758, - "loc": { - "start": { - "line": 38, - "column": 32 - }, - "end": { - "line": 38, - "column": 36 - } - } + "start":754,"end":758,"loc":{"start":{"line":38,"column":32},"end":{"line":38,"column":36}} }, "property": { "type": "PrivateName", - "start": 759, - "end": 761, - "loc": { - "start": { - "line": 38, - "column": 37 - }, - "end": { - "line": 38, - "column": 39 - } - }, + "start":759,"end":761,"loc":{"start":{"line":38,"column":37},"end":{"line":38,"column":39}}, "id": { "type": "Identifier", - "start": 760, - "end": 761, - "loc": { - "start": { - "line": 38, - "column": 38 - }, - "end": { - "line": 38, - "column": 39 - }, - "identifierName": "x" - }, + "start":760,"end":761,"loc":{"start":{"line":38,"column":38},"end":{"line":38,"column":39},"identifierName":"x"}, "name": "x" } }, @@ -3861,62 +1255,17 @@ }, { "type": "MemberExpression", - "start": 767, - "end": 774, - "loc": { - "start": { - "line": 38, - "column": 45 - }, - "end": { - "line": 38, - "column": 52 - } - }, + "start":767,"end":774,"loc":{"start":{"line":38,"column":45},"end":{"line":38,"column":52}}, "object": { "type": "ThisExpression", - "start": 767, - "end": 771, - "loc": { - "start": { - "line": 38, - "column": 45 - }, - "end": { - "line": 38, - "column": 49 - } - } + "start":767,"end":771,"loc":{"start":{"line":38,"column":45},"end":{"line":38,"column":49}} }, "property": { "type": "PrivateName", - "start": 772, - "end": 774, - "loc": { - "start": { - "line": 38, - "column": 50 - }, - "end": { - "line": 38, - "column": 52 - } - }, + "start":772,"end":774,"loc":{"start":{"line":38,"column":50},"end":{"line":38,"column":52}}, "id": { "type": "Identifier", - "start": 773, - "end": 774, - "loc": { - "start": { - "line": 38, - "column": 51 - }, - "end": { - "line": 38, - "column": 52 - }, - "identifierName": "y" - }, + "start":773,"end":774,"loc":{"start":{"line":38,"column":51},"end":{"line":38,"column":52},"identifierName":"y"}, "name": "y" } }, @@ -3926,18 +1275,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 745, - "end": 751, - "loc": { - "start": { - "line": 38, - "column": 23 - }, - "end": { - "line": 38, - "column": 29 - } - }, + "start":745,"end":751,"loc":{"start":{"line":38,"column":23},"end":{"line":38,"column":29}}, "value": { "raw": "Point<", "cooked": "Point<" @@ -3946,18 +1284,7 @@ }, { "type": "TemplateElement", - "start": 763, - "end": 764, - "loc": { - "start": { - "line": 38, - "column": 41 - }, - "end": { - "line": 38, - "column": 42 - } - }, + "start":763,"end":764,"loc":{"start":{"line":38,"column":41},"end":{"line":38,"column":42}}, "value": { "raw": ",", "cooked": "," @@ -3966,18 +1293,7 @@ }, { "type": "TemplateElement", - "start": 776, - "end": 777, - "loc": { - "start": { - "line": 38, - "column": 54 - }, - "end": { - "line": 38, - "column": 55 - } - }, + "start":776,"end":777,"loc":{"start":{"line":38,"column":54},"end":{"line":38,"column":55}}, "value": { "raw": ">", "cooked": ">" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/pbn-success/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/pbn-success/output.json index 23703cf19b..31ce19c94e 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/pbn-success/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/pbn-success/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 359, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 19, - "column": 1 - } - }, + "start":0,"end":359,"loc":{"start":{"line":1,"column":0},"end":{"line":19,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 359, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 19, - "column": 1 - } - }, + "start":0,"end":359,"loc":{"start":{"line":1,"column":0},"end":{"line":19,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 359, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 19, - "column": 1 - } - }, + "start":0,"end":359,"loc":{"start":{"line":1,"column":0},"end":{"line":19,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "Point" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"Point"}, "name": "Point" }, "superClass": null, "body": { "type": "ClassBody", - "start": 12, - "end": 359, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 19, - "column": 1 - } - }, + "start":12,"end":359,"loc":{"start":{"line":1,"column":12},"end":{"line":19,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":16,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, "value": { "type": "NumericLiteral", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "extra": { "rawValue": 1, "raw": "1" @@ -146,65 +45,20 @@ }, { "type": "ClassPrivateProperty", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":26,"end":33,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "static": false, "key": { "type": "PrivateName", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":26,"end":28,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "y" - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"y"}, "name": "y" } }, "value": { "type": "NumericLiteral", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":31,"end":32,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, "extra": { "rawValue": 2, "raw": "2" @@ -214,34 +68,11 @@ }, { "type": "ClassMethod", - "start": 37, - "end": 104, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 8, - "column": 3 - } - }, + "start":37,"end":104,"loc":{"start":{"line":5,"column":2},"end":{"line":8,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 37, - "end": 48, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":37,"end":48,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -252,49 +83,15 @@ "params": [ { "type": "AssignmentPattern", - "start": 49, - "end": 54, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 19 - } - }, + "start":49,"end":54,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":19}}, "left": { "type": "Identifier", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 15 - }, - "identifierName": "x" - }, + "start":49,"end":50,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":15},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 5, - "column": 18 - }, - "end": { - "line": 5, - "column": 19 - } - }, + "start":53,"end":54,"loc":{"start":{"line":5,"column":18},"end":{"line":5,"column":19}}, "extra": { "rawValue": 0, "raw": "0" @@ -304,49 +101,15 @@ }, { "type": "AssignmentPattern", - "start": 56, - "end": 61, - "loc": { - "start": { - "line": 5, - "column": 21 - }, - "end": { - "line": 5, - "column": 26 - } - }, + "start":56,"end":61,"loc":{"start":{"line":5,"column":21},"end":{"line":5,"column":26}}, "left": { "type": "Identifier", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 5, - "column": 21 - }, - "end": { - "line": 5, - "column": 22 - }, - "identifierName": "y" - }, + "start":56,"end":57,"loc":{"start":{"line":5,"column":21},"end":{"line":5,"column":22},"identifierName":"y"}, "name": "y" }, "right": { "type": "NumericLiteral", - "start": 60, - "end": 61, - "loc": { - "start": { - "line": 5, - "column": 25 - }, - "end": { - "line": 5, - "column": 26 - } - }, + "start":60,"end":61,"loc":{"start":{"line":5,"column":25},"end":{"line":5,"column":26}}, "extra": { "rawValue": 0, "raw": "0" @@ -357,106 +120,28 @@ ], "body": { "type": "BlockStatement", - "start": 63, - "end": 104, - "loc": { - "start": { - "line": 5, - "column": 28 - }, - "end": { - "line": 8, - "column": 3 - } - }, + "start":63,"end":104,"loc":{"start":{"line":5,"column":28},"end":{"line":8,"column":3}}, "body": [ { "type": "ExpressionStatement", - "start": 69, - "end": 82, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":69,"end":82,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":17}}, "expression": { "type": "AssignmentExpression", - "start": 69, - "end": 81, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 16 - } - }, + "start":69,"end":81,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":16}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 69, - "end": 76, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 11 - } - }, + "start":69,"end":76,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":11}}, "object": { "type": "ThisExpression", - "start": 69, - "end": 73, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 8 - } - } + "start":69,"end":73,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":8}} }, "property": { "type": "PrivateName", - "start": 74, - "end": 76, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 11 - } - }, + "start":74,"end":76,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":11}}, "id": { "type": "Identifier", - "start": 75, - "end": 76, - "loc": { - "start": { - "line": 6, - "column": 10 - }, - "end": { - "line": 6, - "column": 11 - }, - "identifierName": "x" - }, + "start":75,"end":76,"loc":{"start":{"line":6,"column":10},"end":{"line":6,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -464,35 +149,12 @@ }, "right": { "type": "UnaryExpression", - "start": 79, - "end": 81, - "loc": { - "start": { - "line": 6, - "column": 14 - }, - "end": { - "line": 6, - "column": 16 - } - }, + "start":79,"end":81,"loc":{"start":{"line":6,"column":14},"end":{"line":6,"column":16}}, "operator": "+", "prefix": true, "argument": { "type": "Identifier", - "start": 80, - "end": 81, - "loc": { - "start": { - "line": 6, - "column": 15 - }, - "end": { - "line": 6, - "column": 16 - }, - "identifierName": "x" - }, + "start":80,"end":81,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":16},"identifierName":"x"}, "name": "x" } } @@ -500,91 +162,24 @@ }, { "type": "ExpressionStatement", - "start": 87, - "end": 100, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 17 - } - }, + "start":87,"end":100,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":17}}, "expression": { "type": "AssignmentExpression", - "start": 87, - "end": 99, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 16 - } - }, + "start":87,"end":99,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":16}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 87, - "end": 94, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 11 - } - }, + "start":87,"end":94,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":11}}, "object": { "type": "ThisExpression", - "start": 87, - "end": 91, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 8 - } - } + "start":87,"end":91,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":8}} }, "property": { "type": "PrivateName", - "start": 92, - "end": 94, - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 11 - } - }, + "start":92,"end":94,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":11}}, "id": { "type": "Identifier", - "start": 93, - "end": 94, - "loc": { - "start": { - "line": 7, - "column": 10 - }, - "end": { - "line": 7, - "column": 11 - }, - "identifierName": "y" - }, + "start":93,"end":94,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":11},"identifierName":"y"}, "name": "y" } }, @@ -592,35 +187,12 @@ }, "right": { "type": "UnaryExpression", - "start": 97, - "end": 99, - "loc": { - "start": { - "line": 7, - "column": 14 - }, - "end": { - "line": 7, - "column": 16 - } - }, + "start":97,"end":99,"loc":{"start":{"line":7,"column":14},"end":{"line":7,"column":16}}, "operator": "+", "prefix": true, "argument": { "type": "Identifier", - "start": 98, - "end": 99, - "loc": { - "start": { - "line": 7, - "column": 15 - }, - "end": { - "line": 7, - "column": 16 - }, - "identifierName": "y" - }, + "start":98,"end":99,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":16},"identifierName":"y"}, "name": "y" } } @@ -632,34 +204,11 @@ }, { "type": "ClassMethod", - "start": 108, - "end": 134, - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 10, - "column": 28 - } - }, + "start":108,"end":134,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":28}}, "static": false, "key": { "type": "Identifier", - "start": 112, - "end": 113, - "loc": { - "start": { - "line": 10, - "column": 6 - }, - "end": { - "line": 10, - "column": 7 - }, - "identifierName": "x" - }, + "start":112,"end":113,"loc":{"start":{"line":10,"column":6},"end":{"line":10,"column":7},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -670,91 +219,24 @@ "params": [], "body": { "type": "BlockStatement", - "start": 116, - "end": 134, - "loc": { - "start": { - "line": 10, - "column": 10 - }, - "end": { - "line": 10, - "column": 28 - } - }, + "start":116,"end":134,"loc":{"start":{"line":10,"column":10},"end":{"line":10,"column":28}}, "body": [ { "type": "ReturnStatement", - "start": 118, - "end": 132, - "loc": { - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 10, - "column": 26 - } - }, + "start":118,"end":132,"loc":{"start":{"line":10,"column":12},"end":{"line":10,"column":26}}, "argument": { "type": "MemberExpression", - "start": 125, - "end": 132, - "loc": { - "start": { - "line": 10, - "column": 19 - }, - "end": { - "line": 10, - "column": 26 - } - }, + "start":125,"end":132,"loc":{"start":{"line":10,"column":19},"end":{"line":10,"column":26}}, "object": { "type": "ThisExpression", - "start": 125, - "end": 129, - "loc": { - "start": { - "line": 10, - "column": 19 - }, - "end": { - "line": 10, - "column": 23 - } - } + "start":125,"end":129,"loc":{"start":{"line":10,"column":19},"end":{"line":10,"column":23}} }, "property": { "type": "PrivateName", - "start": 130, - "end": 132, - "loc": { - "start": { - "line": 10, - "column": 24 - }, - "end": { - "line": 10, - "column": 26 - } - }, + "start":130,"end":132,"loc":{"start":{"line":10,"column":24},"end":{"line":10,"column":26}}, "id": { "type": "Identifier", - "start": 131, - "end": 132, - "loc": { - "start": { - "line": 10, - "column": 25 - }, - "end": { - "line": 10, - "column": 26 - }, - "identifierName": "x" - }, + "start":131,"end":132,"loc":{"start":{"line":10,"column":25},"end":{"line":10,"column":26},"identifierName":"x"}, "name": "x" } }, @@ -767,34 +249,11 @@ }, { "type": "ClassMethod", - "start": 137, - "end": 170, - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 11, - "column": 35 - } - }, + "start":137,"end":170,"loc":{"start":{"line":11,"column":2},"end":{"line":11,"column":35}}, "static": false, "key": { "type": "Identifier", - "start": 141, - "end": 142, - "loc": { - "start": { - "line": 11, - "column": 6 - }, - "end": { - "line": 11, - "column": 7 - }, - "identifierName": "x" - }, + "start":141,"end":142,"loc":{"start":{"line":11,"column":6},"end":{"line":11,"column":7},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -805,124 +264,34 @@ "params": [ { "type": "Identifier", - "start": 143, - "end": 148, - "loc": { - "start": { - "line": 11, - "column": 8 - }, - "end": { - "line": 11, - "column": 13 - }, - "identifierName": "value" - }, + "start":143,"end":148,"loc":{"start":{"line":11,"column":8},"end":{"line":11,"column":13},"identifierName":"value"}, "name": "value" } ], "body": { "type": "BlockStatement", - "start": 150, - "end": 170, - "loc": { - "start": { - "line": 11, - "column": 15 - }, - "end": { - "line": 11, - "column": 35 - } - }, + "start":150,"end":170,"loc":{"start":{"line":11,"column":15},"end":{"line":11,"column":35}}, "body": [ { "type": "ExpressionStatement", - "start": 152, - "end": 168, - "loc": { - "start": { - "line": 11, - "column": 17 - }, - "end": { - "line": 11, - "column": 33 - } - }, + "start":152,"end":168,"loc":{"start":{"line":11,"column":17},"end":{"line":11,"column":33}}, "expression": { "type": "AssignmentExpression", - "start": 152, - "end": 168, - "loc": { - "start": { - "line": 11, - "column": 17 - }, - "end": { - "line": 11, - "column": 33 - } - }, + "start":152,"end":168,"loc":{"start":{"line":11,"column":17},"end":{"line":11,"column":33}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 152, - "end": 159, - "loc": { - "start": { - "line": 11, - "column": 17 - }, - "end": { - "line": 11, - "column": 24 - } - }, + "start":152,"end":159,"loc":{"start":{"line":11,"column":17},"end":{"line":11,"column":24}}, "object": { "type": "ThisExpression", - "start": 152, - "end": 156, - "loc": { - "start": { - "line": 11, - "column": 17 - }, - "end": { - "line": 11, - "column": 21 - } - } + "start":152,"end":156,"loc":{"start":{"line":11,"column":17},"end":{"line":11,"column":21}} }, "property": { "type": "PrivateName", - "start": 157, - "end": 159, - "loc": { - "start": { - "line": 11, - "column": 22 - }, - "end": { - "line": 11, - "column": 24 - } - }, + "start":157,"end":159,"loc":{"start":{"line":11,"column":22},"end":{"line":11,"column":24}}, "id": { "type": "Identifier", - "start": 158, - "end": 159, - "loc": { - "start": { - "line": 11, - "column": 23 - }, - "end": { - "line": 11, - "column": 24 - }, - "identifierName": "x" - }, + "start":158,"end":159,"loc":{"start":{"line":11,"column":23},"end":{"line":11,"column":24},"identifierName":"x"}, "name": "x" } }, @@ -930,35 +299,12 @@ }, "right": { "type": "UnaryExpression", - "start": 162, - "end": 168, - "loc": { - "start": { - "line": 11, - "column": 27 - }, - "end": { - "line": 11, - "column": 33 - } - }, + "start":162,"end":168,"loc":{"start":{"line":11,"column":27},"end":{"line":11,"column":33}}, "operator": "+", "prefix": true, "argument": { "type": "Identifier", - "start": 163, - "end": 168, - "loc": { - "start": { - "line": 11, - "column": 28 - }, - "end": { - "line": 11, - "column": 33 - }, - "identifierName": "value" - }, + "start":163,"end":168,"loc":{"start":{"line":11,"column":28},"end":{"line":11,"column":33},"identifierName":"value"}, "name": "value" } } @@ -970,34 +316,11 @@ }, { "type": "ClassMethod", - "start": 174, - "end": 200, - "loc": { - "start": { - "line": 13, - "column": 2 - }, - "end": { - "line": 13, - "column": 28 - } - }, + "start":174,"end":200,"loc":{"start":{"line":13,"column":2},"end":{"line":13,"column":28}}, "static": false, "key": { "type": "Identifier", - "start": 178, - "end": 179, - "loc": { - "start": { - "line": 13, - "column": 6 - }, - "end": { - "line": 13, - "column": 7 - }, - "identifierName": "y" - }, + "start":178,"end":179,"loc":{"start":{"line":13,"column":6},"end":{"line":13,"column":7},"identifierName":"y"}, "name": "y" }, "computed": false, @@ -1008,91 +331,24 @@ "params": [], "body": { "type": "BlockStatement", - "start": 182, - "end": 200, - "loc": { - "start": { - "line": 13, - "column": 10 - }, - "end": { - "line": 13, - "column": 28 - } - }, + "start":182,"end":200,"loc":{"start":{"line":13,"column":10},"end":{"line":13,"column":28}}, "body": [ { "type": "ReturnStatement", - "start": 184, - "end": 198, - "loc": { - "start": { - "line": 13, - "column": 12 - }, - "end": { - "line": 13, - "column": 26 - } - }, + "start":184,"end":198,"loc":{"start":{"line":13,"column":12},"end":{"line":13,"column":26}}, "argument": { "type": "MemberExpression", - "start": 191, - "end": 198, - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 26 - } - }, + "start":191,"end":198,"loc":{"start":{"line":13,"column":19},"end":{"line":13,"column":26}}, "object": { "type": "ThisExpression", - "start": 191, - "end": 195, - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 23 - } - } + "start":191,"end":195,"loc":{"start":{"line":13,"column":19},"end":{"line":13,"column":23}} }, "property": { "type": "PrivateName", - "start": 196, - "end": 198, - "loc": { - "start": { - "line": 13, - "column": 24 - }, - "end": { - "line": 13, - "column": 26 - } - }, + "start":196,"end":198,"loc":{"start":{"line":13,"column":24},"end":{"line":13,"column":26}}, "id": { "type": "Identifier", - "start": 197, - "end": 198, - "loc": { - "start": { - "line": 13, - "column": 25 - }, - "end": { - "line": 13, - "column": 26 - }, - "identifierName": "y" - }, + "start":197,"end":198,"loc":{"start":{"line":13,"column":25},"end":{"line":13,"column":26},"identifierName":"y"}, "name": "y" } }, @@ -1105,34 +361,11 @@ }, { "type": "ClassMethod", - "start": 203, - "end": 236, - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 35 - } - }, + "start":203,"end":236,"loc":{"start":{"line":14,"column":2},"end":{"line":14,"column":35}}, "static": false, "key": { "type": "Identifier", - "start": 207, - "end": 208, - "loc": { - "start": { - "line": 14, - "column": 6 - }, - "end": { - "line": 14, - "column": 7 - }, - "identifierName": "y" - }, + "start":207,"end":208,"loc":{"start":{"line":14,"column":6},"end":{"line":14,"column":7},"identifierName":"y"}, "name": "y" }, "computed": false, @@ -1143,124 +376,34 @@ "params": [ { "type": "Identifier", - "start": 209, - "end": 214, - "loc": { - "start": { - "line": 14, - "column": 8 - }, - "end": { - "line": 14, - "column": 13 - }, - "identifierName": "value" - }, + "start":209,"end":214,"loc":{"start":{"line":14,"column":8},"end":{"line":14,"column":13},"identifierName":"value"}, "name": "value" } ], "body": { "type": "BlockStatement", - "start": 216, - "end": 236, - "loc": { - "start": { - "line": 14, - "column": 15 - }, - "end": { - "line": 14, - "column": 35 - } - }, + "start":216,"end":236,"loc":{"start":{"line":14,"column":15},"end":{"line":14,"column":35}}, "body": [ { "type": "ExpressionStatement", - "start": 218, - "end": 234, - "loc": { - "start": { - "line": 14, - "column": 17 - }, - "end": { - "line": 14, - "column": 33 - } - }, + "start":218,"end":234,"loc":{"start":{"line":14,"column":17},"end":{"line":14,"column":33}}, "expression": { "type": "AssignmentExpression", - "start": 218, - "end": 234, - "loc": { - "start": { - "line": 14, - "column": 17 - }, - "end": { - "line": 14, - "column": 33 - } - }, + "start":218,"end":234,"loc":{"start":{"line":14,"column":17},"end":{"line":14,"column":33}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 218, - "end": 225, - "loc": { - "start": { - "line": 14, - "column": 17 - }, - "end": { - "line": 14, - "column": 24 - } - }, + "start":218,"end":225,"loc":{"start":{"line":14,"column":17},"end":{"line":14,"column":24}}, "object": { "type": "ThisExpression", - "start": 218, - "end": 222, - "loc": { - "start": { - "line": 14, - "column": 17 - }, - "end": { - "line": 14, - "column": 21 - } - } + "start":218,"end":222,"loc":{"start":{"line":14,"column":17},"end":{"line":14,"column":21}} }, "property": { "type": "PrivateName", - "start": 223, - "end": 225, - "loc": { - "start": { - "line": 14, - "column": 22 - }, - "end": { - "line": 14, - "column": 24 - } - }, + "start":223,"end":225,"loc":{"start":{"line":14,"column":22},"end":{"line":14,"column":24}}, "id": { "type": "Identifier", - "start": 224, - "end": 225, - "loc": { - "start": { - "line": 14, - "column": 23 - }, - "end": { - "line": 14, - "column": 24 - }, - "identifierName": "y" - }, + "start":224,"end":225,"loc":{"start":{"line":14,"column":23},"end":{"line":14,"column":24},"identifierName":"y"}, "name": "y" } }, @@ -1268,35 +411,12 @@ }, "right": { "type": "UnaryExpression", - "start": 228, - "end": 234, - "loc": { - "start": { - "line": 14, - "column": 27 - }, - "end": { - "line": 14, - "column": 33 - } - }, + "start":228,"end":234,"loc":{"start":{"line":14,"column":27},"end":{"line":14,"column":33}}, "operator": "+", "prefix": true, "argument": { "type": "Identifier", - "start": 229, - "end": 234, - "loc": { - "start": { - "line": 14, - "column": 28 - }, - "end": { - "line": 14, - "column": 33 - }, - "identifierName": "value" - }, + "start":229,"end":234,"loc":{"start":{"line":14,"column":28},"end":{"line":14,"column":33},"identifierName":"value"}, "name": "value" } } @@ -1308,34 +428,11 @@ }, { "type": "ClassMethod", - "start": 240, - "end": 297, - "loc": { - "start": { - "line": 16, - "column": 2 - }, - "end": { - "line": 16, - "column": 59 - } - }, + "start":240,"end":297,"loc":{"start":{"line":16,"column":2},"end":{"line":16,"column":59}}, "static": false, "key": { "type": "Identifier", - "start": 240, - "end": 246, - "loc": { - "start": { - "line": 16, - "column": 2 - }, - "end": { - "line": 16, - "column": 8 - }, - "identifierName": "equals" - }, + "start":240,"end":246,"loc":{"start":{"line":16,"column":2},"end":{"line":16,"column":8},"identifierName":"equals"}, "name": "equals" }, "computed": false, @@ -1346,137 +443,36 @@ "params": [ { "type": "Identifier", - "start": 247, - "end": 248, - "loc": { - "start": { - "line": 16, - "column": 9 - }, - "end": { - "line": 16, - "column": 10 - }, - "identifierName": "p" - }, + "start":247,"end":248,"loc":{"start":{"line":16,"column":9},"end":{"line":16,"column":10},"identifierName":"p"}, "name": "p" } ], "body": { "type": "BlockStatement", - "start": 250, - "end": 297, - "loc": { - "start": { - "line": 16, - "column": 12 - }, - "end": { - "line": 16, - "column": 59 - } - }, + "start":250,"end":297,"loc":{"start":{"line":16,"column":12},"end":{"line":16,"column":59}}, "body": [ { "type": "ReturnStatement", - "start": 252, - "end": 295, - "loc": { - "start": { - "line": 16, - "column": 14 - }, - "end": { - "line": 16, - "column": 57 - } - }, + "start":252,"end":295,"loc":{"start":{"line":16,"column":14},"end":{"line":16,"column":57}}, "argument": { "type": "LogicalExpression", - "start": 259, - "end": 295, - "loc": { - "start": { - "line": 16, - "column": 21 - }, - "end": { - "line": 16, - "column": 57 - } - }, + "start":259,"end":295,"loc":{"start":{"line":16,"column":21},"end":{"line":16,"column":57}}, "left": { "type": "BinaryExpression", - "start": 259, - "end": 275, - "loc": { - "start": { - "line": 16, - "column": 21 - }, - "end": { - "line": 16, - "column": 37 - } - }, + "start":259,"end":275,"loc":{"start":{"line":16,"column":21},"end":{"line":16,"column":37}}, "left": { "type": "MemberExpression", - "start": 259, - "end": 266, - "loc": { - "start": { - "line": 16, - "column": 21 - }, - "end": { - "line": 16, - "column": 28 - } - }, + "start":259,"end":266,"loc":{"start":{"line":16,"column":21},"end":{"line":16,"column":28}}, "object": { "type": "ThisExpression", - "start": 259, - "end": 263, - "loc": { - "start": { - "line": 16, - "column": 21 - }, - "end": { - "line": 16, - "column": 25 - } - } + "start":259,"end":263,"loc":{"start":{"line":16,"column":21},"end":{"line":16,"column":25}} }, "property": { "type": "PrivateName", - "start": 264, - "end": 266, - "loc": { - "start": { - "line": 16, - "column": 26 - }, - "end": { - "line": 16, - "column": 28 - } - }, + "start":264,"end":266,"loc":{"start":{"line":16,"column":26},"end":{"line":16,"column":28}}, "id": { "type": "Identifier", - "start": 265, - "end": 266, - "loc": { - "start": { - "line": 16, - "column": 27 - }, - "end": { - "line": 16, - "column": 28 - }, - "identifierName": "x" - }, + "start":265,"end":266,"loc":{"start":{"line":16,"column":27},"end":{"line":16,"column":28},"identifierName":"x"}, "name": "x" } }, @@ -1485,64 +481,18 @@ "operator": "===", "right": { "type": "MemberExpression", - "start": 271, - "end": 275, - "loc": { - "start": { - "line": 16, - "column": 33 - }, - "end": { - "line": 16, - "column": 37 - } - }, + "start":271,"end":275,"loc":{"start":{"line":16,"column":33},"end":{"line":16,"column":37}}, "object": { "type": "Identifier", - "start": 271, - "end": 272, - "loc": { - "start": { - "line": 16, - "column": 33 - }, - "end": { - "line": 16, - "column": 34 - }, - "identifierName": "p" - }, + "start":271,"end":272,"loc":{"start":{"line":16,"column":33},"end":{"line":16,"column":34},"identifierName":"p"}, "name": "p" }, "property": { "type": "PrivateName", - "start": 273, - "end": 275, - "loc": { - "start": { - "line": 16, - "column": 35 - }, - "end": { - "line": 16, - "column": 37 - } - }, + "start":273,"end":275,"loc":{"start":{"line":16,"column":35},"end":{"line":16,"column":37}}, "id": { "type": "Identifier", - "start": 274, - "end": 275, - "loc": { - "start": { - "line": 16, - "column": 36 - }, - "end": { - "line": 16, - "column": 37 - }, - "identifierName": "x" - }, + "start":274,"end":275,"loc":{"start":{"line":16,"column":36},"end":{"line":16,"column":37},"identifierName":"x"}, "name": "x" } }, @@ -1552,76 +502,20 @@ "operator": "&&", "right": { "type": "BinaryExpression", - "start": 279, - "end": 295, - "loc": { - "start": { - "line": 16, - "column": 41 - }, - "end": { - "line": 16, - "column": 57 - } - }, + "start":279,"end":295,"loc":{"start":{"line":16,"column":41},"end":{"line":16,"column":57}}, "left": { "type": "MemberExpression", - "start": 279, - "end": 286, - "loc": { - "start": { - "line": 16, - "column": 41 - }, - "end": { - "line": 16, - "column": 48 - } - }, + "start":279,"end":286,"loc":{"start":{"line":16,"column":41},"end":{"line":16,"column":48}}, "object": { "type": "ThisExpression", - "start": 279, - "end": 283, - "loc": { - "start": { - "line": 16, - "column": 41 - }, - "end": { - "line": 16, - "column": 45 - } - } + "start":279,"end":283,"loc":{"start":{"line":16,"column":41},"end":{"line":16,"column":45}} }, "property": { "type": "PrivateName", - "start": 284, - "end": 286, - "loc": { - "start": { - "line": 16, - "column": 46 - }, - "end": { - "line": 16, - "column": 48 - } - }, + "start":284,"end":286,"loc":{"start":{"line":16,"column":46},"end":{"line":16,"column":48}}, "id": { "type": "Identifier", - "start": 285, - "end": 286, - "loc": { - "start": { - "line": 16, - "column": 47 - }, - "end": { - "line": 16, - "column": 48 - }, - "identifierName": "y" - }, + "start":285,"end":286,"loc":{"start":{"line":16,"column":47},"end":{"line":16,"column":48},"identifierName":"y"}, "name": "y" } }, @@ -1630,64 +524,18 @@ "operator": "===", "right": { "type": "MemberExpression", - "start": 291, - "end": 295, - "loc": { - "start": { - "line": 16, - "column": 53 - }, - "end": { - "line": 16, - "column": 57 - } - }, + "start":291,"end":295,"loc":{"start":{"line":16,"column":53},"end":{"line":16,"column":57}}, "object": { "type": "Identifier", - "start": 291, - "end": 292, - "loc": { - "start": { - "line": 16, - "column": 53 - }, - "end": { - "line": 16, - "column": 54 - }, - "identifierName": "p" - }, + "start":291,"end":292,"loc":{"start":{"line":16,"column":53},"end":{"line":16,"column":54},"identifierName":"p"}, "name": "p" }, "property": { "type": "PrivateName", - "start": 293, - "end": 295, - "loc": { - "start": { - "line": 16, - "column": 55 - }, - "end": { - "line": 16, - "column": 57 - } - }, + "start":293,"end":295,"loc":{"start":{"line":16,"column":55},"end":{"line":16,"column":57}}, "id": { "type": "Identifier", - "start": 294, - "end": 295, - "loc": { - "start": { - "line": 16, - "column": 56 - }, - "end": { - "line": 16, - "column": 57 - }, - "identifierName": "y" - }, + "start":294,"end":295,"loc":{"start":{"line":16,"column":56},"end":{"line":16,"column":57},"identifierName":"y"}, "name": "y" } }, @@ -1702,34 +550,11 @@ }, { "type": "ClassMethod", - "start": 301, - "end": 357, - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 58 - } - }, + "start":301,"end":357,"loc":{"start":{"line":18,"column":2},"end":{"line":18,"column":58}}, "static": false, "key": { "type": "Identifier", - "start": 301, - "end": 309, - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 10 - }, - "identifierName": "toString" - }, + "start":301,"end":309,"loc":{"start":{"line":18,"column":2},"end":{"line":18,"column":10},"identifierName":"toString"}, "name": "toString" }, "computed": false, @@ -1740,106 +565,28 @@ "params": [], "body": { "type": "BlockStatement", - "start": 312, - "end": 357, - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 58 - } - }, + "start":312,"end":357,"loc":{"start":{"line":18,"column":13},"end":{"line":18,"column":58}}, "body": [ { "type": "ReturnStatement", - "start": 314, - "end": 355, - "loc": { - "start": { - "line": 18, - "column": 15 - }, - "end": { - "line": 18, - "column": 56 - } - }, + "start":314,"end":355,"loc":{"start":{"line":18,"column":15},"end":{"line":18,"column":56}}, "argument": { "type": "TemplateLiteral", - "start": 321, - "end": 355, - "loc": { - "start": { - "line": 18, - "column": 22 - }, - "end": { - "line": 18, - "column": 56 - } - }, + "start":321,"end":355,"loc":{"start":{"line":18,"column":22},"end":{"line":18,"column":56}}, "expressions": [ { "type": "MemberExpression", - "start": 331, - "end": 338, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 39 - } - }, + "start":331,"end":338,"loc":{"start":{"line":18,"column":32},"end":{"line":18,"column":39}}, "object": { "type": "ThisExpression", - "start": 331, - "end": 335, - "loc": { - "start": { - "line": 18, - "column": 32 - }, - "end": { - "line": 18, - "column": 36 - } - } + "start":331,"end":335,"loc":{"start":{"line":18,"column":32},"end":{"line":18,"column":36}} }, "property": { "type": "PrivateName", - "start": 336, - "end": 338, - "loc": { - "start": { - "line": 18, - "column": 37 - }, - "end": { - "line": 18, - "column": 39 - } - }, + "start":336,"end":338,"loc":{"start":{"line":18,"column":37},"end":{"line":18,"column":39}}, "id": { "type": "Identifier", - "start": 337, - "end": 338, - "loc": { - "start": { - "line": 18, - "column": 38 - }, - "end": { - "line": 18, - "column": 39 - }, - "identifierName": "x" - }, + "start":337,"end":338,"loc":{"start":{"line":18,"column":38},"end":{"line":18,"column":39},"identifierName":"x"}, "name": "x" } }, @@ -1847,62 +594,17 @@ }, { "type": "MemberExpression", - "start": 344, - "end": 351, - "loc": { - "start": { - "line": 18, - "column": 45 - }, - "end": { - "line": 18, - "column": 52 - } - }, + "start":344,"end":351,"loc":{"start":{"line":18,"column":45},"end":{"line":18,"column":52}}, "object": { "type": "ThisExpression", - "start": 344, - "end": 348, - "loc": { - "start": { - "line": 18, - "column": 45 - }, - "end": { - "line": 18, - "column": 49 - } - } + "start":344,"end":348,"loc":{"start":{"line":18,"column":45},"end":{"line":18,"column":49}} }, "property": { "type": "PrivateName", - "start": 349, - "end": 351, - "loc": { - "start": { - "line": 18, - "column": 50 - }, - "end": { - "line": 18, - "column": 52 - } - }, + "start":349,"end":351,"loc":{"start":{"line":18,"column":50},"end":{"line":18,"column":52}}, "id": { "type": "Identifier", - "start": 350, - "end": 351, - "loc": { - "start": { - "line": 18, - "column": 51 - }, - "end": { - "line": 18, - "column": 52 - }, - "identifierName": "y" - }, + "start":350,"end":351,"loc":{"start":{"line":18,"column":51},"end":{"line":18,"column":52},"identifierName":"y"}, "name": "y" } }, @@ -1912,18 +614,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 322, - "end": 328, - "loc": { - "start": { - "line": 18, - "column": 23 - }, - "end": { - "line": 18, - "column": 29 - } - }, + "start":322,"end":328,"loc":{"start":{"line":18,"column":23},"end":{"line":18,"column":29}}, "value": { "raw": "Point<", "cooked": "Point<" @@ -1932,18 +623,7 @@ }, { "type": "TemplateElement", - "start": 340, - "end": 341, - "loc": { - "start": { - "line": 18, - "column": 41 - }, - "end": { - "line": 18, - "column": 42 - } - }, + "start":340,"end":341,"loc":{"start":{"line":18,"column":41},"end":{"line":18,"column":42}}, "value": { "raw": ",", "cooked": "," @@ -1952,18 +632,7 @@ }, { "type": "TemplateElement", - "start": 353, - "end": 354, - "loc": { - "start": { - "line": 18, - "column": 54 - }, - "end": { - "line": 18, - "column": 55 - } - }, + "start":353,"end":354,"loc":{"start":{"line":18,"column":54},"end":{"line":18,"column":55}}, "value": { "raw": ">", "cooked": ">" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/static/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/static/output.json index 0d05ba3223..824195dc19 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/static/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/static/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":41,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -127,65 +37,20 @@ }, { "type": "ClassPrivateProperty", - "start": 25, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":25,"end":39,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": true, "key": { "type": "PrivateName", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":32,"end":34,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "y" - }, + "start":33,"end":34,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"y"}, "name": "y" } }, "value": { "type": "NumericLiteral", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":37,"end":38,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json index 26e00894a7..8010b9a5b4 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-call/output.json @@ -1,130 +1,39 @@ { "type": "File", - "start": 0, - "end": 95, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":95,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (4:13)" ], "program": { "type": "Program", - "start": 0, - "end": 95, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":95,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 95, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":95,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"B"}, "name": "B" }, "body": { "type": "ClassBody", - "start": 18, - "end": 95, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":18,"end":95,"loc":{"start":{"line":1,"column":18},"end":{"line":7,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 22, - "end": 93, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":22,"end":93,"loc":{"start":{"line":2,"column":2},"end":{"line":6,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 22, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":22,"end":33,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -135,157 +44,44 @@ "params": [], "body": { "type": "BlockStatement", - "start": 36, - "end": 93, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":36,"end":93,"loc":{"start":{"line":2,"column":16},"end":{"line":6,"column":3}}, "body": [ { "type": "ClassDeclaration", - "start": 42, - "end": 89, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":42,"end":89,"loc":{"start":{"line":3,"column":4},"end":{"line":5,"column":5}}, "id": { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "C" - }, + "start":48,"end":49,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"C"}, "name": "C" }, "superClass": { "type": "Identifier", - "start": 58, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 21 - }, - "identifierName": "D" - }, + "start":58,"end":59,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":21},"identifierName":"D"}, "name": "D" }, "body": { "type": "ClassBody", - "start": 60, - "end": 89, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":60,"end":89,"loc":{"start":{"line":3,"column":22},"end":{"line":5,"column":5}}, "body": [ { "type": "ClassPrivateProperty", - "start": 68, - "end": 83, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 21 - } - }, + "start":68,"end":83,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":21}}, "static": false, "key": { "type": "PrivateName", - "start": 68, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":68,"end":72,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":10}}, "id": { "type": "Identifier", - "start": 69, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 10 - }, - "identifierName": "foo" - }, + "start":69,"end":72,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":10},"identifierName":"foo"}, "name": "foo" } }, "value": { "type": "CallExpression", - "start": 75, - "end": 82, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 20 - } - }, + "start":75,"end":82,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":20}}, "callee": { "type": "Super", - "start": 75, - "end": 80, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 18 - } - } + "start":75,"end":80,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":18}} }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json index bf5051685b..e1645e9fd5 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/super-private-member-access/output.json @@ -1,144 +1,42 @@ { "type": "File", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ "SyntaxError: Private fields can't be accessed on super (5:4)" ], "program": { "type": "Program", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"B"}, "name": "B" }, "body": { "type": "ClassBody", - "start": 18, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":18,"end":59,"loc":{"start":{"line":1,"column":18},"end":{"line":7,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5}}, "static": false, "key": { "type": "PrivateName", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -146,34 +44,11 @@ }, { "type": "ClassMethod", - "start": 29, - "end": 57, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":29,"end":57,"loc":{"start":{"line":4,"column":2},"end":{"line":6,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 8 - }, - "identifierName": "method" - }, + "start":29,"end":35,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":8},"identifierName":"method"}, "name": "method" }, "computed": false, @@ -184,91 +59,24 @@ "params": [], "body": { "type": "BlockStatement", - "start": 38, - "end": 57, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":38,"end":57,"loc":{"start":{"line":4,"column":11},"end":{"line":6,"column":3}}, "body": [ { "type": "ExpressionStatement", - "start": 44, - "end": 53, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":44,"end":53,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":13}}, "expression": { "type": "MemberExpression", - "start": 44, - "end": 52, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 12 - } - }, + "start":44,"end":52,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":12}}, "object": { "type": "Super", - "start": 44, - "end": 49, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 9 - } - } + "start":44,"end":49,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":9}} }, "property": { "type": "PrivateName", - "start": 50, - "end": 52, - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 12 - } - }, + "start":50,"end":52,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":12}}, "id": { "type": "Identifier", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 5, - "column": 11 - }, - "end": { - "line": 5, - "column": 12 - }, - "identifierName": "x" - }, + "start":51,"end":52,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":12},"identifierName":"x"}, "name": "x" } }, diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/output.json index f13ed5f056..72c04ef4ff 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-nested/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ "SyntaxError: Private name #priv is not defined (4:19)" ], "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":8,"end":58,"loc":{"start":{"line":1,"column":8},"end":{"line":6,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":12,"end":15,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" } }, @@ -130,34 +40,11 @@ }, { "type": "ClassMethod", - "start": 18, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":18,"end":56,"loc":{"start":{"line":3,"column":2},"end":{"line":5,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "meth" - }, + "start":18,"end":22,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":6},"identifierName":"meth"}, "name": "meth" }, "computed": false, @@ -168,125 +55,34 @@ "params": [], "body": { "type": "BlockStatement", - "start": 25, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":25,"end":56,"loc":{"start":{"line":3,"column":9},"end":{"line":5,"column":3}}, "body": [ { "type": "VariableDeclaration", - "start": 31, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":31,"end":52,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 35, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 24 - } - }, + "start":35,"end":51,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":24}}, "id": { "type": "Identifier", - "start": 35, - "end": 39, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 12 - }, - "identifierName": "prop" - }, + "start":35,"end":39,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":12},"identifierName":"prop"}, "name": "prop" }, "init": { "type": "MemberExpression", - "start": 42, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 24 - } - }, + "start":42,"end":51,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":24}}, "object": { "type": "Identifier", - "start": 42, - "end": 45, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 18 - }, - "identifierName": "foo" - }, + "start":42,"end":45,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":18},"identifierName":"foo"}, "name": "foo" }, "property": { "type": "PrivateName", - "start": 46, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 24 - } - }, + "start":46,"end":51,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":24}}, "id": { "type": "Identifier", - "start": 47, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 20 - }, - "end": { - "line": 4, - "column": 24 - }, - "identifierName": "priv" - }, + "start":47,"end":51,"loc":{"start":{"line":4,"column":20},"end":{"line":4,"column":24},"identifierName":"priv"}, "name": "priv" } }, diff --git a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/output.json b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/output.json index 88c45d101f..6cc1bce625 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-private-properties/undeclared-top-level/output.json @@ -1,143 +1,41 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Private name #priv is not defined (1:15)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "prop" - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8},"identifierName":"prop"}, "name": "prop" }, "init": { "type": "MemberExpression", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20}}, "object": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"foo"}, "name": "foo" }, "property": { "type": "PrivateName", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "priv" - }, + "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"priv"}, "name": "priv" } }, diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json index 7cd90e6e90..17dd38b5c5 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-arrow-function/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: 'arguments' is not allowed in class field initializer (3:16)" ], "program": { "type": "Program", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "fn" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -68,132 +23,41 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":14,"end":60,"loc":{"start":{"line":1,"column":14},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassDeclaration", - "start": 18, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":18,"end":58,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "A" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 26, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":26,"end":58,"loc":{"start":{"line":2,"column":10},"end":{"line":4,"column":3}}, "body": [ { "type": "ClassProperty", - "start": 32, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 26 - } - }, + "start":32,"end":54,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":26}}, "static": false, "key": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "foo" - }, + "start":32,"end":35,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"foo"}, "name": "foo" }, "computed": false, "value": { "type": "ArrowFunctionExpression", - "start": 38, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":38,"end":53,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":25}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "Identifier", - "start": 44, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 25 - }, - "identifierName": "arguments" - }, + "start":44,"end":53,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":25},"identifierName":"arguments"}, "name": "arguments" } } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-function/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-function/output.json index b368a37225..80d1655ddf 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-function/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-function/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":71,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":71,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":71,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "fn" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -65,128 +20,37 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":14,"end":71,"loc":{"start":{"line":1,"column":14},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassDeclaration", - "start": 18, - "end": 69, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":18,"end":69,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "A" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 26, - "end": 69, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":26,"end":69,"loc":{"start":{"line":2,"column":10},"end":{"line":4,"column":3}}, "body": [ { "type": "ClassProperty", - "start": 32, - "end": 65, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 37 - } - }, + "start":32,"end":65,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":37}}, "static": false, "key": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "foo" - }, + "start":32,"end":35,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"foo"}, "name": "foo" }, "computed": false, "value": { "type": "FunctionExpression", - "start": 38, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":38,"end":64,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":36}}, "id": { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 20 - }, - "identifierName": "f" - }, + "start":47,"end":48,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":20},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -194,48 +58,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 51, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 23 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":51,"end":64,"loc":{"start":{"line":3,"column":23},"end":{"line":3,"column":36}}, "body": [ { "type": "ExpressionStatement", - "start": 53, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 25 - }, - "end": { - "line": 3, - "column": 34 - } - }, + "start":53,"end":62,"loc":{"start":{"line":3,"column":25},"end":{"line":3,"column":34}}, "expression": { "type": "Identifier", - "start": 53, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 25 - }, - "end": { - "line": 3, - "column": 34 - }, - "identifierName": "arguments" - }, + "start":53,"end":62,"loc":{"start":{"line":3,"column":25},"end":{"line":3,"column":34},"identifierName":"arguments"}, "name": "arguments" } } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-key/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-key/output.json index 1478f40e09..a1c8be9580 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-key/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-key/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "fn" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -65,113 +20,34 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":14,"end":54,"loc":{"start":{"line":1,"column":14},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassDeclaration", - "start": 18, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":18,"end":52,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "A" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 26, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":26,"end":52,"loc":{"start":{"line":2,"column":10},"end":{"line":4,"column":3}}, "body": [ { "type": "ClassProperty", - "start": 32, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":32,"end":48,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":20}}, "static": false, "computed": true, "key": { "type": "Identifier", - "start": 33, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 14 - }, - "identifierName": "arguments" - }, + "start":33,"end":42,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":14},"identifierName":"arguments"}, "name": "arguments" }, "value": { "type": "NumericLiteral", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":46,"end":47,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":19}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/output.json index deb781226e..226c11bd0f 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class-decorator-call-expression/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: 'arguments' is not allowed in class field initializer (3:25)" ], "program": { "type": "Program", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "fn" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -68,222 +23,63 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":14,"end":76,"loc":{"start":{"line":1,"column":14},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassDeclaration", - "start": 18, - "end": 74, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":18,"end":74,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "A" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 26, - "end": 74, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":26,"end":74,"loc":{"start":{"line":2,"column":10},"end":{"line":4,"column":3}}, "body": [ { "type": "ClassProperty", - "start": 32, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 42 - } - }, + "start":32,"end":70,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":42}}, "static": false, "key": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "foo" - }, + "start":32,"end":35,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"foo"}, "name": "foo" }, "computed": false, "value": { "type": "ClassExpression", - "start": 38, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":38,"end":69,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":41}}, "id": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "B" - }, + "start":44,"end":45,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17},"identifierName":"B"}, "name": "B" }, "superClass": null, "body": { "type": "ClassBody", - "start": 46, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":46,"end":69,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":41}}, "body": [ { "type": "ClassProperty", - "start": 48, - "end": 67, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":48,"end":67,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":39}}, "decorators": [ { "type": "Decorator", - "start": 48, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":48,"end":63,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":35}}, "expression": { "type": "CallExpression", - "start": 49, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":49,"end":63,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":35}}, "callee": { "type": "Identifier", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 24 - }, - "identifierName": "bar" - }, + "start":49,"end":52,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":24},"identifierName":"bar"}, "name": "bar" }, "arguments": [ { "type": "Identifier", - "start": 53, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 25 - }, - "end": { - "line": 3, - "column": 34 - }, - "identifierName": "arguments" - }, + "start":53,"end":62,"loc":{"start":{"line":3,"column":25},"end":{"line":3,"column":34},"identifierName":"arguments"}, "name": "arguments" } ] @@ -293,19 +89,7 @@ "static": false, "key": { "type": "Identifier", - "start": 64, - "end": 67, - "loc": { - "start": { - "line": 3, - "column": 36 - }, - "end": { - "line": 3, - "column": 39 - }, - "identifierName": "foo" - }, + "start":64,"end":67,"loc":{"start":{"line":3,"column":36},"end":{"line":3,"column":39},"identifierName":"foo"}, "name": "foo" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/output.json index 107a090b5e..c119e2e0c7 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments-in-nested-class/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "fn" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -65,176 +20,51 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":14,"end":76,"loc":{"start":{"line":1,"column":14},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassDeclaration", - "start": 18, - "end": 74, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":18,"end":74,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "A" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 26, - "end": 74, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":26,"end":74,"loc":{"start":{"line":2,"column":10},"end":{"line":4,"column":3}}, "body": [ { "type": "ClassProperty", - "start": 32, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 42 - } - }, + "start":32,"end":70,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":42}}, "static": false, "key": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "foo" - }, + "start":32,"end":35,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"foo"}, "name": "foo" }, "computed": false, "value": { "type": "ClassExpression", - "start": 38, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":38,"end":69,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":41}}, "id": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "B" - }, + "start":44,"end":45,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17},"identifierName":"B"}, "name": "B" }, "superClass": null, "body": { "type": "ClassBody", - "start": 46, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":46,"end":69,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":41}}, "body": [ { "type": "ClassMethod", - "start": 48, - "end": 67, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":48,"end":67,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":39}}, "static": false, "key": { "type": "Identifier", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 23 - }, - "identifierName": "bar" - }, + "start":48,"end":51,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":23},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -245,48 +75,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 54, - "end": 67, - "loc": { - "start": { - "line": 3, - "column": 26 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":54,"end":67,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":39}}, "body": [ { "type": "ExpressionStatement", - "start": 56, - "end": 65, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 37 - } - }, + "start":56,"end":65,"loc":{"start":{"line":3,"column":28},"end":{"line":3,"column":37}}, "expression": { "type": "Identifier", - "start": 56, - "end": 65, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 37 - }, - "identifierName": "arguments" - }, + "start":56,"end":65,"loc":{"start":{"line":3,"column":28},"end":{"line":3,"column":37},"identifierName":"arguments"}, "name": "arguments" } } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json index f2522558f0..ffd15aa2c2 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/arguments/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: 'arguments' is not allowed in class field initializer (3:10)" ], "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "fn" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -68,114 +23,34 @@ "params": [], "body": { "type": "BlockStatement", - "start": 14, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":14,"end":54,"loc":{"start":{"line":1,"column":14},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassDeclaration", - "start": 18, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":18,"end":52,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "A" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 26, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":26,"end":52,"loc":{"start":{"line":2,"column":10},"end":{"line":4,"column":3}}, "body": [ { "type": "ClassProperty", - "start": 32, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":32,"end":48,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":20}}, "static": false, "key": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "foo" - }, + "start":32,"end":35,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"foo"}, "name": "foo" }, "computed": false, "value": { "type": "Identifier", - "start": 38, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 19 - }, - "identifierName": "arguments" - }, + "start":38,"end":47,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":19},"identifierName":"arguments"}, "name": "arguments" } } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/output.json index 1b75f5865d..0491fc9e89 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/asi-success/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -113,34 +34,11 @@ }, { "type": "ClassProperty", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":18,"end":19,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "y" - }, + "start":18,"end":19,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"y"}, "name": "y" }, "computed": false, @@ -151,81 +49,24 @@ }, { "type": "ClassDeclaration", - "start": 23, - "end": 53, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":23,"end":53,"loc":{"start":{"line":6,"column":0},"end":{"line":9,"column":1}}, "id": { "type": "Identifier", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 10 - }, - "identifierName": "Foo2" - }, + "start":29,"end":33,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":10},"identifierName":"Foo2"}, "name": "Foo2" }, "superClass": null, "body": { "type": "ClassBody", - "start": 34, - "end": 53, - "loc": { - "start": { - "line": 6, - "column": 11 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":34,"end":53,"loc":{"start":{"line":6,"column":11},"end":{"line":9,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":38,"end":39,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 3 - }, - "identifierName": "p" - }, + "start":38,"end":39,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":3},"identifierName":"p"}, "name": "p" }, "computed": false, @@ -233,35 +74,12 @@ }, { "type": "ClassMethod", - "start": 42, - "end": 51, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 11 - } - }, + "start":42,"end":51,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":11}}, "static": false, "computed": true, "key": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 8, - "column": 3 - }, - "end": { - "line": 8, - "column": 4 - }, - "identifierName": "m" - }, + "start":43,"end":44,"loc":{"start":{"line":8,"column":3},"end":{"line":8,"column":4},"identifierName":"m"}, "name": "m" }, "kind": "method", @@ -271,18 +89,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 49, - "end": 51, - "loc": { - "start": { - "line": 8, - "column": 9 - }, - "end": { - "line": 8, - "column": 11 - } - }, + "start":49,"end":51,"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":11}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/output.json index 0031d27b45..b065c96cb1 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-async-in-class-property/output.json @@ -1,176 +1,53 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":41,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":12,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":29}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "p" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"p"}, "name": "p" }, "computed": false, "value": { "type": "ArrowFunctionExpression", - "start": 16, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":16,"end":38,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":28}}, "id": null, "generator": false, "async": true, "params": [], "body": { "type": "AwaitExpression", - "start": 28, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":28,"end":38,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":28}}, "argument": { "type": "UnaryExpression", - "start": 34, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":34,"end":38,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":28}}, "operator": "+", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":36,"end":38,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":28}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/output.json index 34bc34826e..c58d4a6533 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/await-in-class-property-in-async/output.json @@ -1,207 +1,61 @@ { "type": "File", - "start": 0, - "end": 96, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":96,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 96, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":96,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 96, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":96,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 96, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":96,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "id": null, "generator": false, "async": true, "params": [], "body": { "type": "BlockStatement", - "start": 12, - "end": 96, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":12,"end":96,"loc":{"start":{"line":1,"column":12},"end":{"line":6,"column":1}}, "body": [ { "type": "ClassDeclaration", - "start": 16, - "end": 94, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":16,"end":94,"loc":{"start":{"line":2,"column":2},"end":{"line":5,"column":3}}, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "C" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 24, - "end": 94, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":24,"end":94,"loc":{"start":{"line":2,"column":10},"end":{"line":5,"column":3}}, "body": [ { "type": "ClassProperty", - "start": 75, - "end": 90, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 19 - } - }, + "start":75,"end":90,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":19}}, "static": false, "key": { "type": "Identifier", - "start": 75, - "end": 76, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "p" - }, + "start":75,"end":76,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":5},"identifierName":"p"}, "name": "p" }, "computed": false, "value": { "type": "BinaryExpression", - "start": 79, - "end": 89, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":79,"end":89,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":18}}, "left": { "type": "Identifier", - "start": 79, - "end": 84, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 13 - }, - "identifierName": "await" - }, + "start":79,"end":84,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":13},"identifierName":"await"}, "name": "await" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 87, - "end": 89, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":87,"end":89,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":18}}, "extra": { "rawValue": 42, "raw": "42" @@ -213,18 +67,7 @@ { "type": "CommentLine", "value": " here await is an identifier reference", - "start": 30, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 44 - } - } + "start":30,"end":70,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} } ] } @@ -243,18 +86,7 @@ { "type": "CommentLine", "value": " here await is an identifier reference", - "start": 30, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 44 - } - } + "start":30,"end":70,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/computed/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/computed/output.json index 40771337a3..9dcd00dceb 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/computed/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/computed/output.json @@ -1,146 +1,45 @@ { "type": "File", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5}}, "static": false, "computed": true, "key": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "x" - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"x"}, "name": "x" }, "value": null }, { "type": "ClassProperty", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":20,"end":25,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":7}}, "static": false, "computed": true, "key": { "type": "StringLiteral", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":21,"end":24,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":6}}, "extra": { "rawValue": "y", "raw": "'y'" @@ -154,117 +53,37 @@ }, { "type": "ClassDeclaration", - "start": 29, - "end": 61, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":29,"end":61,"loc":{"start":{"line":6,"column":0},"end":{"line":9,"column":1}}, "id": { "type": "Identifier", - "start": 35, - "end": 39, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 10 - }, - "identifierName": "Foo2" - }, + "start":35,"end":39,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":10},"identifierName":"Foo2"}, "name": "Foo2" }, "superClass": null, "body": { "type": "ClassBody", - "start": 40, - "end": 61, - "loc": { - "start": { - "line": 6, - "column": 11 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":40,"end":61,"loc":{"start":{"line":6,"column":11},"end":{"line":9,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 5 - } - }, + "start":44,"end":47,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":5}}, "static": false, "computed": true, "key": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 7, - "column": 3 - }, - "end": { - "line": 7, - "column": 4 - }, - "identifierName": "p" - }, + "start":45,"end":46,"loc":{"start":{"line":7,"column":3},"end":{"line":7,"column":4},"identifierName":"p"}, "name": "p" }, "value": null }, { "type": "ClassMethod", - "start": 50, - "end": 59, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 11 - } - }, + "start":50,"end":59,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":11}}, "static": false, "computed": true, "key": { "type": "Identifier", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 8, - "column": 3 - }, - "end": { - "line": 8, - "column": 4 - }, - "identifierName": "m" - }, + "start":51,"end":52,"loc":{"start":{"line":8,"column":3},"end":{"line":8,"column":4},"identifierName":"m"}, "name": "m" }, "kind": "method", @@ -274,18 +93,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 57, - "end": 59, - "loc": { - "start": { - "line": 8, - "column": 9 - }, - "end": { - "line": 8, - "column": 11 - } - }, + "start":57,"end":59,"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":11}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/edge-cases/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/edge-cases/output.json index 6a69ac76f3..b73acc4a8d 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/edge-cases/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/edge-cases/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 381, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 50, - "column": 1 - } - }, + "start":0,"end":381,"loc":{"start":{"line":1,"column":0},"end":{"line":50,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 381, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 50, - "column": 1 - } - }, + "start":0,"end":381,"loc":{"start":{"line":1,"column":0},"end":{"line":50,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "A1" - }, + "start":6,"end":8,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":8},"identifierName":"A1"}, "name": "A1" }, "superClass": null, "body": { "type": "ClassBody", - "start": 9, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":9,"end":34,"loc":{"start":{"line":1,"column":9},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":13,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":3}}, "static": true, "key": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "a" - }, + "start":22,"end":23,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -113,34 +34,11 @@ }, { "type": "ClassProperty", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 8 - } - }, + "start":26,"end":32,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":8}}, "computed": false, "key": { "type": "Identifier", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 8 - }, - "identifierName": "static" - }, + "start":26,"end":32,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":8},"identifierName":"static"}, "name": "static" }, "static": false, @@ -151,81 +49,24 @@ }, { "type": "ClassDeclaration", - "start": 36, - "end": 50, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 14 - } - }, + "start":36,"end":50,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":14}}, "id": { "type": "Identifier", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 8 - }, - "identifierName": "A2" - }, + "start":42,"end":44,"loc":{"start":{"line":7,"column":6},"end":{"line":7,"column":8},"identifierName":"A2"}, "name": "A2" }, "superClass": null, "body": { "type": "ClassBody", - "start": 45, - "end": 50, - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 14 - } - }, + "start":45,"end":50,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":14}}, "body": [ { "type": "ClassProperty", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 7, - "column": 11 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":47,"end":48,"loc":{"start":{"line":7,"column":11},"end":{"line":7,"column":12}}, "static": false, "key": { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 7, - "column": 11 - }, - "end": { - "line": 7, - "column": 12 - }, - "identifierName": "a" - }, + "start":47,"end":48,"loc":{"start":{"line":7,"column":11},"end":{"line":7,"column":12},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -236,81 +77,24 @@ }, { "type": "ClassDeclaration", - "start": 51, - "end": 67, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 16 - } - }, + "start":51,"end":67,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":16}}, "id": { "type": "Identifier", - "start": 57, - "end": 59, - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 8 - }, - "identifierName": "A3" - }, + "start":57,"end":59,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":8},"identifierName":"A3"}, "name": "A3" }, "superClass": null, "body": { "type": "ClassBody", - "start": 60, - "end": 67, - "loc": { - "start": { - "line": 8, - "column": 9 - }, - "end": { - "line": 8, - "column": 16 - } - }, + "start":60,"end":67,"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":16}}, "body": [ { "type": "ClassProperty", - "start": 62, - "end": 65, - "loc": { - "start": { - "line": 8, - "column": 11 - }, - "end": { - "line": 8, - "column": 14 - } - }, + "start":62,"end":65,"loc":{"start":{"line":8,"column":11},"end":{"line":8,"column":14}}, "static": false, "key": { "type": "Identifier", - "start": 62, - "end": 65, - "loc": { - "start": { - "line": 8, - "column": 11 - }, - "end": { - "line": 8, - "column": 14 - }, - "identifierName": "get" - }, + "start":62,"end":65,"loc":{"start":{"line":8,"column":11},"end":{"line":8,"column":14},"identifierName":"get"}, "name": "get" }, "computed": false, @@ -321,81 +105,24 @@ }, { "type": "ClassDeclaration", - "start": 68, - "end": 84, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 16 - } - }, + "start":68,"end":84,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":16}}, "id": { "type": "Identifier", - "start": 74, - "end": 76, - "loc": { - "start": { - "line": 9, - "column": 6 - }, - "end": { - "line": 9, - "column": 8 - }, - "identifierName": "A4" - }, + "start":74,"end":76,"loc":{"start":{"line":9,"column":6},"end":{"line":9,"column":8},"identifierName":"A4"}, "name": "A4" }, "superClass": null, "body": { "type": "ClassBody", - "start": 77, - "end": 84, - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 9, - "column": 16 - } - }, + "start":77,"end":84,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":16}}, "body": [ { "type": "ClassProperty", - "start": 79, - "end": 82, - "loc": { - "start": { - "line": 9, - "column": 11 - }, - "end": { - "line": 9, - "column": 14 - } - }, + "start":79,"end":82,"loc":{"start":{"line":9,"column":11},"end":{"line":9,"column":14}}, "static": false, "key": { "type": "Identifier", - "start": 79, - "end": 82, - "loc": { - "start": { - "line": 9, - "column": 11 - }, - "end": { - "line": 9, - "column": 14 - }, - "identifierName": "set" - }, + "start":79,"end":82,"loc":{"start":{"line":9,"column":11},"end":{"line":9,"column":14},"identifierName":"set"}, "name": "set" }, "computed": false, @@ -406,81 +133,24 @@ }, { "type": "ClassDeclaration", - "start": 85, - "end": 104, - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 10, - "column": 19 - } - }, + "start":85,"end":104,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":19}}, "id": { "type": "Identifier", - "start": 91, - "end": 93, - "loc": { - "start": { - "line": 10, - "column": 6 - }, - "end": { - "line": 10, - "column": 8 - }, - "identifierName": "A5" - }, + "start":91,"end":93,"loc":{"start":{"line":10,"column":6},"end":{"line":10,"column":8},"identifierName":"A5"}, "name": "A5" }, "superClass": null, "body": { "type": "ClassBody", - "start": 94, - "end": 104, - "loc": { - "start": { - "line": 10, - "column": 9 - }, - "end": { - "line": 10, - "column": 19 - } - }, + "start":94,"end":104,"loc":{"start":{"line":10,"column":9},"end":{"line":10,"column":19}}, "body": [ { "type": "ClassProperty", - "start": 96, - "end": 102, - "loc": { - "start": { - "line": 10, - "column": 11 - }, - "end": { - "line": 10, - "column": 17 - } - }, + "start":96,"end":102,"loc":{"start":{"line":10,"column":11},"end":{"line":10,"column":17}}, "computed": false, "key": { "type": "Identifier", - "start": 96, - "end": 102, - "loc": { - "start": { - "line": 10, - "column": 11 - }, - "end": { - "line": 10, - "column": 17 - }, - "identifierName": "static" - }, + "start":96,"end":102,"loc":{"start":{"line":10,"column":11},"end":{"line":10,"column":17},"identifierName":"static"}, "name": "static" }, "static": false, @@ -491,81 +161,24 @@ }, { "type": "ClassDeclaration", - "start": 105, - "end": 123, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 18 - } - }, + "start":105,"end":123,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":18}}, "id": { "type": "Identifier", - "start": 111, - "end": 113, - "loc": { - "start": { - "line": 11, - "column": 6 - }, - "end": { - "line": 11, - "column": 8 - }, - "identifierName": "A6" - }, + "start":111,"end":113,"loc":{"start":{"line":11,"column":6},"end":{"line":11,"column":8},"identifierName":"A6"}, "name": "A6" }, "superClass": null, "body": { "type": "ClassBody", - "start": 114, - "end": 123, - "loc": { - "start": { - "line": 11, - "column": 9 - }, - "end": { - "line": 11, - "column": 18 - } - }, + "start":114,"end":123,"loc":{"start":{"line":11,"column":9},"end":{"line":11,"column":18}}, "body": [ { "type": "ClassProperty", - "start": 116, - "end": 121, - "loc": { - "start": { - "line": 11, - "column": 11 - }, - "end": { - "line": 11, - "column": 16 - } - }, + "start":116,"end":121,"loc":{"start":{"line":11,"column":11},"end":{"line":11,"column":16}}, "static": false, "key": { "type": "Identifier", - "start": 116, - "end": 121, - "loc": { - "start": { - "line": 11, - "column": 11 - }, - "end": { - "line": 11, - "column": 16 - }, - "identifierName": "async" - }, + "start":116,"end":121,"loc":{"start":{"line":11,"column":11},"end":{"line":11,"column":16},"identifierName":"async"}, "name": "async" }, "computed": false, @@ -576,81 +189,24 @@ }, { "type": "ClassDeclaration", - "start": 125, - "end": 152, - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 16, - "column": 1 - } - }, + "start":125,"end":152,"loc":{"start":{"line":13,"column":0},"end":{"line":16,"column":1}}, "id": { "type": "Identifier", - "start": 131, - "end": 133, - "loc": { - "start": { - "line": 13, - "column": 6 - }, - "end": { - "line": 13, - "column": 8 - }, - "identifierName": "A7" - }, + "start":131,"end":133,"loc":{"start":{"line":13,"column":6},"end":{"line":13,"column":8},"identifierName":"A7"}, "name": "A7" }, "superClass": null, "body": { "type": "ClassBody", - "start": 134, - "end": 152, - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 16, - "column": 1 - } - }, + "start":134,"end":152,"loc":{"start":{"line":13,"column":9},"end":{"line":16,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 138, - "end": 141, - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 5 - } - }, + "start":138,"end":141,"loc":{"start":{"line":14,"column":2},"end":{"line":14,"column":5}}, "static": false, "key": { "type": "Identifier", - "start": 138, - "end": 141, - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 5 - }, - "identifierName": "get" - }, + "start":138,"end":141,"loc":{"start":{"line":14,"column":2},"end":{"line":14,"column":5},"identifierName":"get"}, "name": "get" }, "computed": false, @@ -658,35 +214,12 @@ }, { "type": "ClassMethod", - "start": 144, - "end": 150, - "loc": { - "start": { - "line": 15, - "column": 2 - }, - "end": { - "line": 15, - "column": 8 - } - }, + "start":144,"end":150,"loc":{"start":{"line":15,"column":2},"end":{"line":15,"column":8}}, "static": false, "kind": "method", "key": { "type": "Identifier", - "start": 145, - "end": 146, - "loc": { - "start": { - "line": 15, - "column": 3 - }, - "end": { - "line": 15, - "column": 4 - }, - "identifierName": "a" - }, + "start":145,"end":146,"loc":{"start":{"line":15,"column":3},"end":{"line":15,"column":4},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -696,18 +229,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 148, - "end": 150, - "loc": { - "start": { - "line": 15, - "column": 6 - }, - "end": { - "line": 15, - "column": 8 - } - }, + "start":148,"end":150,"loc":{"start":{"line":15,"column":6},"end":{"line":15,"column":8}}, "body": [], "directives": [] } @@ -717,82 +239,25 @@ }, { "type": "ClassDeclaration", - "start": 154, - "end": 184, - "loc": { - "start": { - "line": 18, - "column": 0 - }, - "end": { - "line": 21, - "column": 1 - } - }, + "start":154,"end":184,"loc":{"start":{"line":18,"column":0},"end":{"line":21,"column":1}}, "id": { "type": "Identifier", - "start": 160, - "end": 162, - "loc": { - "start": { - "line": 18, - "column": 6 - }, - "end": { - "line": 18, - "column": 8 - }, - "identifierName": "A8" - }, + "start":160,"end":162,"loc":{"start":{"line":18,"column":6},"end":{"line":18,"column":8},"identifierName":"A8"}, "name": "A8" }, "superClass": null, "body": { "type": "ClassBody", - "start": 163, - "end": 184, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 21, - "column": 1 - } - }, + "start":163,"end":184,"loc":{"start":{"line":18,"column":9},"end":{"line":21,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 167, - "end": 182, - "loc": { - "start": { - "line": 19, - "column": 2 - }, - "end": { - "line": 20, - "column": 8 - } - }, + "start":167,"end":182,"loc":{"start":{"line":19,"column":2},"end":{"line":20,"column":8}}, "static": true, "kind": "method", "key": { "type": "Identifier", - "start": 177, - "end": 178, - "loc": { - "start": { - "line": 20, - "column": 3 - }, - "end": { - "line": 20, - "column": 4 - }, - "identifierName": "a" - }, + "start":177,"end":178,"loc":{"start":{"line":20,"column":3},"end":{"line":20,"column":4},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -802,18 +267,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 180, - "end": 182, - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 8 - } - }, + "start":180,"end":182,"loc":{"start":{"line":20,"column":6},"end":{"line":20,"column":8}}, "body": [], "directives": [] } @@ -823,81 +277,24 @@ }, { "type": "ClassDeclaration", - "start": 186, - "end": 214, - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 26, - "column": 1 - } - }, + "start":186,"end":214,"loc":{"start":{"line":23,"column":0},"end":{"line":26,"column":1}}, "id": { "type": "Identifier", - "start": 192, - "end": 194, - "loc": { - "start": { - "line": 23, - "column": 6 - }, - "end": { - "line": 23, - "column": 8 - }, - "identifierName": "A9" - }, + "start":192,"end":194,"loc":{"start":{"line":23,"column":6},"end":{"line":23,"column":8},"identifierName":"A9"}, "name": "A9" }, "superClass": null, "body": { "type": "ClassBody", - "start": 195, - "end": 214, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 26, - "column": 1 - } - }, + "start":195,"end":214,"loc":{"start":{"line":23,"column":9},"end":{"line":26,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 199, - "end": 204, - "loc": { - "start": { - "line": 24, - "column": 2 - }, - "end": { - "line": 24, - "column": 7 - } - }, + "start":199,"end":204,"loc":{"start":{"line":24,"column":2},"end":{"line":24,"column":7}}, "static": false, "key": { "type": "Identifier", - "start": 199, - "end": 204, - "loc": { - "start": { - "line": 24, - "column": 2 - }, - "end": { - "line": 24, - "column": 7 - }, - "identifierName": "async" - }, + "start":199,"end":204,"loc":{"start":{"line":24,"column":2},"end":{"line":24,"column":7},"identifierName":"async"}, "name": "async" }, "computed": false, @@ -905,34 +302,11 @@ }, { "type": "ClassMethod", - "start": 207, - "end": 212, - "loc": { - "start": { - "line": 25, - "column": 2 - }, - "end": { - "line": 25, - "column": 7 - } - }, + "start":207,"end":212,"loc":{"start":{"line":25,"column":2},"end":{"line":25,"column":7}}, "static": false, "key": { "type": "Identifier", - "start": 207, - "end": 208, - "loc": { - "start": { - "line": 25, - "column": 2 - }, - "end": { - "line": 25, - "column": 3 - }, - "identifierName": "a" - }, + "start":207,"end":208,"loc":{"start":{"line":25,"column":2},"end":{"line":25,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -943,18 +317,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 210, - "end": 212, - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 7 - } - }, + "start":210,"end":212,"loc":{"start":{"line":25,"column":5},"end":{"line":25,"column":7}}, "body": [], "directives": [] } @@ -964,81 +327,24 @@ }, { "type": "ClassDeclaration", - "start": 216, - "end": 250, - "loc": { - "start": { - "line": 28, - "column": 0 - }, - "end": { - "line": 32, - "column": 1 - } - }, + "start":216,"end":250,"loc":{"start":{"line":28,"column":0},"end":{"line":32,"column":1}}, "id": { "type": "Identifier", - "start": 222, - "end": 225, - "loc": { - "start": { - "line": 28, - "column": 6 - }, - "end": { - "line": 28, - "column": 9 - }, - "identifierName": "A10" - }, + "start":222,"end":225,"loc":{"start":{"line":28,"column":6},"end":{"line":28,"column":9},"identifierName":"A10"}, "name": "A10" }, "superClass": null, "body": { "type": "ClassBody", - "start": 226, - "end": 250, - "loc": { - "start": { - "line": 28, - "column": 10 - }, - "end": { - "line": 32, - "column": 1 - } - }, + "start":226,"end":250,"loc":{"start":{"line":28,"column":10},"end":{"line":32,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 230, - "end": 244, - "loc": { - "start": { - "line": 29, - "column": 2 - }, - "end": { - "line": 30, - "column": 7 - } - }, + "start":230,"end":244,"loc":{"start":{"line":29,"column":2},"end":{"line":30,"column":7}}, "static": true, "key": { "type": "Identifier", - "start": 239, - "end": 244, - "loc": { - "start": { - "line": 30, - "column": 2 - }, - "end": { - "line": 30, - "column": 7 - }, - "identifierName": "async" - }, + "start":239,"end":244,"loc":{"start":{"line":30,"column":2},"end":{"line":30,"column":7},"identifierName":"async"}, "name": "async" }, "computed": false, @@ -1046,34 +352,11 @@ }, { "type": "ClassProperty", - "start": 247, - "end": 248, - "loc": { - "start": { - "line": 31, - "column": 2 - }, - "end": { - "line": 31, - "column": 3 - } - }, + "start":247,"end":248,"loc":{"start":{"line":31,"column":2},"end":{"line":31,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 247, - "end": 248, - "loc": { - "start": { - "line": 31, - "column": 2 - }, - "end": { - "line": 31, - "column": 3 - }, - "identifierName": "a" - }, + "start":247,"end":248,"loc":{"start":{"line":31,"column":2},"end":{"line":31,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -1084,81 +367,24 @@ }, { "type": "ClassDeclaration", - "start": 252, - "end": 273, - "loc": { - "start": { - "line": 34, - "column": 0 - }, - "end": { - "line": 34, - "column": 21 - } - }, + "start":252,"end":273,"loc":{"start":{"line":34,"column":0},"end":{"line":34,"column":21}}, "id": { "type": "Identifier", - "start": 258, - "end": 261, - "loc": { - "start": { - "line": 34, - "column": 6 - }, - "end": { - "line": 34, - "column": 9 - }, - "identifierName": "A11" - }, + "start":258,"end":261,"loc":{"start":{"line":34,"column":6},"end":{"line":34,"column":9},"identifierName":"A11"}, "name": "A11" }, "superClass": null, "body": { "type": "ClassBody", - "start": 262, - "end": 273, - "loc": { - "start": { - "line": 34, - "column": 10 - }, - "end": { - "line": 34, - "column": 21 - } - }, + "start":262,"end":273,"loc":{"start":{"line":34,"column":10},"end":{"line":34,"column":21}}, "body": [ { "type": "ClassProperty", - "start": 264, - "end": 271, - "loc": { - "start": { - "line": 34, - "column": 12 - }, - "end": { - "line": 34, - "column": 19 - } - }, + "start":264,"end":271,"loc":{"start":{"line":34,"column":12},"end":{"line":34,"column":19}}, "computed": false, "key": { "type": "Identifier", - "start": 264, - "end": 270, - "loc": { - "start": { - "line": 34, - "column": 12 - }, - "end": { - "line": 34, - "column": 18 - }, - "identifierName": "static" - }, + "start":264,"end":270,"loc":{"start":{"line":34,"column":12},"end":{"line":34,"column":18},"identifierName":"static"}, "name": "static" }, "static": false, @@ -1169,98 +395,30 @@ }, { "type": "ClassDeclaration", - "start": 275, - "end": 302, - "loc": { - "start": { - "line": 36, - "column": 0 - }, - "end": { - "line": 38, - "column": 1 - } - }, + "start":275,"end":302,"loc":{"start":{"line":36,"column":0},"end":{"line":38,"column":1}}, "id": { "type": "Identifier", - "start": 281, - "end": 284, - "loc": { - "start": { - "line": 36, - "column": 6 - }, - "end": { - "line": 36, - "column": 9 - }, - "identifierName": "A12" - }, + "start":281,"end":284,"loc":{"start":{"line":36,"column":6},"end":{"line":36,"column":9},"identifierName":"A12"}, "name": "A12" }, "superClass": null, "body": { "type": "ClassBody", - "start": 285, - "end": 302, - "loc": { - "start": { - "line": 36, - "column": 10 - }, - "end": { - "line": 38, - "column": 1 - } - }, + "start":285,"end":302,"loc":{"start":{"line":36,"column":10},"end":{"line":38,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 289, - "end": 300, - "loc": { - "start": { - "line": 37, - "column": 2 - }, - "end": { - "line": 37, - "column": 13 - } - }, + "start":289,"end":300,"loc":{"start":{"line":37,"column":2},"end":{"line":37,"column":13}}, "computed": false, "key": { "type": "Identifier", - "start": 289, - "end": 295, - "loc": { - "start": { - "line": 37, - "column": 2 - }, - "end": { - "line": 37, - "column": 8 - }, - "identifierName": "static" - }, + "start":289,"end":295,"loc":{"start":{"line":37,"column":2},"end":{"line":37,"column":8},"identifierName":"static"}, "name": "static" }, "static": false, "value": { "type": "NumericLiteral", - "start": 298, - "end": 299, - "loc": { - "start": { - "line": 37, - "column": 11 - }, - "end": { - "line": 37, - "column": 12 - } - }, + "start":298,"end":299,"loc":{"start":{"line":37,"column":11},"end":{"line":37,"column":12}}, "extra": { "rawValue": 0, "raw": "0" @@ -1273,80 +431,24 @@ }, { "type": "ClassDeclaration", - "start": 304, - "end": 335, - "loc": { - "start": { - "line": 40, - "column": 0 - }, - "end": { - "line": 43, - "column": 1 - } - }, + "start":304,"end":335,"loc":{"start":{"line":40,"column":0},"end":{"line":43,"column":1}}, "id": { "type": "Identifier", - "start": 310, - "end": 313, - "loc": { - "start": { - "line": 40, - "column": 6 - }, - "end": { - "line": 40, - "column": 9 - }, - "identifierName": "A13" - }, + "start":310,"end":313,"loc":{"start":{"line":40,"column":6},"end":{"line":40,"column":9},"identifierName":"A13"}, "name": "A13" }, "superClass": null, "body": { "type": "ClassBody", - "start": 314, - "end": 335, - "loc": { - "start": { - "line": 40, - "column": 10 - }, - "end": { - "line": 43, - "column": 1 - } - }, + "start":314,"end":335,"loc":{"start":{"line":40,"column":10},"end":{"line":43,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 318, - "end": 333, - "loc": { - "start": { - "line": 41, - "column": 2 - }, - "end": { - "line": 42, - "column": 11 - } - }, + "start":318,"end":333,"loc":{"start":{"line":41,"column":2},"end":{"line":42,"column":11}}, "static": false, "key": { "type": "StringLiteral", - "start": 325, - "end": 328, - "loc": { - "start": { - "line": 42, - "column": 3 - }, - "end": { - "line": 42, - "column": 6 - } - }, + "start":325,"end":328,"loc":{"start":{"line":42,"column":3},"end":{"line":42,"column":6}}, "extra": { "rawValue": "a", "raw": "'a'" @@ -1361,18 +463,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 331, - "end": 333, - "loc": { - "start": { - "line": 42, - "column": 9 - }, - "end": { - "line": 42, - "column": 11 - } - }, + "start":331,"end":333,"loc":{"start":{"line":42,"column":9},"end":{"line":42,"column":11}}, "body": [], "directives": [] } @@ -1382,81 +473,24 @@ }, { "type": "ClassDeclaration", - "start": 337, - "end": 381, - "loc": { - "start": { - "line": 45, - "column": 0 - }, - "end": { - "line": 50, - "column": 1 - } - }, + "start":337,"end":381,"loc":{"start":{"line":45,"column":0},"end":{"line":50,"column":1}}, "id": { "type": "Identifier", - "start": 343, - "end": 346, - "loc": { - "start": { - "line": 45, - "column": 6 - }, - "end": { - "line": 45, - "column": 9 - }, - "identifierName": "A14" - }, + "start":343,"end":346,"loc":{"start":{"line":45,"column":6},"end":{"line":45,"column":9},"identifierName":"A14"}, "name": "A14" }, "superClass": null, "body": { "type": "ClassBody", - "start": 347, - "end": 381, - "loc": { - "start": { - "line": 45, - "column": 10 - }, - "end": { - "line": 50, - "column": 1 - } - }, + "start":347,"end":381,"loc":{"start":{"line":45,"column":10},"end":{"line":50,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 351, - "end": 379, - "loc": { - "start": { - "line": 46, - "column": 2 - }, - "end": { - "line": 49, - "column": 6 - } - }, + "start":351,"end":379,"loc":{"start":{"line":46,"column":2},"end":{"line":49,"column":6}}, "static": true, "key": { "type": "Identifier", - "start": 366, - "end": 372, - "loc": { - "start": { - "line": 48, - "column": 2 - }, - "end": { - "line": 48, - "column": 8 - }, - "identifierName": "static" - }, + "start":366,"end":372,"loc":{"start":{"line":48,"column":2},"end":{"line":48,"column":8},"identifierName":"static"}, "name": "static" }, "computed": false, @@ -1467,18 +501,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 377, - "end": 379, - "loc": { - "start": { - "line": 49, - "column": 4 - }, - "end": { - "line": 49, - "column": 6 - } - }, + "start":377,"end":379,"loc":{"start":{"line":49,"column":4},"end":{"line":49,"column":6}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/inline/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/inline/output.json index 01efea8ee2..80cff77677 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/inline/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/inline/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17}}, "body": [ { "type": "ClassProperty", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "static": false, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -113,34 +34,11 @@ }, { "type": "ClassProperty", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "static": false, "key": { "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" }, "computed": false, @@ -151,98 +49,30 @@ }, { "type": "ClassDeclaration", - "start": 19, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":19,"end":44,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":25}}, "id": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "B" - }, + "start":25,"end":26,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7},"identifierName":"B"}, "name": "B" }, "superClass": null, "body": { "type": "ClassBody", - "start": 27, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":27,"end":44,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":25}}, "body": [ { "type": "ClassProperty", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":29,"end":35,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":16}}, "static": false, "key": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":29,"end":30,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" }, "computed": false, "value": { "type": "NumericLiteral", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":33,"end":34,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, "extra": { "rawValue": 0, "raw": "0" @@ -252,51 +82,17 @@ }, { "type": "ClassProperty", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":36,"end":42,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":23}}, "static": false, "key": { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 18 - }, - "identifierName": "y" - }, + "start":36,"end":37,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":18},"identifierName":"y"}, "name": "y" }, "computed": false, "value": { "type": "NumericLiteral", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":40,"end":41,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":22}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json index a44ee2efc2..166fd813da 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-invalid/output.json @@ -1,129 +1,38 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: new.target can only be used in functions or class properties (1:8)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":4,"end":18,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "MetaProperty", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":8,"end":18,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":18}}, "meta": { "type": "Identifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "new" - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "target" - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18},"identifierName":"target"}, "name": "target" } } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-with-flow/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-with-flow/output.json index d3d00ee7bb..1bce1392d0 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-with-flow/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target-with-flow/output.json @@ -1,259 +1,77 @@ { "type": "File", - "start": 0, - "end": 257, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":0,"end":257,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 257, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":0,"end":257,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 257, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":0,"end":257,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "X" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"X"}, "name": "X" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 257, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":8,"end":257,"loc":{"start":{"line":1,"column":8},"end":{"line":10,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":12,"end":34,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":24}}, "static": true, "key": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "a" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"a"}, "name": "a" }, "computed": false, "variance": null, "value": { "type": "MetaProperty", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":23,"end":33,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":23}}, "meta": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "new" - }, + "start":23,"end":26,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "target" - }, + "start":27,"end":33,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":23},"identifierName":"target"}, "name": "target" } } }, { "type": "ClassProperty", - "start": 37, - "end": 76, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":37,"end":76,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":41}}, "static": true, "key": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "b" - }, + "start":44,"end":45,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"b"}, "name": "b" }, "computed": false, "variance": null, "value": { "type": "AssignmentExpression", - "start": 49, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":49,"end":74,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":39}}, "operator": "=", "left": { "type": "Identifier", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "foo" - }, + "start":49,"end":52,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":17},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "BinaryExpression", - "start": 55, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":55,"end":74,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":39}}, "left": { "type": "NumericLiteral", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":55,"end":56,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":21}}, "extra": { "rawValue": 1, "raw": "1" @@ -263,82 +81,24 @@ "operator": "+", "right": { "type": "CallExpression", - "start": 59, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":59,"end":74,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":39}}, "callee": { "type": "Identifier", - "start": 59, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 27 - }, - "identifierName": "bar" - }, + "start":59,"end":62,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":27},"identifierName":"bar"}, "name": "bar" }, "arguments": [ { "type": "MetaProperty", - "start": 63, - "end": 73, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 38 - } - }, + "start":63,"end":73,"loc":{"start":{"line":3,"column":28},"end":{"line":3,"column":38}}, "meta": { "type": "Identifier", - "start": 63, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 31 - }, - "identifierName": "new" - }, + "start":63,"end":66,"loc":{"start":{"line":3,"column":28},"end":{"line":3,"column":31},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 67, - "end": 73, - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 38 - }, - "identifierName": "target" - }, + "start":67,"end":73,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":38},"identifierName":"target"}, "name": "target" } } @@ -353,102 +113,33 @@ }, { "type": "ClassProperty", - "start": 79, - "end": 107, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 30 - } - }, + "start":79,"end":107,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":30}}, "static": true, "key": { "type": "Identifier", - "start": 86, - "end": 87, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 10 - }, - "identifierName": "c" - }, + "start":86,"end":87,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10},"identifierName":"c"}, "name": "c" }, "computed": false, "variance": null, "value": { "type": "ArrowFunctionExpression", - "start": 90, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":90,"end":106,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":29}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "MetaProperty", - "start": 96, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":96,"end":106,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":29}}, "meta": { "type": "Identifier", - "start": 96, - "end": 99, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 22 - }, - "identifierName": "new" - }, + "start":96,"end":99,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":22},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 100, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 23 - }, - "end": { - "line": 4, - "column": 29 - }, - "identifierName": "target" - }, + "start":100,"end":106,"loc":{"start":{"line":4,"column":23},"end":{"line":4,"column":29},"identifierName":"target"}, "name": "target" } } @@ -456,133 +147,41 @@ }, { "type": "ClassProperty", - "start": 110, - "end": 146, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 38 - } - }, + "start":110,"end":146,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":38}}, "static": true, "key": { "type": "Identifier", - "start": 117, - "end": 118, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 10 - }, - "identifierName": "d" - }, + "start":117,"end":118,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":10},"identifierName":"d"}, "name": "d" }, "computed": false, "variance": null, "value": { "type": "ArrowFunctionExpression", - "start": 121, - "end": 145, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 37 - } - }, + "start":121,"end":145,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":37}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 122, - "end": 138, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 30 - } - }, + "start":122,"end":138,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":30}}, "left": { "type": "Identifier", - "start": 122, - "end": 125, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 17 - }, - "identifierName": "foo" - }, + "start":122,"end":125,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":17},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "MetaProperty", - "start": 128, - "end": 138, - "loc": { - "start": { - "line": 5, - "column": 20 - }, - "end": { - "line": 5, - "column": 30 - } - }, + "start":128,"end":138,"loc":{"start":{"line":5,"column":20},"end":{"line":5,"column":30}}, "meta": { "type": "Identifier", - "start": 128, - "end": 131, - "loc": { - "start": { - "line": 5, - "column": 20 - }, - "end": { - "line": 5, - "column": 23 - }, - "identifierName": "new" - }, + "start":128,"end":131,"loc":{"start":{"line":5,"column":20},"end":{"line":5,"column":23},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 132, - "end": 138, - "loc": { - "start": { - "line": 5, - "column": 24 - }, - "end": { - "line": 5, - "column": 30 - }, - "identifierName": "target" - }, + "start":132,"end":138,"loc":{"start":{"line":5,"column":24},"end":{"line":5,"column":30},"identifierName":"target"}, "name": "target" } } @@ -590,18 +189,7 @@ ], "body": { "type": "BlockStatement", - "start": 143, - "end": 145, - "loc": { - "start": { - "line": 5, - "column": 35 - }, - "end": { - "line": 5, - "column": 37 - } - }, + "start":143,"end":145,"loc":{"start":{"line":5,"column":35},"end":{"line":5,"column":37}}, "body": [], "directives": [] } @@ -609,182 +197,56 @@ }, { "type": "ClassProperty", - "start": 149, - "end": 164, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":149,"end":164,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":17}}, "static": false, "key": { "type": "Identifier", - "start": 149, - "end": 150, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - }, - "identifierName": "e" - }, + "start":149,"end":150,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":3},"identifierName":"e"}, "name": "e" }, "computed": false, "variance": null, "value": { "type": "MetaProperty", - "start": 153, - "end": 163, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 16 - } - }, + "start":153,"end":163,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":16}}, "meta": { "type": "Identifier", - "start": 153, - "end": 156, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 9 - }, - "identifierName": "new" - }, + "start":153,"end":156,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":9},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 157, - "end": 163, - "loc": { - "start": { - "line": 6, - "column": 10 - }, - "end": { - "line": 6, - "column": 16 - }, - "identifierName": "target" - }, + "start":157,"end":163,"loc":{"start":{"line":6,"column":10},"end":{"line":6,"column":16},"identifierName":"target"}, "name": "target" } } }, { "type": "ClassProperty", - "start": 167, - "end": 199, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 34 - } - }, + "start":167,"end":199,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":34}}, "static": false, "key": { "type": "Identifier", - "start": 167, - "end": 168, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 3 - }, - "identifierName": "f" - }, + "start":167,"end":168,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":3},"identifierName":"f"}, "name": "f" }, "computed": false, "variance": null, "value": { "type": "AssignmentExpression", - "start": 172, - "end": 197, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 32 - } - }, + "start":172,"end":197,"loc":{"start":{"line":7,"column":7},"end":{"line":7,"column":32}}, "operator": "=", "left": { "type": "Identifier", - "start": 172, - "end": 175, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 10 - }, - "identifierName": "foo" - }, + "start":172,"end":175,"loc":{"start":{"line":7,"column":7},"end":{"line":7,"column":10},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "BinaryExpression", - "start": 178, - "end": 197, - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 32 - } - }, + "start":178,"end":197,"loc":{"start":{"line":7,"column":13},"end":{"line":7,"column":32}}, "left": { "type": "NumericLiteral", - "start": 178, - "end": 179, - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 14 - } - }, + "start":178,"end":179,"loc":{"start":{"line":7,"column":13},"end":{"line":7,"column":14}}, "extra": { "rawValue": 1, "raw": "1" @@ -794,82 +256,24 @@ "operator": "+", "right": { "type": "CallExpression", - "start": 182, - "end": 197, - "loc": { - "start": { - "line": 7, - "column": 17 - }, - "end": { - "line": 7, - "column": 32 - } - }, + "start":182,"end":197,"loc":{"start":{"line":7,"column":17},"end":{"line":7,"column":32}}, "callee": { "type": "Identifier", - "start": 182, - "end": 185, - "loc": { - "start": { - "line": 7, - "column": 17 - }, - "end": { - "line": 7, - "column": 20 - }, - "identifierName": "bar" - }, + "start":182,"end":185,"loc":{"start":{"line":7,"column":17},"end":{"line":7,"column":20},"identifierName":"bar"}, "name": "bar" }, "arguments": [ { "type": "MetaProperty", - "start": 186, - "end": 196, - "loc": { - "start": { - "line": 7, - "column": 21 - }, - "end": { - "line": 7, - "column": 31 - } - }, + "start":186,"end":196,"loc":{"start":{"line":7,"column":21},"end":{"line":7,"column":31}}, "meta": { "type": "Identifier", - "start": 186, - "end": 189, - "loc": { - "start": { - "line": 7, - "column": 21 - }, - "end": { - "line": 7, - "column": 24 - }, - "identifierName": "new" - }, + "start":186,"end":189,"loc":{"start":{"line":7,"column":21},"end":{"line":7,"column":24},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 190, - "end": 196, - "loc": { - "start": { - "line": 7, - "column": 25 - }, - "end": { - "line": 7, - "column": 31 - }, - "identifierName": "target" - }, + "start":190,"end":196,"loc":{"start":{"line":7,"column":25},"end":{"line":7,"column":31},"identifierName":"target"}, "name": "target" } } @@ -884,102 +288,33 @@ }, { "type": "ClassProperty", - "start": 202, - "end": 223, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 23 - } - }, + "start":202,"end":223,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":23}}, "static": false, "key": { "type": "Identifier", - "start": 202, - "end": 203, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 3 - }, - "identifierName": "g" - }, + "start":202,"end":203,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":3},"identifierName":"g"}, "name": "g" }, "computed": false, "variance": null, "value": { "type": "ArrowFunctionExpression", - "start": 206, - "end": 222, - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 22 - } - }, + "start":206,"end":222,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":22}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "MetaProperty", - "start": 212, - "end": 222, - "loc": { - "start": { - "line": 8, - "column": 12 - }, - "end": { - "line": 8, - "column": 22 - } - }, + "start":212,"end":222,"loc":{"start":{"line":8,"column":12},"end":{"line":8,"column":22}}, "meta": { "type": "Identifier", - "start": 212, - "end": 215, - "loc": { - "start": { - "line": 8, - "column": 12 - }, - "end": { - "line": 8, - "column": 15 - }, - "identifierName": "new" - }, + "start":212,"end":215,"loc":{"start":{"line":8,"column":12},"end":{"line":8,"column":15},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 216, - "end": 222, - "loc": { - "start": { - "line": 8, - "column": 16 - }, - "end": { - "line": 8, - "column": 22 - }, - "identifierName": "target" - }, + "start":216,"end":222,"loc":{"start":{"line":8,"column":16},"end":{"line":8,"column":22},"identifierName":"target"}, "name": "target" } } @@ -987,133 +322,41 @@ }, { "type": "ClassProperty", - "start": 226, - "end": 255, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 31 - } - }, + "start":226,"end":255,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":31}}, "static": false, "key": { "type": "Identifier", - "start": 226, - "end": 227, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 3 - }, - "identifierName": "h" - }, + "start":226,"end":227,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":3},"identifierName":"h"}, "name": "h" }, "computed": false, "variance": null, "value": { "type": "ArrowFunctionExpression", - "start": 230, - "end": 254, - "loc": { - "start": { - "line": 9, - "column": 6 - }, - "end": { - "line": 9, - "column": 30 - } - }, + "start":230,"end":254,"loc":{"start":{"line":9,"column":6},"end":{"line":9,"column":30}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 231, - "end": 247, - "loc": { - "start": { - "line": 9, - "column": 7 - }, - "end": { - "line": 9, - "column": 23 - } - }, + "start":231,"end":247,"loc":{"start":{"line":9,"column":7},"end":{"line":9,"column":23}}, "left": { "type": "Identifier", - "start": 231, - "end": 234, - "loc": { - "start": { - "line": 9, - "column": 7 - }, - "end": { - "line": 9, - "column": 10 - }, - "identifierName": "foo" - }, + "start":231,"end":234,"loc":{"start":{"line":9,"column":7},"end":{"line":9,"column":10},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "MetaProperty", - "start": 237, - "end": 247, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 23 - } - }, + "start":237,"end":247,"loc":{"start":{"line":9,"column":13},"end":{"line":9,"column":23}}, "meta": { "type": "Identifier", - "start": 237, - "end": 240, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 16 - }, - "identifierName": "new" - }, + "start":237,"end":240,"loc":{"start":{"line":9,"column":13},"end":{"line":9,"column":16},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 241, - "end": 247, - "loc": { - "start": { - "line": 9, - "column": 17 - }, - "end": { - "line": 9, - "column": 23 - }, - "identifierName": "target" - }, + "start":241,"end":247,"loc":{"start":{"line":9,"column":17},"end":{"line":9,"column":23},"identifierName":"target"}, "name": "target" } } @@ -1121,18 +364,7 @@ ], "body": { "type": "BlockStatement", - "start": 252, - "end": 254, - "loc": { - "start": { - "line": 9, - "column": 28 - }, - "end": { - "line": 9, - "column": 30 - } - }, + "start":252,"end":254,"loc":{"start":{"line":9,"column":28},"end":{"line":9,"column":30}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target/output.json index 909e3ddcd0..5f0cc9d12f 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/new-target/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/new-target/output.json @@ -1,257 +1,75 @@ { "type": "File", - "start": 0, - "end": 257, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":0,"end":257,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 257, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":0,"end":257,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 257, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":0,"end":257,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "X" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"X"}, "name": "X" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 257, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":8,"end":257,"loc":{"start":{"line":1,"column":8},"end":{"line":10,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":12,"end":34,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":24}}, "static": true, "key": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "a" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"a"}, "name": "a" }, "computed": false, "value": { "type": "MetaProperty", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":23,"end":33,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":23}}, "meta": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "new" - }, + "start":23,"end":26,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "target" - }, + "start":27,"end":33,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":23},"identifierName":"target"}, "name": "target" } } }, { "type": "ClassProperty", - "start": 37, - "end": 76, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":37,"end":76,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":41}}, "static": true, "key": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "b" - }, + "start":44,"end":45,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"b"}, "name": "b" }, "computed": false, "value": { "type": "AssignmentExpression", - "start": 49, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":49,"end":74,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":39}}, "operator": "=", "left": { "type": "Identifier", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "foo" - }, + "start":49,"end":52,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":17},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "BinaryExpression", - "start": 55, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":55,"end":74,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":39}}, "left": { "type": "NumericLiteral", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":55,"end":56,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":21}}, "extra": { "rawValue": 1, "raw": "1" @@ -261,82 +79,24 @@ "operator": "+", "right": { "type": "CallExpression", - "start": 59, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":59,"end":74,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":39}}, "callee": { "type": "Identifier", - "start": 59, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 27 - }, - "identifierName": "bar" - }, + "start":59,"end":62,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":27},"identifierName":"bar"}, "name": "bar" }, "arguments": [ { "type": "MetaProperty", - "start": 63, - "end": 73, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 38 - } - }, + "start":63,"end":73,"loc":{"start":{"line":3,"column":28},"end":{"line":3,"column":38}}, "meta": { "type": "Identifier", - "start": 63, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 31 - }, - "identifierName": "new" - }, + "start":63,"end":66,"loc":{"start":{"line":3,"column":28},"end":{"line":3,"column":31},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 67, - "end": 73, - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 38 - }, - "identifierName": "target" - }, + "start":67,"end":73,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":38},"identifierName":"target"}, "name": "target" } } @@ -351,101 +111,32 @@ }, { "type": "ClassProperty", - "start": 79, - "end": 107, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 30 - } - }, + "start":79,"end":107,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":30}}, "static": true, "key": { "type": "Identifier", - "start": 86, - "end": 87, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 10 - }, - "identifierName": "c" - }, + "start":86,"end":87,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10},"identifierName":"c"}, "name": "c" }, "computed": false, "value": { "type": "ArrowFunctionExpression", - "start": 90, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":90,"end":106,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":29}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "MetaProperty", - "start": 96, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":96,"end":106,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":29}}, "meta": { "type": "Identifier", - "start": 96, - "end": 99, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 22 - }, - "identifierName": "new" - }, + "start":96,"end":99,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":22},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 100, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 23 - }, - "end": { - "line": 4, - "column": 29 - }, - "identifierName": "target" - }, + "start":100,"end":106,"loc":{"start":{"line":4,"column":23},"end":{"line":4,"column":29},"identifierName":"target"}, "name": "target" } } @@ -453,132 +144,40 @@ }, { "type": "ClassProperty", - "start": 110, - "end": 146, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 38 - } - }, + "start":110,"end":146,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":38}}, "static": true, "key": { "type": "Identifier", - "start": 117, - "end": 118, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 10 - }, - "identifierName": "d" - }, + "start":117,"end":118,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":10},"identifierName":"d"}, "name": "d" }, "computed": false, "value": { "type": "ArrowFunctionExpression", - "start": 121, - "end": 145, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 37 - } - }, + "start":121,"end":145,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":37}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 122, - "end": 138, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 30 - } - }, + "start":122,"end":138,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":30}}, "left": { "type": "Identifier", - "start": 122, - "end": 125, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 17 - }, - "identifierName": "foo" - }, + "start":122,"end":125,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":17},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "MetaProperty", - "start": 128, - "end": 138, - "loc": { - "start": { - "line": 5, - "column": 20 - }, - "end": { - "line": 5, - "column": 30 - } - }, + "start":128,"end":138,"loc":{"start":{"line":5,"column":20},"end":{"line":5,"column":30}}, "meta": { "type": "Identifier", - "start": 128, - "end": 131, - "loc": { - "start": { - "line": 5, - "column": 20 - }, - "end": { - "line": 5, - "column": 23 - }, - "identifierName": "new" - }, + "start":128,"end":131,"loc":{"start":{"line":5,"column":20},"end":{"line":5,"column":23},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 132, - "end": 138, - "loc": { - "start": { - "line": 5, - "column": 24 - }, - "end": { - "line": 5, - "column": 30 - }, - "identifierName": "target" - }, + "start":132,"end":138,"loc":{"start":{"line":5,"column":24},"end":{"line":5,"column":30},"identifierName":"target"}, "name": "target" } } @@ -586,18 +185,7 @@ ], "body": { "type": "BlockStatement", - "start": 143, - "end": 145, - "loc": { - "start": { - "line": 5, - "column": 35 - }, - "end": { - "line": 5, - "column": 37 - } - }, + "start":143,"end":145,"loc":{"start":{"line":5,"column":35},"end":{"line":5,"column":37}}, "body": [], "directives": [] } @@ -605,180 +193,54 @@ }, { "type": "ClassProperty", - "start": 149, - "end": 164, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":149,"end":164,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":17}}, "static": false, "key": { "type": "Identifier", - "start": 149, - "end": 150, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - }, - "identifierName": "e" - }, + "start":149,"end":150,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":3},"identifierName":"e"}, "name": "e" }, "computed": false, "value": { "type": "MetaProperty", - "start": 153, - "end": 163, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 16 - } - }, + "start":153,"end":163,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":16}}, "meta": { "type": "Identifier", - "start": 153, - "end": 156, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 9 - }, - "identifierName": "new" - }, + "start":153,"end":156,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":9},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 157, - "end": 163, - "loc": { - "start": { - "line": 6, - "column": 10 - }, - "end": { - "line": 6, - "column": 16 - }, - "identifierName": "target" - }, + "start":157,"end":163,"loc":{"start":{"line":6,"column":10},"end":{"line":6,"column":16},"identifierName":"target"}, "name": "target" } } }, { "type": "ClassProperty", - "start": 167, - "end": 199, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 34 - } - }, + "start":167,"end":199,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":34}}, "static": false, "key": { "type": "Identifier", - "start": 167, - "end": 168, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 3 - }, - "identifierName": "f" - }, + "start":167,"end":168,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":3},"identifierName":"f"}, "name": "f" }, "computed": false, "value": { "type": "AssignmentExpression", - "start": 172, - "end": 197, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 32 - } - }, + "start":172,"end":197,"loc":{"start":{"line":7,"column":7},"end":{"line":7,"column":32}}, "operator": "=", "left": { "type": "Identifier", - "start": 172, - "end": 175, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 10 - }, - "identifierName": "foo" - }, + "start":172,"end":175,"loc":{"start":{"line":7,"column":7},"end":{"line":7,"column":10},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "BinaryExpression", - "start": 178, - "end": 197, - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 32 - } - }, + "start":178,"end":197,"loc":{"start":{"line":7,"column":13},"end":{"line":7,"column":32}}, "left": { "type": "NumericLiteral", - "start": 178, - "end": 179, - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 14 - } - }, + "start":178,"end":179,"loc":{"start":{"line":7,"column":13},"end":{"line":7,"column":14}}, "extra": { "rawValue": 1, "raw": "1" @@ -788,82 +250,24 @@ "operator": "+", "right": { "type": "CallExpression", - "start": 182, - "end": 197, - "loc": { - "start": { - "line": 7, - "column": 17 - }, - "end": { - "line": 7, - "column": 32 - } - }, + "start":182,"end":197,"loc":{"start":{"line":7,"column":17},"end":{"line":7,"column":32}}, "callee": { "type": "Identifier", - "start": 182, - "end": 185, - "loc": { - "start": { - "line": 7, - "column": 17 - }, - "end": { - "line": 7, - "column": 20 - }, - "identifierName": "bar" - }, + "start":182,"end":185,"loc":{"start":{"line":7,"column":17},"end":{"line":7,"column":20},"identifierName":"bar"}, "name": "bar" }, "arguments": [ { "type": "MetaProperty", - "start": 186, - "end": 196, - "loc": { - "start": { - "line": 7, - "column": 21 - }, - "end": { - "line": 7, - "column": 31 - } - }, + "start":186,"end":196,"loc":{"start":{"line":7,"column":21},"end":{"line":7,"column":31}}, "meta": { "type": "Identifier", - "start": 186, - "end": 189, - "loc": { - "start": { - "line": 7, - "column": 21 - }, - "end": { - "line": 7, - "column": 24 - }, - "identifierName": "new" - }, + "start":186,"end":189,"loc":{"start":{"line":7,"column":21},"end":{"line":7,"column":24},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 190, - "end": 196, - "loc": { - "start": { - "line": 7, - "column": 25 - }, - "end": { - "line": 7, - "column": 31 - }, - "identifierName": "target" - }, + "start":190,"end":196,"loc":{"start":{"line":7,"column":25},"end":{"line":7,"column":31},"identifierName":"target"}, "name": "target" } } @@ -878,101 +282,32 @@ }, { "type": "ClassProperty", - "start": 202, - "end": 223, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 23 - } - }, + "start":202,"end":223,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":23}}, "static": false, "key": { "type": "Identifier", - "start": 202, - "end": 203, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 3 - }, - "identifierName": "g" - }, + "start":202,"end":203,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":3},"identifierName":"g"}, "name": "g" }, "computed": false, "value": { "type": "ArrowFunctionExpression", - "start": 206, - "end": 222, - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 22 - } - }, + "start":206,"end":222,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":22}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "MetaProperty", - "start": 212, - "end": 222, - "loc": { - "start": { - "line": 8, - "column": 12 - }, - "end": { - "line": 8, - "column": 22 - } - }, + "start":212,"end":222,"loc":{"start":{"line":8,"column":12},"end":{"line":8,"column":22}}, "meta": { "type": "Identifier", - "start": 212, - "end": 215, - "loc": { - "start": { - "line": 8, - "column": 12 - }, - "end": { - "line": 8, - "column": 15 - }, - "identifierName": "new" - }, + "start":212,"end":215,"loc":{"start":{"line":8,"column":12},"end":{"line":8,"column":15},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 216, - "end": 222, - "loc": { - "start": { - "line": 8, - "column": 16 - }, - "end": { - "line": 8, - "column": 22 - }, - "identifierName": "target" - }, + "start":216,"end":222,"loc":{"start":{"line":8,"column":16},"end":{"line":8,"column":22},"identifierName":"target"}, "name": "target" } } @@ -980,132 +315,40 @@ }, { "type": "ClassProperty", - "start": 226, - "end": 255, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 31 - } - }, + "start":226,"end":255,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":31}}, "static": false, "key": { "type": "Identifier", - "start": 226, - "end": 227, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 3 - }, - "identifierName": "h" - }, + "start":226,"end":227,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":3},"identifierName":"h"}, "name": "h" }, "computed": false, "value": { "type": "ArrowFunctionExpression", - "start": 230, - "end": 254, - "loc": { - "start": { - "line": 9, - "column": 6 - }, - "end": { - "line": 9, - "column": 30 - } - }, + "start":230,"end":254,"loc":{"start":{"line":9,"column":6},"end":{"line":9,"column":30}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 231, - "end": 247, - "loc": { - "start": { - "line": 9, - "column": 7 - }, - "end": { - "line": 9, - "column": 23 - } - }, + "start":231,"end":247,"loc":{"start":{"line":9,"column":7},"end":{"line":9,"column":23}}, "left": { "type": "Identifier", - "start": 231, - "end": 234, - "loc": { - "start": { - "line": 9, - "column": 7 - }, - "end": { - "line": 9, - "column": 10 - }, - "identifierName": "foo" - }, + "start":231,"end":234,"loc":{"start":{"line":9,"column":7},"end":{"line":9,"column":10},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "MetaProperty", - "start": 237, - "end": 247, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 23 - } - }, + "start":237,"end":247,"loc":{"start":{"line":9,"column":13},"end":{"line":9,"column":23}}, "meta": { "type": "Identifier", - "start": 237, - "end": 240, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 16 - }, - "identifierName": "new" - }, + "start":237,"end":240,"loc":{"start":{"line":9,"column":13},"end":{"line":9,"column":16},"identifierName":"new"}, "name": "new" }, "property": { "type": "Identifier", - "start": 241, - "end": 247, - "loc": { - "start": { - "line": 9, - "column": 17 - }, - "end": { - "line": 9, - "column": 23 - }, - "identifierName": "target" - }, + "start":241,"end":247,"loc":{"start":{"line":9,"column":17},"end":{"line":9,"column":23},"identifierName":"target"}, "name": "target" } } @@ -1113,18 +356,7 @@ ], "body": { "type": "BlockStatement", - "start": 252, - "end": 254, - "loc": { - "start": { - "line": 9, - "column": 28 - }, - "end": { - "line": 9, - "column": 30 - } - }, + "start":252,"end":254,"loc":{"start":{"line":9,"column":28},"end":{"line":9,"column":30}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json index 0678d19179..9d09ab7b33 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor-2/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Classes may not have a field named 'constructor' (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":10,"end":36,"loc":{"start":{"line":1,"column":10},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -116,35 +37,12 @@ }, { "type": "ClassMethod", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":28,"end":34,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8}}, "static": false, "kind": "method", "key": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":29,"end":30,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -154,18 +52,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":32,"end":34,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json index 2a969d61e7..67687aa331 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-ctor/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Classes may not have a field named 'constructor' (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json index 975df8dd81..2850861ad8 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype-2/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Classes may not have static property named prototype (2:9)" ], "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":10,"end":41,"loc":{"start":{"line":1,"column":10},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 14, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":14,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, "static": true, "key": { "type": "Identifier", - "start": 21, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "prototype" - }, + "start":21,"end":30,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":18},"identifierName":"prototype"}, "name": "prototype" }, "computed": false, @@ -116,35 +37,12 @@ }, { "type": "ClassMethod", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":33,"end":39,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8}}, "static": false, "kind": "method", "key": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -154,18 +52,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":37,"end":39,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":8}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json index fb30056642..2e1a73e973 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/no-static-prototype/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Classes may not have static property named prototype (2:9)" ], "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":32,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 14, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":14,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, "static": true, "key": { "type": "Identifier", - "start": 21, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "prototype" - }, + "start":21,"end":30,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":18},"identifierName":"prototype"}, "name": "prototype" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json index 74fd91c747..789ddb0c28 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/static-field-named-constructor/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Classes may not have a field named 'constructor' (2:11)" ], "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":37,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 16, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":16,"end":35,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":23}}, "static": true, "key": { "type": "Identifier", - "start": 23, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "constructor" - }, + "start":23,"end":34,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":22},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json index 987d1eef50..e93888eeb6 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/super-call/output.json @@ -1,130 +1,39 @@ { "type": "File", - "start": 0, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "errors": [ "SyntaxError: super() is only valid inside a class constructor of a subclass. Maybe a typo in the method name ('constructor') or not extending another class? (4:12)" ], "program": { "type": "Program", - "start": 0, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"B"}, "name": "B" }, "body": { "type": "ClassBody", - "start": 18, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":18,"end":94,"loc":{"start":{"line":1,"column":18},"end":{"line":7,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 22, - "end": 92, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":22,"end":92,"loc":{"start":{"line":2,"column":2},"end":{"line":6,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 22, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":22,"end":33,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -135,143 +44,41 @@ "params": [], "body": { "type": "BlockStatement", - "start": 36, - "end": 92, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":36,"end":92,"loc":{"start":{"line":2,"column":16},"end":{"line":6,"column":3}}, "body": [ { "type": "ClassDeclaration", - "start": 42, - "end": 88, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":42,"end":88,"loc":{"start":{"line":3,"column":4},"end":{"line":5,"column":5}}, "id": { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "C" - }, + "start":48,"end":49,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"C"}, "name": "C" }, "superClass": { "type": "Identifier", - "start": 58, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 21 - }, - "identifierName": "D" - }, + "start":58,"end":59,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":21},"identifierName":"D"}, "name": "D" }, "body": { "type": "ClassBody", - "start": 60, - "end": 88, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":60,"end":88,"loc":{"start":{"line":3,"column":22},"end":{"line":5,"column":5}}, "body": [ { "type": "ClassProperty", - "start": 68, - "end": 82, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 20 - } - }, + "start":68,"end":82,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":20}}, "static": false, "key": { "type": "Identifier", - "start": 68, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 9 - }, - "identifierName": "foo" - }, + "start":68,"end":71,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":9},"identifierName":"foo"}, "name": "foo" }, "computed": false, "value": { "type": "CallExpression", - "start": 74, - "end": 81, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 19 - } - }, + "start":74,"end":81,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":19}}, "callee": { "type": "Super", - "start": 74, - "end": 79, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 17 - } - } + "start":74,"end":79,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":17}} }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/output.json index d411c6ff6e..7b6feb8100 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-arrow-function/output.json @@ -1,206 +1,59 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"B"}, "name": "B" }, "body": { "type": "ClassBody", - "start": 18, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":18,"end":46,"loc":{"start":{"line":1,"column":18},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 22, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":22,"end":44,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":24}}, "static": false, "key": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"foo"}, "name": "foo" }, "computed": false, "value": { "type": "ArrowFunctionExpression", - "start": 28, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":28,"end":43,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":23}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "CallExpression", - "start": 34, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":34,"end":43,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":23}}, "callee": { "type": "MemberExpression", - "start": 34, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":34,"end":41,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":21}}, "object": { "type": "Super", - "start": 34, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 19 - } - } + "start":34,"end":39,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":19}} }, "property": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 21 - }, - "identifierName": "x" - }, + "start":40,"end":41,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":21},"identifierName":"x"}, "name": "x" }, "computed": false diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/output.json index b129c88406..c69a435a10 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/super-inside-function/output.json @@ -1,146 +1,44 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: super is only allowed in object methods and classes (3:4)" ], "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":8,"end":54,"loc":{"start":{"line":1,"column":8},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":12,"end":52,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "foo" - }, + "start":12,"end":15,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"foo"}, "name": "foo" }, "computed": false, "value": { "type": "FunctionExpression", - "start": 18, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":18,"end":52,"loc":{"start":{"line":2,"column":8},"end":{"line":4,"column":3}}, "id": { "type": "Identifier", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "fn" - }, + "start":27,"end":29,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":19},"identifierName":"fn"}, "name": "fn" }, "generator": false, @@ -148,91 +46,24 @@ "params": [], "body": { "type": "BlockStatement", - "start": 32, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":32,"end":52,"loc":{"start":{"line":2,"column":22},"end":{"line":4,"column":3}}, "body": [ { "type": "ExpressionStatement", - "start": 38, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":38,"end":48,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":14}}, "expression": { "type": "CallExpression", - "start": 38, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":38,"end":47,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13}}, "callee": { "type": "MemberExpression", - "start": 38, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":38,"end":45,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":11}}, "object": { "type": "Super", - "start": 38, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 9 - } - } + "start":38,"end":43,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":9}} }, "property": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":44,"end":45,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" }, "computed": false diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/super/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/super/output.json index 75716a4009..6952e399c1 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/super/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/super/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "Fails" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"Fails"}, "name": "Fails" }, "superClass": { "type": "ClassExpression", - "start": 20, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":20,"end":35,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":35}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":26,"end":35,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":35}}, "body": [ { "type": "ClassMethod", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33}}, "static": false, "key": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "c" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"c"}, "name": "c" }, "computed": false, @@ -131,18 +41,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "body": [], "directives": [] } @@ -152,110 +51,31 @@ }, "body": { "type": "ClassBody", - "start": 36, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":36,"end":56,"loc":{"start":{"line":1,"column":36},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 40, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":40,"end":54,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": false, "key": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "c" - }, + "start":40,"end":41,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"c"}, "name": "c" }, "computed": false, "value": { "type": "CallExpression", - "start": 44, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":44,"end":53,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":15}}, "callee": { "type": "MemberExpression", - "start": 44, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":44,"end":51,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":13}}, "object": { "type": "Super", - "start": 44, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 11 - } - } + "start":44,"end":49,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":11}} }, "property": { "type": "Identifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "c" - }, + "start":50,"end":51,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"c"}, "name": "c" }, "computed": false diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/output.json index 8f99924c16..c50fc16839 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-class-property-in-generator/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 100, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":100,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ "SyntaxError: Unexpected reserved word 'yield' (4:8)" ], "program": { "type": "Program", - "start": 0, - "end": 100, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":100,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 100, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":100,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -68,145 +23,43 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 100, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":16,"end":100,"loc":{"start":{"line":1,"column":16},"end":{"line":6,"column":1}}, "body": [ { "type": "ClassDeclaration", - "start": 20, - "end": 98, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":20,"end":98,"loc":{"start":{"line":2,"column":2},"end":{"line":5,"column":3}}, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "C" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 28, - "end": 98, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":28,"end":98,"loc":{"start":{"line":2,"column":10},"end":{"line":5,"column":3}}, "body": [ { "type": "ClassProperty", - "start": 79, - "end": 94, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 19 - } - }, + "start":79,"end":94,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":19}}, "static": false, "key": { "type": "Identifier", - "start": 79, - "end": 80, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "p" - }, + "start":79,"end":80,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":5},"identifierName":"p"}, "name": "p" }, "computed": false, "value": { "type": "BinaryExpression", - "start": 83, - "end": 93, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":83,"end":93,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":18}}, "left": { "type": "Identifier", - "start": 83, - "end": 88, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 13 - }, - "identifierName": "yield" - }, + "start":83,"end":88,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":13},"identifierName":"yield"}, "name": "yield" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 91, - "end": 93, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":91,"end":93,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":18}}, "extra": { "rawValue": 42, "raw": "42" @@ -218,18 +71,7 @@ { "type": "CommentLine", "value": " here yield is an identifier reference", - "start": 34, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 44 - } - } + "start":34,"end":74,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} } ] } @@ -247,18 +89,7 @@ { "type": "CommentLine", "value": " here yield is an identifier reference", - "start": 34, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 44 - } - } + "start":34,"end":74,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":44}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-generator-in-class-property/output.json b/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-generator-in-class-property/output.json index d0896adfc4..004925a924 100644 --- a/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-generator-in-class-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/class-properties/yield-in-generator-in-class-property/output.json @@ -1,206 +1,61 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":46,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":12,"end":44,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":34}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "p" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"p"}, "name": "p" }, "computed": false, "value": { "type": "FunctionExpression", - "start": 16, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":16,"end":43,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":33}}, "id": null, "generator": true, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 29, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":29,"end":43,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":33}}, "body": [ { "type": "ExpressionStatement", - "start": 31, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":31,"end":41,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":31}}, "expression": { "type": "YieldExpression", - "start": 31, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":31,"end":41,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":31}}, "delegate": false, "argument": { "type": "UnaryExpression", - "start": 37, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":37,"end":41,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":31}}, "operator": "+", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":39,"end":41,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":31}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/class-decorator-call-expr/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/class-decorator-call-expr/output.json index 73a9e36039..d1e510436a 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/class-decorator-call-expr/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/class-decorator-call-expr/output.json @@ -1,109 +1,31 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "decorators": [ { "type": "Decorator", - "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}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, "callee": { "type": "Identifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "foo" - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"foo"}, "name": "foo" }, "arguments": [ { "type": "StringLiteral", - "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}}, "extra": { "rawValue": "bar", "raw": "'bar'" @@ -116,36 +38,13 @@ ], "id": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "Foo" - }, + "start":18,"end":21,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":12}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/class-decorator/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/class-decorator/output.json index 2f219a4993..1977b5cbd4 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/class-decorator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/class-decorator/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "decorators": [ { "type": "Decorator", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "Identifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "abc" - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"abc"}, "name": "abc" } } ], "id": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "Foo" - }, + "start":11,"end":14,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":15,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":4,"column":1}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/class-expression/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/class-expression/output.json index a3f0718a28..66302d642b 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/class-expression/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/class-expression/output.json @@ -1,205 +1,58 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":4,"end":58,"loc":{"start":{"line":1,"column":4},"end":{"line":6,"column":1}}, "id": { "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" }, "init": { "type": "ClassExpression", - "start": 10, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":10,"end":58,"loc":{"start":{"line":1,"column":10},"end":{"line":6,"column":1}}, "decorators": [ { "type": "Decorator", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "expression": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "dec" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"dec"}, "name": "dec" } } ], "id": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "Bar" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"Bar"}, "name": "Bar" }, "superClass": null, "body": { "type": "ClassBody", - "start": 25, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":25,"end":58,"loc":{"start":{"line":1,"column":25},"end":{"line":6,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 29, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":29,"end":56,"loc":{"start":{"line":2,"column":2},"end":{"line":5,"column":3}}, "decorators": [ { "type": "Decorator", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":29,"end":33,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "baz" - }, + "start":30,"end":33,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"baz"}, "name": "baz" } } @@ -207,19 +60,7 @@ "static": false, "key": { "type": "Identifier", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "bam" - }, + "start":36,"end":39,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5},"identifierName":"bam"}, "name": "bam" }, "computed": false, @@ -230,62 +71,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 42, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":42,"end":56,"loc":{"start":{"line":3,"column":8},"end":{"line":5,"column":3}}, "body": [ { "type": "ExpressionStatement", - "start": 48, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 8 - } - }, + "start":48,"end":52,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":8}}, "expression": { "type": "CallExpression", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":48,"end":51,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":7}}, "callee": { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "f" - }, + "start":48,"end":49,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":5},"identifierName":"f"}, "name": "f" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/class-generator/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/class-generator/output.json index e1051a68e2..4da6a42718 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/class-generator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/class-generator/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":25,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":12,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "dec" - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"dec"}, "name": "dec" } } @@ -128,19 +38,7 @@ "kind": "method", "key": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "m" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"m"}, "name": "m" }, "computed": false, @@ -150,18 +48,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":21,"end":23,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/class-property/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/class-property/output.json index 81617ba6f1..d3973e7ce7 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/class-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/class-property/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":27,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":12,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":12,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "dec" - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"dec"}, "name": "dec" } } @@ -127,36 +37,13 @@ "static": false, "key": { "type": "Identifier", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "name" - }, + "start":17,"end":21,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":11},"identifierName":"name"}, "name": "name" }, "computed": false, "value": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/complex-expr/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/complex-expr/output.json index d70b2148db..c69d5147ce 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/complex-expr/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/complex-expr/output.json @@ -1,236 +1,66 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":36,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":12,"end":34,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":7}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "expression": { "type": "CallExpression", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":13,"end":26,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":16}}, "callee": { "type": "MemberExpression", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":13,"end":20,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":10}}, "object": { "type": "MemberExpression", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":13,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":8}}, "object": { "type": "MemberExpression", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6}}, "object": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "b" - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"b"}, "name": "b" }, "computed": false }, "property": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "c" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"c"}, "name": "c" }, "computed": false }, "property": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "d" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"d"}, "name": "d" }, "computed": false @@ -238,36 +68,12 @@ "arguments": [ { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "e" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"e"}, "name": "e" }, { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "f" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"f"}, "name": "f" } ] @@ -277,19 +83,7 @@ "static": false, "key": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "m" - }, + "start":29,"end":30,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"m"}, "name": "m" }, "computed": false, @@ -300,18 +94,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":32,"end":34,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":7}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/compued-property/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/compued-property/output.json index 5f87a8eafa..19e3e441be 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/compued-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/compued-property/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":10,"end":42,"loc":{"start":{"line":1,"column":10},"end":{"line":6,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "decorators": [ { "type": "Decorator", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":14,"end":18,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "bar" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"bar"}, "name": "bar" } } @@ -128,53 +38,18 @@ "computed": true, "key": { "type": "Identifier", - "start": 20, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "bizz" - }, + "start":20,"end":24,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":12},"identifierName":"bizz"}, "name": "bizz" }, "value": null }, { "type": "ClassMethod", - "start": 28, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":28,"end":40,"loc":{"start":{"line":3,"column":2},"end":{"line":5,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "abc" - }, + "start":28,"end":31,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5},"identifierName":"abc"}, "name": "abc" }, "computed": false, @@ -185,18 +60,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 34, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":34,"end":40,"loc":{"start":{"line":3,"column":8},"end":{"line":5,"column":3}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-with-parens/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-with-parens/output.json index c50380d9a5..65327624c0 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-with-parens/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-with-parens/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "declaration": { "type": "ClassExpression", - "start": 16, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":16,"end":39,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":39}}, "decorators": [ { "type": "Decorator", - "start": 16, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":16,"end":26,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":26}}, "expression": { "type": "Identifier", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "decorator" - }, + "start":17,"end":26,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":26},"identifierName":"decorator"}, "name": "decorator" } } ], "id": { "type": "Identifier", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "Foo" - }, + "start":33,"end":36,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":36},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":37,"end":39,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":39}}, "body": [] }, "extra": { diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/output.json index 2ac3ce6a59..083fa746f9 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default-decorated-expression-without-parens/output.json @@ -1,131 +1,41 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Decorators must be placed *before* the 'export' keyword. You can set the 'decoratorsBeforeExport' option to false to use the 'export @decorator class {}' syntax (1:15)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "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}}, "declaration": { "type": "ClassDeclaration", - "start": 15, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":15,"end":38,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":38}}, "decorators": [ { "type": "Decorator", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":15,"end":25,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":25}}, "expression": { "type": "Identifier", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "decorator" - }, + "start":16,"end":25,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":25},"identifierName":"decorator"}, "name": "decorator" } } ], "id": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "Foo" - }, + "start":32,"end":35,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":35},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default/output.json index ce1316960a..3213ec7e4c 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export-default/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 11, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":11,"end":38,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}}, "declaration": { "type": "ClassDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "decorators": [ { "type": "Decorator", - "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}}, "expression": { "type": "Identifier", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "decorator" - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10},"identifierName":"decorator"}, "name": "decorator" } } ], "id": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "Foo" - }, + "start":32,"end":35,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":24},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":36,"end":38,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":27}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export/output.json index 367972bf31..251c4ce6ba 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/decoratorsBeforeExport-export/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 11, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":11,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "specifiers": [], "source": null, "declaration": { "type": "ClassDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "decorators": [ { "type": "Decorator", - "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}}, "expression": { "type": "Identifier", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "decorator" - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10},"identifierName":"decorator"}, "name": "decorator" } } ], "id": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "Foo" - }, + "start":24,"end":27,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":28,"end":30,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":19}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/export-decorated-class/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/export-decorated-class/output.json index 930ce09662..77b3d90da3 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/export-decorated-class/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/export-decorated-class/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [], "source": null, "declaration": { "type": "ClassDeclaration", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":25}}, "decorators": [ { "type": "Decorator", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "expression": { "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" } } ], "id": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "Foo" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/export-default-decorated-class/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/export-default-decorated-class/output.json index c2bd0ff3a8..5e0b3cd9fc 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/export-default-decorated-class/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/export-default-decorated-class/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "declaration": { "type": "ClassDeclaration", - "start": 16, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":16,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "decorators": [ { "type": "Decorator", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":16,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":4}}, "expression": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "bar" - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":4},"identifierName":"bar"}, "name": "bar" } } ], "id": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "Foo" - }, + "start":27,"end":30,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":31,"end":34,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/get-decorator/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/get-decorator/output.json index a7eeacec59..30fd19b647 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/get-decorator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/get-decorator/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":33,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":12,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":12,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"foo"}, "name": "foo" } } @@ -127,19 +37,7 @@ "static": false, "key": { "type": "Identifier", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "getter" - }, + "start":21,"end":27,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":17},"identifierName":"getter"}, "name": "getter" }, "computed": false, @@ -150,18 +48,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-class-decorator-parameters/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-class-decorator-parameters/output.json index 69484e0799..c7d7224e91 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-class-decorator-parameters/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-class-decorator-parameters/output.json @@ -1,224 +1,66 @@ { "type": "File", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "decorators": [ { "type": "Decorator", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":1,"end":40,"loc":{"start":{"line":1,"column":1},"end":{"line":3,"column":2}}, "callee": { "type": "Identifier", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "outer" - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6},"identifierName":"outer"}, "name": "outer" }, "arguments": [ { "type": "ObjectExpression", - "start": 7, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":7,"end":39,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, "properties": [ { "type": "ObjectProperty", - "start": 11, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":11,"end":37,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":28}}, "method": false, "key": { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "store" - }, + "start":11,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7},"identifierName":"store"}, "name": "store" }, "computed": false, "shorthand": false, "value": { "type": "ClassExpression", - "start": 18, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":18,"end":37,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":28}}, "decorators": [ { "type": "Decorator", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":18,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}}, "expression": { "type": "Identifier", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "inner" - }, + "start":19,"end":24,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":15},"identifierName":"inner"}, "name": "inner" } } ], "id": { "type": "Identifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "Foo" - }, + "start":31,"end":34,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":35,"end":37,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":28}}, "body": [] } } @@ -231,36 +73,13 @@ ], "id": { "type": "Identifier", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 9 - }, - "identifierName": "Bar" - }, + "start":47,"end":50,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":9},"identifierName":"Bar"}, "name": "Bar" }, "superClass": null, "body": { "type": "ClassBody", - "start": 51, - "end": 57, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":51,"end":57,"loc":{"start":{"line":4,"column":10},"end":{"line":6,"column":1}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-class-decorator/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-class-decorator/output.json index eefec5ddd7..2987e25cf7 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-class-decorator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-class-decorator/output.json @@ -1,192 +1,57 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "decorators": [ { "type": "Decorator", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "expression": { "type": "ObjectExpression", - "start": 2, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":2,"end":34,"loc":{"start":{"line":1,"column":2},"end":{"line":3,"column":1}}, "properties": [ { "type": "ObjectProperty", - "start": 6, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":6,"end":32,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":28}}, "method": false, "key": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "store" - }, + "start":6,"end":11,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7},"identifierName":"store"}, "name": "store" }, "computed": false, "shorthand": false, "value": { "type": "ClassExpression", - "start": 13, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":13,"end":32,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":28}}, "decorators": [ { "type": "Decorator", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":13,"end":19,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}}, "expression": { "type": "Identifier", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "inner" - }, + "start":14,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":15},"identifierName":"inner"}, "name": "inner" } } ], "id": { "type": "Identifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "Foo" - }, + "start":26,"end":29,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":30,"end":32,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":28}}, "body": [] } } @@ -197,36 +62,13 @@ ], "id": { "type": "Identifier", - "start": 42, - "end": 45, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 9 - }, - "identifierName": "Bar" - }, + "start":42,"end":45,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":9},"identifierName":"Bar"}, "name": "Bar" }, "superClass": null, "body": { "type": "ClassBody", - "start": 46, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":46,"end":52,"loc":{"start":{"line":4,"column":10},"end":{"line":6,"column":1}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-method-decorator-parameters/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-method-decorator-parameters/output.json index 9c14f3d08b..30f31ef335 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-method-decorator-parameters/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-method-decorator-parameters/output.json @@ -1,186 +1,51 @@ { "type": "File", - "start": 0, - "end": 112, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":112,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 112, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":112,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 112, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":112,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "Bar" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"Bar"}, "name": "Bar" }, "superClass": null, "body": { "type": "ClassBody", - "start": 9, - "end": 112, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":9,"end":112,"loc":{"start":{"line":1,"column":9},"end":{"line":9,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 13, - "end": 110, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 8, - "column": 18 - } - }, + "start":13,"end":110,"loc":{"start":{"line":2,"column":2},"end":{"line":8,"column":18}}, "decorators": [ { "type": "Decorator", - "start": 13, - "end": 91, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":13,"end":91,"loc":{"start":{"line":2,"column":2},"end":{"line":7,"column":3}}, "expression": { "type": "CallExpression", - "start": 14, - "end": 91, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":14,"end":91,"loc":{"start":{"line":2,"column":3},"end":{"line":7,"column":3}}, "callee": { "type": "Identifier", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "outer" - }, + "start":14,"end":19,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":8},"identifierName":"outer"}, "name": "outer" }, "arguments": [ { "type": "ClassExpression", - "start": 25, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 6, - "column": 5 - } - }, + "start":25,"end":87,"loc":{"start":{"line":3,"column":4},"end":{"line":6,"column":5}}, "decorators": [ { "type": "Decorator", - "start": 25, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":25,"end":34,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13}}, "expression": { "type": "Identifier", - "start": 26, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "classDec" - }, + "start":26,"end":34,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":13},"identifierName":"classDec"}, "name": "classDec" } } @@ -189,63 +54,18 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 41, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 6, - "column": 5 - } - }, + "start":41,"end":87,"loc":{"start":{"line":3,"column":20},"end":{"line":6,"column":5}}, "body": [ { "type": "ClassMethod", - "start": 50, - "end": 80, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 5, - "column": 22 - } - }, + "start":50,"end":80,"loc":{"start":{"line":4,"column":6},"end":{"line":5,"column":22}}, "decorators": [ { "type": "Decorator", - "start": 50, - "end": 56, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 12 - } - }, + "start":50,"end":56,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":12}}, "expression": { "type": "Identifier", - "start": 51, - "end": 56, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 12 - }, - "identifierName": "inner" - }, + "start":51,"end":56,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":12},"identifierName":"inner"}, "name": "inner" } } @@ -253,19 +73,7 @@ "static": false, "key": { "type": "Identifier", - "start": 64, - "end": 75, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 17 - }, - "identifierName": "innerMethod" - }, + "start":64,"end":75,"loc":{"start":{"line":5,"column":6},"end":{"line":5,"column":17},"identifierName":"innerMethod"}, "name": "innerMethod" }, "computed": false, @@ -276,18 +84,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 78, - "end": 80, - "loc": { - "start": { - "line": 5, - "column": 20 - }, - "end": { - "line": 5, - "column": 22 - } - }, + "start":78,"end":80,"loc":{"start":{"line":5,"column":20},"end":{"line":5,"column":22}}, "body": [], "directives": [] } @@ -302,19 +99,7 @@ "static": false, "key": { "type": "Identifier", - "start": 94, - "end": 105, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 13 - }, - "identifierName": "outerMethod" - }, + "start":94,"end":105,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":13},"identifierName":"outerMethod"}, "name": "outerMethod" }, "computed": false, @@ -325,18 +110,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 108, - "end": 110, - "loc": { - "start": { - "line": 8, - "column": 16 - }, - "end": { - "line": 8, - "column": 18 - } - }, + "start":108,"end":110,"loc":{"start":{"line":8,"column":16},"end":{"line":8,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-method-decorator/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-method-decorator/output.json index 1499a3ede5..893a938ea5 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-method-decorator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/nested-method-decorator/output.json @@ -1,154 +1,42 @@ { "type": "File", - "start": 0, - "end": 107, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":107,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 107, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":107,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 107, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":0,"end":107,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "Bar" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"Bar"}, "name": "Bar" }, "superClass": null, "body": { "type": "ClassBody", - "start": 9, - "end": 107, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":9,"end":107,"loc":{"start":{"line":1,"column":9},"end":{"line":9,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 13, - "end": 105, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 8, - "column": 18 - } - }, + "start":13,"end":105,"loc":{"start":{"line":2,"column":2},"end":{"line":8,"column":18}}, "decorators": [ { "type": "Decorator", - "start": 13, - "end": 86, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":13,"end":86,"loc":{"start":{"line":2,"column":2},"end":{"line":7,"column":3}}, "expression": { "type": "ClassExpression", - "start": 20, - "end": 82, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 6, - "column": 5 - } - }, + "start":20,"end":82,"loc":{"start":{"line":3,"column":4},"end":{"line":6,"column":5}}, "decorators": [ { "type": "Decorator", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":20,"end":29,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13}}, "expression": { "type": "Identifier", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "classDec" - }, + "start":21,"end":29,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":13},"identifierName":"classDec"}, "name": "classDec" } } @@ -157,63 +45,18 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 36, - "end": 82, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 6, - "column": 5 - } - }, + "start":36,"end":82,"loc":{"start":{"line":3,"column":20},"end":{"line":6,"column":5}}, "body": [ { "type": "ClassMethod", - "start": 45, - "end": 75, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 5, - "column": 22 - } - }, + "start":45,"end":75,"loc":{"start":{"line":4,"column":6},"end":{"line":5,"column":22}}, "decorators": [ { "type": "Decorator", - "start": 45, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 12 - } - }, + "start":45,"end":51,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":12}}, "expression": { "type": "Identifier", - "start": 46, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 12 - }, - "identifierName": "inner" - }, + "start":46,"end":51,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":12},"identifierName":"inner"}, "name": "inner" } } @@ -221,19 +64,7 @@ "static": false, "key": { "type": "Identifier", - "start": 59, - "end": 70, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 17 - }, - "identifierName": "innerMethod" - }, + "start":59,"end":70,"loc":{"start":{"line":5,"column":6},"end":{"line":5,"column":17},"identifierName":"innerMethod"}, "name": "innerMethod" }, "computed": false, @@ -244,18 +75,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 73, - "end": 75, - "loc": { - "start": { - "line": 5, - "column": 20 - }, - "end": { - "line": 5, - "column": 22 - } - }, + "start":73,"end":75,"loc":{"start":{"line":5,"column":20},"end":{"line":5,"column":22}}, "body": [], "directives": [] } @@ -268,19 +88,7 @@ "static": false, "key": { "type": "Identifier", - "start": 89, - "end": 100, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 13 - }, - "identifierName": "outerMethod" - }, + "start":89,"end":100,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":13},"identifierName":"outerMethod"}, "name": "outerMethod" }, "computed": false, @@ -291,18 +99,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 103, - "end": 105, - "loc": { - "start": { - "line": 8, - "column": 16 - }, - "end": { - "line": 8, - "column": 18 - } - }, + "start":103,"end":105,"loc":{"start":{"line":8,"column":16},"end":{"line":8,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/output.json index 9ae808cfd6..fd172b86c4 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-class-method-parameter/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Decorators cannot be used to decorate parameters (2:14)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":38,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":14,"end":36,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":24}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -119,50 +40,15 @@ "params": [ { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "x" - }, + "start":31,"end":32,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20},"identifierName":"x"}, "name": "x", "decorators": [ { "type": "Decorator", - "start": 26, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":26,"end":30,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":18}}, "expression": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "foo" - }, + "start":27,"end":30,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" } } @@ -171,18 +57,7 @@ ], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":34,"end":36,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":24}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json index 084e745706..d1b72ec991 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-constructor-decorators/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Decorators can't be used with a constructor. Did you mean '@dec class { ... }'? (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":10,"end":38,"loc":{"start":{"line":1,"column":10},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":14,"end":36,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":17}}, "decorators": [ { "type": "Decorator", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":14,"end":18,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "abc" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"abc"}, "name": "abc" } } @@ -130,19 +40,7 @@ "static": false, "key": { "type": "Identifier", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":21,"end":32,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -153,18 +51,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":34,"end":36,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":17}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/output.json index 733e482e12..5ede51a719 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-export-decorators-on-class/output.json @@ -1,95 +1,28 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":23}}, "errors": [ "SyntaxError: Using the export keyword between a decorator and a class is not allowed. Please use `export @dec class` instead. (2:0)" ], "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 5, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":5,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}}, "declaration": { "type": "ClassDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":23}}, "decorators": [ { "type": "Decorator", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "Identifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "foo" - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"foo"}, "name": "foo" } } @@ -98,18 +31,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":26,"end":28,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":23}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/output.json index 8443e39b2b..47d78bbffa 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-function-parameters/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: Decorators cannot be used to decorate parameters (1:14)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "func" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"func"}, "name": "func" }, "generator": false, @@ -68,50 +23,15 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "x" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"x"}, "name": "x", "decorators": [ { "type": "Decorator", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}}, "expression": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" } } @@ -120,18 +40,7 @@ ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/output.json index 0628ebff2b..ab145b8510 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-method-parameters/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ "SyntaxError: Decorators cannot be used to decorate parameters (2:9)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":4,"end":33,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "obj" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"obj"}, "name": "obj" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":33,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 14, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":14,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "method": true, "key": { "type": "Identifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "method" - }, + "start":14,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8},"identifierName":"method"}, "name": "method" }, "computed": false, @@ -133,50 +43,15 @@ "params": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x", "decorators": [ { "type": "Decorator", - "start": 21, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":21,"end":25,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":13}}, "expression": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13},"identifierName":"foo"}, "name": "foo" } } @@ -185,18 +60,7 @@ ], "body": { "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/output.json index 07e0fd653a..1268657c20 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/no-object-methods/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: Decorators cannot be used to decorate object literal properties (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":4,"end":32,"loc":{"start":{"line":1,"column":4},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "o" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"o"}, "name": "o" }, "init": { "type": "ObjectExpression", - "start": 8, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":8,"end":32,"loc":{"start":{"line":1,"column":8},"end":{"line":5,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 19, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":19,"end":30,"loc":{"start":{"line":3,"column":2},"end":{"line":4,"column":3}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":12,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "baz" - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"baz"}, "name": "baz" } } @@ -144,19 +43,7 @@ "method": true, "key": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "foo" - }, + "start":19,"end":22,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -167,18 +54,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":25,"end":30,"loc":{"start":{"line":3,"column":8},"end":{"line":4,"column":3}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/on-computed-name-method/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/on-computed-name-method/output.json index 2757a35b01..cc7ff9f301 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/on-computed-name-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/on-computed-name-method/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":33,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":12,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":14}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":12,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "dec" - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"dec"}, "name": "dec" } } @@ -128,18 +38,7 @@ "computed": true, "key": { "type": "StringLiteral", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":20,"end":26,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":9}}, "extra": { "rawValue": "name", "raw": "'name'" @@ -153,18 +52,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":29,"end":31,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":14}}, "body": [], "directives": [] } 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 fa5fdd6bf2..ba7832ad27 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 @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":91,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":91,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":91,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "decorators": [ { "type": "Decorator", - "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}}, "expression": { "type": "MemberExpression", - "start": 2, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":2,"end":11,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":11}}, "object": { "type": "CallExpression", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "callee": { "type": "Identifier", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "foo" - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5},"identifierName":"foo"}, "name": "foo" }, "arguments": [] }, "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 @@ -128,112 +38,32 @@ ], "id": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "Foo" - }, + "start":19,"end":22,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 23, - "end": 91, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":23,"end":91,"loc":{"start":{"line":2,"column":10},"end":{"line":6,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 27, - "end": 60, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":27,"end":60,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":35}}, "decorators": [ { "type": "Decorator", - "start": 27, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":27,"end":48,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":23}}, "expression": { "type": "MemberExpression", - "start": 29, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":29,"end":47,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":22}}, "object": { "type": "Identifier", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "member" - }, + "start":29,"end":35,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":10},"identifierName":"member"}, "name": "member" }, "property": { "type": "Identifier", - "start": 36, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 21 - }, - "identifierName": "expression" - }, + "start":36,"end":46,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":21},"identifierName":"expression"}, "name": "expression" }, "computed": true @@ -243,19 +73,7 @@ "static": false, "key": { "type": "Identifier", - "start": 49, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 30 - }, - "identifierName": "method" - }, + "start":49,"end":55,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":30},"identifierName":"method"}, "name": "method" }, "computed": false, @@ -266,98 +84,30 @@ "params": [], "body": { "type": "BlockStatement", - "start": 58, - "end": 60, - "loc": { - "start": { - "line": 3, - "column": 33 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":58,"end":60,"loc":{"start":{"line":3,"column":33},"end":{"line":3,"column":35}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 64, - "end": 89, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 27 - } - }, + "start":64,"end":89,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":27}}, "decorators": [ { "type": "Decorator", - "start": 64, - "end": 76, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 14 - } - }, + "start":64,"end":76,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":14}}, "expression": { "type": "BinaryExpression", - "start": 66, - "end": 75, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":66,"end":75,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":13}}, "left": { "type": "Identifier", - "start": 66, - "end": 69, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 7 - }, - "identifierName": "foo" - }, + "start":66,"end":69,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":7},"identifierName":"foo"}, "name": "foo" }, "operator": "+", "right": { "type": "Identifier", - "start": 72, - "end": 75, - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 13 - }, - "identifierName": "bar" - }, + "start":72,"end":75,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":13},"identifierName":"bar"}, "name": "bar" } } @@ -366,19 +116,7 @@ "static": false, "key": { "type": "Identifier", - "start": 77, - "end": 84, - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 22 - }, - "identifierName": "method2" - }, + "start":77,"end":84,"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":22},"identifierName":"method2"}, "name": "method2" }, "computed": false, @@ -389,18 +127,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 87, - "end": 89, - "loc": { - "start": { - "line": 5, - "column": 25 - }, - "end": { - "line": 5, - "column": 27 - } - }, + "start":87,"end":89,"loc":{"start":{"line":5,"column":25},"end":{"line":5,"column":27}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/private-property/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/private-property/output.json index cc4e05e150..5ffd412908 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/private-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/private-property/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":28,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":12,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "dec" - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"dec"}, "name": "dec" } } @@ -127,50 +37,16 @@ "static": false, "key": { "type": "PrivateName", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":17,"end":22,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":12}}, "id": { "type": "Identifier", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "name" - }, + "start":18,"end":22,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":12},"identifierName":"name"}, "name": "name" } }, "value": { "type": "NumericLiteral", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/set-decorator/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/set-decorator/output.json index 573d999a9e..73939907ca 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/set-decorator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/set-decorator/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":37,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":12,"end":35,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":25}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":12,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"foo"}, "name": "foo" } } @@ -127,19 +37,7 @@ "static": false, "key": { "type": "Identifier", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "setter" - }, + "start":21,"end":27,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":17},"identifierName":"setter"}, "name": "setter" }, "computed": false, @@ -150,36 +48,13 @@ "params": [ { "type": "Identifier", - "start": 28, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "_val" - }, + "start":28,"end":32,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":22},"identifierName":"_val"}, "name": "_val" } ], "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":33,"end":35,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/static-method/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/static-method/output.json index ecda9741a8..5d13b2af9c 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/static-method/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/static-method/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":10,"end":38,"loc":{"start":{"line":1,"column":10},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":14,"end":36,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":17}}, "decorators": [ { "type": "Decorator", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":14,"end":18,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "dec" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"dec"}, "name": "dec" } } @@ -127,19 +37,7 @@ "static": true, "key": { "type": "Identifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 12 - }, - "identifierName": "bar" - }, + "start":28,"end":31,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":12},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -150,18 +48,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":34,"end":36,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":17}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators-2/static-property/output.json b/packages/babel-parser/test/fixtures/experimental/decorators-2/static-property/output.json index bb0fc456e6..eb62fec97a 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators-2/static-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators-2/static-property/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":34,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":12,"end":32,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":22}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":12,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "dec" - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"dec"}, "name": "dec" } } @@ -127,36 +37,13 @@ "static": true, "key": { "type": "Identifier", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "name" - }, + "start":24,"end":28,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":18},"identifierName":"name"}, "name": "name" }, "computed": false, "value": { "type": "NumericLiteral", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":31,"end":32,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-assignment/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-assignment/output.json index 1da946b580..aa7f5f5cb0 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-assignment/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-assignment/output.json @@ -1,160 +1,47 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}}, "id": { "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" }, "init": { "type": "ClassExpression", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":27}}, "decorators": [ { "type": "Decorator", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "expression": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"foo"}, "name": "foo" } } ], "id": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "Foo" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-call-expr/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-call-expr/output.json index 73a9e36039..d1e510436a 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-call-expr/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-call-expr/output.json @@ -1,109 +1,31 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "decorators": [ { "type": "Decorator", - "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}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, "callee": { "type": "Identifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "foo" - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"foo"}, "name": "foo" }, "arguments": [ { "type": "StringLiteral", - "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}}, "extra": { "rawValue": "bar", "raw": "'bar'" @@ -116,36 +38,13 @@ ], "id": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "Foo" - }, + "start":18,"end":21,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":12}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-getter/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-getter/output.json index 13de96b505..61665a28af 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-getter/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-getter/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":10,"end":31,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":31}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":12,"end":29,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":29}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" } } @@ -127,19 +37,7 @@ "static": false, "key": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "bar" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -150,18 +48,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-same-line/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-same-line/output.json index 1ad3eafe69..bb6ddaacfe 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-same-line/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-same-line/output.json @@ -1,114 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "decorators": [ { "type": "Decorator", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "Identifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "foo" - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"foo"}, "name": "foo" } } ], "id": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "Foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "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}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-setter/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-setter/output.json index 03f0153ce8..ed17f6e590 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-setter/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator-setter/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":10,"end":32,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":32}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":12,"end":30,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":30}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" } } @@ -127,19 +37,7 @@ "static": false, "key": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "bar" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -150,36 +48,13 @@ "params": [ { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "f" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"f"}, "name": "f" } ], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator/output.json index 2f219a4993..1977b5cbd4 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/class-decorator/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "decorators": [ { "type": "Decorator", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "Identifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "abc" - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"abc"}, "name": "abc" } } ], "id": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "Foo" - }, + "start":11,"end":14,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":15,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":4,"column":1}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/class-decorators-multiple/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/class-decorators-multiple/output.json index 8e9991ea81..d2668cf74d 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/class-decorators-multiple/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/class-decorators-multiple/output.json @@ -1,157 +1,44 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":10,"end":32,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":32}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":12,"end":30,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":30}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" } }, { "type": "Decorator", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21}}, "expression": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "bar" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"bar"}, "name": "bar" } } @@ -159,19 +46,7 @@ "static": false, "key": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "bar" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -182,18 +57,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/class-method-parameter/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/class-method-parameter/output.json index da595a9e8f..05facf06c5 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/class-method-parameter/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/class-method-parameter/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":67,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":67,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":67,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":67,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 53 - } - }, + "start":14,"end":65,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":53}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -116,64 +37,18 @@ "params": [ { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "x" - }, + "start":33,"end":34,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22},"identifierName":"x"}, "name": "x", "decorators": [ { "type": "Decorator", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":26,"end":32,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":20}}, "expression": { "type": "CallExpression", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":27,"end":32,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":20}}, "callee": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "foo" - }, + "start":27,"end":30,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -183,130 +58,39 @@ }, { "type": "Identifier", - "start": 60, - "end": 61, - "loc": { - "start": { - "line": 2, - "column": 48 - }, - "end": { - "line": 2, - "column": 49 - }, - "identifierName": "y" - }, + "start":60,"end":61,"loc":{"start":{"line":2,"column":48},"end":{"line":2,"column":49},"identifierName":"y"}, "name": "y", "decorators": [ { "type": "Decorator", - "start": 36, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":36,"end":52,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":40}}, "expression": { "type": "CallExpression", - "start": 37, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":37,"end":52,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":40}}, "callee": { "type": "Identifier", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 28 - }, - "identifierName": "bar" - }, + "start":37,"end":40,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":28},"identifierName":"bar"}, "name": "bar" }, "arguments": [ { "type": "ObjectExpression", - "start": 41, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 39 - } - }, + "start":41,"end":51,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":39}}, "properties": [ { "type": "ObjectProperty", - "start": 43, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 31 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":43,"end":49,"loc":{"start":{"line":2,"column":31},"end":{"line":2,"column":37}}, "method": false, "key": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 31 - }, - "end": { - "line": 2, - "column": 32 - }, - "identifierName": "a" - }, + "start":43,"end":44,"loc":{"start":{"line":2,"column":31},"end":{"line":2,"column":32},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 34 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":46,"end":49,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":37}}, "extra": { "rawValue": 123, "raw": "123" @@ -321,47 +105,13 @@ }, { "type": "Decorator", - "start": 53, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 41 - }, - "end": { - "line": 2, - "column": 47 - } - }, + "start":53,"end":59,"loc":{"start":{"line":2,"column":41},"end":{"line":2,"column":47}}, "expression": { "type": "CallExpression", - "start": 54, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 42 - }, - "end": { - "line": 2, - "column": 47 - } - }, + "start":54,"end":59,"loc":{"start":{"line":2,"column":42},"end":{"line":2,"column":47}}, "callee": { "type": "Identifier", - "start": 54, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 42 - }, - "end": { - "line": 2, - "column": 45 - }, - "identifierName": "baz" - }, + "start":54,"end":57,"loc":{"start":{"line":2,"column":42},"end":{"line":2,"column":45},"identifierName":"baz"}, "name": "baz" }, "arguments": [] @@ -372,18 +122,7 @@ ], "body": { "type": "BlockStatement", - "start": 63, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 51 - }, - "end": { - "line": 2, - "column": 53 - } - }, + "start":63,"end":65,"loc":{"start":{"line":2,"column":51},"end":{"line":2,"column":53}}, "body": [], "directives": [] } 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 5432f965ce..153a2fef0a 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 @@ -1,156 +1,43 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":32,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 14, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":14,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, "decorators": [ { "type": "Decorator", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":14,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}}, "expression": { "type": "MemberExpression", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":15,"end":23,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":11}}, "object": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"foo"}, "name": "foo" }, "property": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "bar" - }, + "start":19,"end":22,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":10},"identifierName":"bar"}, "name": "bar" }, "computed": true @@ -160,36 +47,13 @@ "static": false, "key": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "a" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"a"}, "name": "a" }, "computed": false, "value": { "type": "NumericLiteral", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17}}, "extra": { "rawValue": 1, "raw": "1" 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 a9cbc8c8e7..3d9bf0eb29 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 @@ -1,156 +1,43 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":10,"end":41,"loc":{"start":{"line":1,"column":10},"end":{"line":6,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":14,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":5,"column":3}}, "decorators": [ { "type": "Decorator", - "start": 14, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":14,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "expression": { "type": "MemberExpression", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":15,"end":24,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":12}}, "object": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "bar" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"bar"}, "name": "bar" }, "property": { "type": "Identifier", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "bizz" - }, + "start":19,"end":23,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":11},"identifierName":"bizz"}, "name": "bizz" }, "computed": true @@ -160,19 +47,7 @@ "static": false, "key": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "abc" - }, + "start":27,"end":30,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5},"identifierName":"abc"}, "name": "abc" }, "computed": false, @@ -183,18 +58,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":33,"end":39,"loc":{"start":{"line":3,"column":8},"end":{"line":5,"column":3}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/export-decorators-on-class/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/export-decorators-on-class/output.json index 45bae118fd..ae2ee71fdf 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/export-decorators-on-class/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/export-decorators-on-class/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 5, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":5,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "specifiers": [], "source": null, "declaration": { "type": "ClassDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "decorators": [ { "type": "Decorator", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "Identifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "foo" - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"foo"}, "name": "foo" } } ], "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "A" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":20,"end":22,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":17}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/export-default-declaration-function-declaration-parameter/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/export-default-declaration-function-declaration-parameter/output.json index d0b7148af2..db5d313815 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/export-default-declaration-function-declaration-parameter/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/export-default-declaration-function-declaration-parameter/output.json @@ -1,77 +1,21 @@ { "type": "File", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 68 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":68}}, "program": { "type": "Program", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 68 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":68}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 68 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":68}}, "declaration": { "type": "FunctionDeclaration", - "start": 15, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 68 - } - }, + "start":15,"end":68,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":68}}, "id": { "type": "Identifier", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "func" - }, + "start":24,"end":28,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":28},"identifierName":"func"}, "name": "func" }, "generator": false, @@ -79,64 +23,18 @@ "params": [ { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "x" - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37},"identifierName":"x"}, "name": "x", "decorators": [ { "type": "Decorator", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":29,"end":35,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":35}}, "expression": { "type": "CallExpression", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35}}, "callee": { "type": "Identifier", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "foo" - }, + "start":30,"end":33,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":33},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -146,130 +44,39 @@ }, { "type": "Identifier", - "start": 63, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 63 - }, - "end": { - "line": 1, - "column": 64 - }, - "identifierName": "y" - }, + "start":63,"end":64,"loc":{"start":{"line":1,"column":63},"end":{"line":1,"column":64},"identifierName":"y"}, "name": "y", "decorators": [ { "type": "Decorator", - "start": 39, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":39,"end":55,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":55}}, "expression": { "type": "CallExpression", - "start": 40, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":40,"end":55,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":55}}, "callee": { "type": "Identifier", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "bar" - }, + "start":40,"end":43,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":43},"identifierName":"bar"}, "name": "bar" }, "arguments": [ { "type": "ObjectExpression", - "start": 44, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":44,"end":54,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":54}}, "properties": [ { "type": "ObjectProperty", - "start": 46, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":46,"end":52,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":52}}, "method": false, "key": { "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "a" - }, + "start":46,"end":47,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":47},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":49,"end":52,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":52}}, "extra": { "rawValue": 123, "raw": "123" @@ -284,47 +91,13 @@ }, { "type": "Decorator", - "start": 56, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 56 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":56,"end":62,"loc":{"start":{"line":1,"column":56},"end":{"line":1,"column":62}}, "expression": { "type": "CallExpression", - "start": 57, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":57,"end":62,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":62}}, "callee": { "type": "Identifier", - "start": 57, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 60 - }, - "identifierName": "baz" - }, + "start":57,"end":60,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":60},"identifierName":"baz"}, "name": "baz" }, "arguments": [] @@ -335,18 +108,7 @@ ], "body": { "type": "BlockStatement", - "start": 66, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 66 - }, - "end": { - "line": 1, - "column": 68 - } - }, + "start":66,"end":68,"loc":{"start":{"line":1,"column":66},"end":{"line":1,"column":68}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/export-default-decorators-on-class/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/export-default-decorators-on-class/output.json index 0cc967280f..258470686a 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/export-default-decorators-on-class/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/export-default-decorators-on-class/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 5, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":5,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}}, "declaration": { "type": "ClassDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":23}}, "decorators": [ { "type": "Decorator", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "Identifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "foo" - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"foo"}, "name": "foo" } } @@ -95,18 +28,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":26,"end":28,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":23}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/export-default-with-nested-class/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/export-default-with-nested-class/output.json index a63b4c84a2..ba2ceee146 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/export-default-with-nested-class/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/export-default-with-nested-class/output.json @@ -1,159 +1,46 @@ { "type": "File", - "start": 0, - "end": 109, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":109,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 109, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":109,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 17, - "end": 109, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":17,"end":109,"loc":{"start":{"line":2,"column":0},"end":{"line":7,"column":1}}, "declaration": { "type": "ClassDeclaration", - "start": 0, - "end": 109, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":109,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "decorators": [ { "type": "Decorator", - "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}}, "expression": { "type": "Identifier", - "start": 1, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "ParentDecorator" - }, + "start":1,"end":16,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":16},"identifierName":"ParentDecorator"}, "name": "ParentDecorator" } } ], "id": { "type": "Identifier", - "start": 38, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 32 - }, - "identifierName": "ParentClass" - }, + "start":38,"end":49,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":32},"identifierName":"ParentClass"}, "name": "ParentClass" }, "superClass": null, "body": { "type": "ClassBody", - "start": 50, - "end": 109, - "loc": { - "start": { - "line": 2, - "column": 33 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":50,"end":109,"loc":{"start":{"line":2,"column":33},"end":{"line":7,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 54, - "end": 107, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":54,"end":107,"loc":{"start":{"line":3,"column":2},"end":{"line":6,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 54, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "makeNestedClass" - }, + "start":54,"end":69,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":17},"identifierName":"makeNestedClass"}, "name": "makeNestedClass" }, "computed": false, @@ -164,65 +51,20 @@ "params": [], "body": { "type": "BlockStatement", - "start": 72, - "end": 107, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":72,"end":107,"loc":{"start":{"line":3,"column":20},"end":{"line":6,"column":3}}, "body": [ { "type": "ClassDeclaration", - "start": 78, - "end": 103, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":78,"end":103,"loc":{"start":{"line":4,"column":4},"end":{"line":5,"column":5}}, "id": { "type": "Identifier", - "start": 84, - "end": 95, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 21 - }, - "identifierName": "NestedClass" - }, + "start":84,"end":95,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":21},"identifierName":"NestedClass"}, "name": "NestedClass" }, "superClass": null, "body": { "type": "ClassBody", - "start": 96, - "end": 103, - "loc": { - "start": { - "line": 4, - "column": 22 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":96,"end":103,"loc":{"start":{"line":4,"column":22},"end":{"line":5,"column":5}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/function-declaration-parameter/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/function-declaration-parameter/output.json index b768e4ab0f..6f7de702a1 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/function-declaration-parameter/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/function-declaration-parameter/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "func" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"func"}, "name": "func" }, "generator": false, @@ -65,64 +20,18 @@ "params": [ { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"x"}, "name": "x", "decorators": [ { "type": "Decorator", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}}, "expression": { "type": "CallExpression", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "callee": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -132,130 +41,39 @@ }, { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 49 - }, - "identifierName": "y" - }, + "start":48,"end":49,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":49},"identifierName":"y"}, "name": "y", "decorators": [ { "type": "Decorator", - "start": 24, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":24,"end":40,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":40}}, "expression": { "type": "CallExpression", - "start": 25, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":25,"end":40,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":40}}, "callee": { "type": "Identifier", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "bar" - }, + "start":25,"end":28,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":28},"identifierName":"bar"}, "name": "bar" }, "arguments": [ { "type": "ObjectExpression", - "start": 29, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":29,"end":39,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":39}}, "properties": [ { "type": "ObjectProperty", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":31,"end":37,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":37}}, "method": false, "key": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "a" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":34,"end":37,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":37}}, "extra": { "rawValue": 123, "raw": "123" @@ -270,47 +88,13 @@ }, { "type": "Decorator", - "start": 41, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":41,"end":47,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":47}}, "expression": { "type": "CallExpression", - "start": 42, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":42,"end":47,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":47}}, "callee": { "type": "Identifier", - "start": 42, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "baz" - }, + "start":42,"end":45,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":45},"identifierName":"baz"}, "name": "baz" }, "arguments": [] @@ -321,18 +105,7 @@ ], "body": { "type": "BlockStatement", - "start": 51, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":51,"end":53,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":53}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/function-expression-parameter/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/function-expression-parameter/output.json index 8ad3ed2051..e2c8e1bf29 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/function-expression-parameter/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/function-expression-parameter/output.json @@ -1,158 +1,45 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":6,"end":62,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":62}}, "id": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "func" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"func"}, "name": "func" }, "init": { "type": "FunctionExpression", - "start": 13, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":13,"end":62,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":62}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "x" - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"x"}, "name": "x", "decorators": [ { "type": "Decorator", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":23,"end":29,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":29}}, "expression": { "type": "CallExpression", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29}}, "callee": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "foo" - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -162,130 +49,39 @@ }, { "type": "Identifier", - "start": 57, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 58 - }, - "identifierName": "y" - }, + "start":57,"end":58,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":58},"identifierName":"y"}, "name": "y", "decorators": [ { "type": "Decorator", - "start": 33, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":33,"end":49,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":49}}, "expression": { "type": "CallExpression", - "start": 34, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":34,"end":49,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":49}}, "callee": { "type": "Identifier", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "bar" - }, + "start":34,"end":37,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":37},"identifierName":"bar"}, "name": "bar" }, "arguments": [ { "type": "ObjectExpression", - "start": 38, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":38,"end":48,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":48}}, "properties": [ { "type": "ObjectProperty", - "start": 40, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":40,"end":46,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":46}}, "method": false, "key": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "a" - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":43,"end":46,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":46}}, "extra": { "rawValue": 123, "raw": "123" @@ -300,47 +96,13 @@ }, { "type": "Decorator", - "start": 50, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":50,"end":56,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":56}}, "expression": { "type": "CallExpression", - "start": 51, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":51,"end":56,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":56}}, "callee": { "type": "Identifier", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 54 - }, - "identifierName": "baz" - }, + "start":51,"end":54,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":54},"identifierName":"baz"}, "name": "baz" }, "arguments": [] @@ -351,18 +113,7 @@ ], "body": { "type": "BlockStatement", - "start": 60, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 60 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":60,"end":62,"loc":{"start":{"line":1,"column":60},"end":{"line":1,"column":62}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/method-decorator/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/method-decorator/output.json index 3a8f32412f..64a19f4a54 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/method-decorator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/method-decorator/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":27}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":12,"end":25,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":25}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" } } @@ -127,19 +37,7 @@ "static": false, "key": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "bar" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -150,18 +48,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/method-generator-decorator/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/method-generator-decorator/output.json index 8fb4c84a2e..b20f69086b 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/method-generator-decorator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/method-generator-decorator/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":10,"end":45,"loc":{"start":{"line":1,"column":10},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":14,"end":43,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":23}}, "decorators": [ { "type": "Decorator", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":14,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7}}, "expression": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "deco" - }, + "start":15,"end":19,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":7},"identifierName":"deco"}, "name": "deco" } } @@ -128,19 +38,7 @@ "kind": "method", "key": { "type": "Identifier", - "start": 23, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 18 - }, - "identifierName": "generatorMethod" - }, + "start":23,"end":38,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":18},"identifierName":"generatorMethod"}, "name": "generatorMethod" }, "computed": false, @@ -150,18 +48,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":41,"end":43,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":23}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json index 084e745706..d1b72ec991 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/no-constructor-decorators/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Decorators can't be used with a constructor. Did you mean '@dec class { ... }'? (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":10,"end":38,"loc":{"start":{"line":1,"column":10},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":14,"end":36,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":17}}, "decorators": [ { "type": "Decorator", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":14,"end":18,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "abc" - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"abc"}, "name": "abc" } } @@ -130,19 +40,7 @@ "static": false, "key": { "type": "Identifier", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":21,"end":32,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -153,18 +51,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":34,"end":36,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":17}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/object-decorator/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/object-decorator/output.json index 185dae7e4a..852e82ebfe 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/object-decorator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/object-decorator/output.json @@ -1,154 +1,42 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "decorators": [ { "type": "Decorator", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":1,"end":25,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":25}}, "callee": { "type": "Identifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "foo" - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"foo"}, "name": "foo" }, "arguments": [ { "type": "ObjectExpression", - "start": 5, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":5,"end":24,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":24}}, "properties": [ { "type": "ObjectProperty", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":12,"end":22,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":22}}, "decorators": [ { "type": "Decorator", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "expression": { "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" } } @@ -156,37 +44,14 @@ "method": false, "key": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "foo" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"foo"}, "name": "foo" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" @@ -201,69 +66,23 @@ }, { "type": "Decorator", - "start": 26, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":26,"end":30,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":30}}, "expression": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "bar" - }, + "start":27,"end":30,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":30},"identifierName":"bar"}, "name": "bar" } } ], "id": { "type": "Identifier", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "Foo" - }, + "start":37,"end":40,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":40},"identifierName":"Foo"}, "name": "Foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":41,"end":43,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":43}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/decorators/object-method-parameter/output.json b/packages/babel-parser/test/fixtures/experimental/decorators/object-method-parameter/output.json index b50f70a27b..5a29004a83 100644 --- a/packages/babel-parser/test/fixtures/experimental/decorators/object-method-parameter/output.json +++ b/packages/babel-parser/test/fixtures/experimental/decorators/object-method-parameter/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":4,"end":62,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "obj" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"obj"}, "name": "obj" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":62,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 14, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 48 - } - }, + "start":14,"end":60,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":48}}, "method": true, "key": { "type": "Identifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "method" - }, + "start":14,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8},"identifierName":"method"}, "name": "method" }, "computed": false, @@ -130,64 +40,18 @@ "params": [ { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "x" - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"x"}, "name": "x", "decorators": [ { "type": "Decorator", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":21,"end":27,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}}, "expression": { "type": "CallExpression", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":22,"end":27,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":15}}, "callee": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13},"identifierName":"foo"}, "name": "foo" }, "arguments": [] @@ -197,130 +61,39 @@ }, { "type": "Identifier", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 43 - }, - "end": { - "line": 2, - "column": 44 - }, - "identifierName": "y" - }, + "start":55,"end":56,"loc":{"start":{"line":2,"column":43},"end":{"line":2,"column":44},"identifierName":"y"}, "name": "y", "decorators": [ { "type": "Decorator", - "start": 31, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":31,"end":47,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":35}}, "expression": { "type": "CallExpression", - "start": 32, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":32,"end":47,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":35}}, "callee": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "bar" - }, + "start":32,"end":35,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23},"identifierName":"bar"}, "name": "bar" }, "arguments": [ { "type": "ObjectExpression", - "start": 36, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":36,"end":46,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":34}}, "properties": [ { "type": "ObjectProperty", - "start": 38, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":38,"end":44,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":32}}, "method": false, "key": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "a" - }, + "start":38,"end":39,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":27},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":41,"end":44,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":32}}, "extra": { "rawValue": 123, "raw": "123" @@ -335,47 +108,13 @@ }, { "type": "Decorator", - "start": 48, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 36 - }, - "end": { - "line": 2, - "column": 42 - } - }, + "start":48,"end":54,"loc":{"start":{"line":2,"column":36},"end":{"line":2,"column":42}}, "expression": { "type": "CallExpression", - "start": 49, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 37 - }, - "end": { - "line": 2, - "column": 42 - } - }, + "start":49,"end":54,"loc":{"start":{"line":2,"column":37},"end":{"line":2,"column":42}}, "callee": { "type": "Identifier", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 37 - }, - "end": { - "line": 2, - "column": 40 - }, - "identifierName": "baz" - }, + "start":49,"end":52,"loc":{"start":{"line":2,"column":37},"end":{"line":2,"column":40},"identifierName":"baz"}, "name": "baz" }, "arguments": [] @@ -386,18 +125,7 @@ ], "body": { "type": "BlockStatement", - "start": 58, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 46 - }, - "end": { - "line": 2, - "column": 48 - } - }, + "start":58,"end":60,"loc":{"start":{"line":2,"column":46},"end":{"line":2,"column":48}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/do-expressions/conditional-statement/output.json b/packages/babel-parser/test/fixtures/experimental/do-expressions/conditional-statement/output.json index a21a24a89a..3f5de76a0e 100644 --- a/packages/babel-parser/test/fixtures/experimental/do-expressions/conditional-statement/output.json +++ b/packages/babel-parser/test/fixtures/experimental/do-expressions/conditional-statement/output.json @@ -1,214 +1,57 @@ { "type": "File", - "start": 0, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":77,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":77,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":77,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":4,"end":76,"loc":{"start":{"line":1,"column":4},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "DoExpression", - "start": 8, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":8,"end":76,"loc":{"start":{"line":1,"column":8},"end":{"line":5,"column":1}}, "body": { "type": "BlockStatement", - "start": 11, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":11,"end":76,"loc":{"start":{"line":1,"column":11},"end":{"line":5,"column":1}}, "body": [ { "type": "IfStatement", - "start": 15, - "end": 74, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":15,"end":74,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":14}}, "test": { "type": "CallExpression", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":24,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":11}}, "callee": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "foo" - }, + "start":19,"end":22,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"foo"}, "name": "foo" }, "arguments": [] }, "consequent": { "type": "BlockStatement", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":26,"end":33,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":20}}, "body": [ { "type": "ExpressionStatement", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":28,"end":31,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, "expression": { "type": "CallExpression", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":28,"end":31,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, "callee": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "f" - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16},"identifierName":"f"}, "name": "f" }, "arguments": [] @@ -219,109 +62,30 @@ }, "alternate": { "type": "IfStatement", - "start": 41, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":41,"end":74,"loc":{"start":{"line":3,"column":7},"end":{"line":4,"column":14}}, "test": { "type": "CallExpression", - "start": 45, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":45,"end":50,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":16}}, "callee": { "type": "Identifier", - "start": 45, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 14 - }, - "identifierName": "bar" - }, + "start":45,"end":48,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":14},"identifierName":"bar"}, "name": "bar" }, "arguments": [] }, "consequent": { "type": "BlockStatement", - "start": 52, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":52,"end":59,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":25}}, "body": [ { "type": "ExpressionStatement", - "start": 54, - "end": 57, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":54,"end":57,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":23}}, "expression": { "type": "CallExpression", - "start": 54, - "end": 57, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":54,"end":57,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":23}}, "callee": { "type": "Identifier", - "start": 54, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 21 - }, - "identifierName": "g" - }, + "start":54,"end":55,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":21},"identifierName":"g"}, "name": "g" }, "arguments": [] @@ -332,62 +96,17 @@ }, "alternate": { "type": "BlockStatement", - "start": 67, - "end": 74, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":67,"end":74,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":14}}, "body": [ { "type": "ExpressionStatement", - "start": 69, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 12 - } - }, + "start":69,"end":72,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":12}}, "expression": { "type": "CallExpression", - "start": 69, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 12 - } - }, + "start":69,"end":72,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":12}}, "callee": { "type": "Identifier", - "start": 69, - "end": 70, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 10 - }, - "identifierName": "h" - }, + "start":69,"end":70,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10},"identifierName":"h"}, "name": "h" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/experimental/do-expressions/scoping-variable/output.json b/packages/babel-parser/test/fixtures/experimental/do-expressions/scoping-variable/output.json index d3d3568740..ea87774559 100644 --- a/packages/babel-parser/test/fixtures/experimental/do-expressions/scoping-variable/output.json +++ b/packages/babel-parser/test/fixtures/experimental/do-expressions/scoping-variable/output.json @@ -1,184 +1,49 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":4,"end":47,"loc":{"start":{"line":1,"column":4},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "DoExpression", - "start": 8, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":47,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": { "type": "BlockStatement", - "start": 11, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":11,"end":47,"loc":{"start":{"line":1,"column":11},"end":{"line":4,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":15,"end":29,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "declarations": [ { "type": "VariableDeclarator", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":19,"end":28,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "tmp" - }, + "start":19,"end":22,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"tmp"}, "name": "tmp" }, "init": { "type": "CallExpression", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":25,"end":28,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15}}, "callee": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "f" - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"f"}, "name": "f" }, "arguments": [] @@ -189,97 +54,29 @@ }, { "type": "ExpressionStatement", - "start": 32, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":32,"end":45,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":15}}, "expression": { "type": "BinaryExpression", - "start": 32, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":32,"end":45,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":15}}, "left": { "type": "BinaryExpression", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":32,"end":41,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":11}}, "left": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "tmp" - }, + "start":32,"end":35,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5},"identifierName":"tmp"}, "name": "tmp" }, "operator": "*", "right": { "type": "Identifier", - "start": 38, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "tmp" - }, + "start":38,"end":41,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":11},"identifierName":"tmp"}, "name": "tmp" } }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":44,"end":45,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, "extra": { "rawValue": 1, "raw": "1" 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 e6808c472e..e3935122a5 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 223, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 16, - "column": 1 - } - }, + "start":0,"end":223,"loc":{"start":{"line":1,"column":0},"end":{"line":16,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 223, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 16, - "column": 1 - } - }, + "start":0,"end":223,"loc":{"start":{"line":1,"column":0},"end":{"line":16,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 223, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 16, - "column": 1 - } - }, + "start":0,"end":223,"loc":{"start":{"line":1,"column":0},"end":{"line":16,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,126 +20,38 @@ "params": [], "body": { "type": "BlockStatement", - "start": 15, - "end": 223, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 16, - "column": 1 - } - }, + "start":15,"end":223,"loc":{"start":{"line":1,"column":15},"end":{"line":16,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 19, - "end": 221, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 15, - "column": 4 - } - }, + "start":19,"end":221,"loc":{"start":{"line":2,"column":2},"end":{"line":15,"column":4}}, "argument": { "type": "JSXElement", - "start": 32, - "end": 216, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 14, - "column": 10 - } - }, + "start":32,"end":216,"loc":{"start":{"line":3,"column":4},"end":{"line":14,"column":10}}, "openingElement": { "type": "JSXOpeningElement", - "start": 32, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 9 - } - }, - "attributes": [], + "start":32,"end":37,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":9}}, "name": { "type": "JSXIdentifier", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":33,"end":36,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":8}}, "name": "nav" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 210, - "end": 216, - "loc": { - "start": { - "line": 14, - "column": 4 - }, - "end": { - "line": 14, - "column": 10 - } - }, + "start":210,"end":216,"loc":{"start":{"line":14,"column":4},"end":{"line":14,"column":10}}, "name": { "type": "JSXIdentifier", - "start": 212, - "end": 215, - "loc": { - "start": { - "line": 14, - "column": 6 - }, - "end": { - "line": 14, - "column": 9 - } - }, + "start":212,"end":215,"loc":{"start":{"line":14,"column":6},"end":{"line":14,"column":9}}, "name": "nav" } }, "children": [ { "type": "JSXText", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 4, - "column": 6 - } - }, + "start":37,"end":44,"loc":{"start":{"line":3,"column":9},"end":{"line":4,"column":6}}, "extra": { "rawValue": "\n ", "raw": "\n " @@ -193,49 +60,16 @@ }, { "type": "JSXElement", - "start": 44, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":44,"end":52,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":14}}, "openingElement": { "type": "JSXOpeningElement", - "start": 44, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 14 - } - }, - "attributes": [], + "start":44,"end":52,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":14}}, "name": { "type": "JSXIdentifier", - "start": 45, - "end": 49, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 11 - } - }, + "start":45,"end":49,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":11}}, "name": "Home" }, + "attributes": [], "selfClosing": true }, "closingElement": null, @@ -243,18 +77,7 @@ }, { "type": "JSXText", - "start": 52, - "end": 59, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 5, - "column": 6 - } - }, + "start":52,"end":59,"loc":{"start":{"line":4,"column":14},"end":{"line":5,"column":6}}, "extra": { "rawValue": "\n ", "raw": "\n " @@ -263,152 +86,41 @@ }, { "type": "JSXExpressionContainer", - "start": 59, - "end": 205, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 13, - "column": 7 - } - }, + "start":59,"end":205,"loc":{"start":{"line":5,"column":6},"end":{"line":13,"column":7}}, "expression": { "type": "DoExpression", - "start": 69, - "end": 197, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 12, - "column": 9 - } - }, + "start":69,"end":197,"loc":{"start":{"line":6,"column":8},"end":{"line":12,"column":9}}, "body": { "type": "BlockStatement", - "start": 72, - "end": 197, - "loc": { - "start": { - "line": 6, - "column": 11 - }, - "end": { - "line": 12, - "column": 9 - } - }, + "start":72,"end":197,"loc":{"start":{"line":6,"column":11},"end":{"line":12,"column":9}}, "body": [ { "type": "IfStatement", - "start": 84, - "end": 187, - "loc": { - "start": { - "line": 7, - "column": 10 - }, - "end": { - "line": 11, - "column": 11 - } - }, + "start":84,"end":187,"loc":{"start":{"line":7,"column":10},"end":{"line":11,"column":11}}, "test": { "type": "Identifier", - "start": 88, - "end": 96, - "loc": { - "start": { - "line": 7, - "column": 14 - }, - "end": { - "line": 7, - "column": 22 - }, - "identifierName": "loggedIn" - }, + "start":88,"end":96,"loc":{"start":{"line":7,"column":14},"end":{"line":7,"column":22},"identifierName":"loggedIn"}, "name": "loggedIn" }, "consequent": { "type": "BlockStatement", - "start": 98, - "end": 140, - "loc": { - "start": { - "line": 7, - "column": 24 - }, - "end": { - "line": 9, - "column": 11 - } - }, + "start":98,"end":140,"loc":{"start":{"line":7,"column":24},"end":{"line":9,"column":11}}, "body": [ { "type": "ExpressionStatement", - "start": 112, - "end": 128, - "loc": { - "start": { - "line": 8, - "column": 12 - }, - "end": { - "line": 8, - "column": 28 - } - }, + "start":112,"end":128,"loc":{"start":{"line":8,"column":12},"end":{"line":8,"column":28}}, "expression": { "type": "JSXElement", - "start": 112, - "end": 128, - "loc": { - "start": { - "line": 8, - "column": 12 - }, - "end": { - "line": 8, - "column": 28 - } - }, + "start":112,"end":128,"loc":{"start":{"line":8,"column":12},"end":{"line":8,"column":28}}, "openingElement": { "type": "JSXOpeningElement", - "start": 112, - "end": 128, - "loc": { - "start": { - "line": 8, - "column": 12 - }, - "end": { - "line": 8, - "column": 28 - } - }, - "attributes": [], + "start":112,"end":128,"loc":{"start":{"line":8,"column":12},"end":{"line":8,"column":28}}, "name": { "type": "JSXIdentifier", - "start": 113, - "end": 125, - "loc": { - "start": { - "line": 8, - "column": 13 - }, - "end": { - "line": 8, - "column": 25 - } - }, + "start":113,"end":125,"loc":{"start":{"line":8,"column":13},"end":{"line":8,"column":25}}, "name": "LogoutButton" }, + "attributes": [], "selfClosing": true }, "closingElement": null, @@ -420,78 +132,23 @@ }, "alternate": { "type": "BlockStatement", - "start": 146, - "end": 187, - "loc": { - "start": { - "line": 9, - "column": 17 - }, - "end": { - "line": 11, - "column": 11 - } - }, + "start":146,"end":187,"loc":{"start":{"line":9,"column":17},"end":{"line":11,"column":11}}, "body": [ { "type": "ExpressionStatement", - "start": 160, - "end": 175, - "loc": { - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 10, - "column": 27 - } - }, + "start":160,"end":175,"loc":{"start":{"line":10,"column":12},"end":{"line":10,"column":27}}, "expression": { "type": "JSXElement", - "start": 160, - "end": 175, - "loc": { - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 10, - "column": 27 - } - }, + "start":160,"end":175,"loc":{"start":{"line":10,"column":12},"end":{"line":10,"column":27}}, "openingElement": { "type": "JSXOpeningElement", - "start": 160, - "end": 175, - "loc": { - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 10, - "column": 27 - } - }, - "attributes": [], + "start":160,"end":175,"loc":{"start":{"line":10,"column":12},"end":{"line":10,"column":27}}, "name": { "type": "JSXIdentifier", - "start": 161, - "end": 172, - "loc": { - "start": { - "line": 10, - "column": 13 - }, - "end": { - "line": 10, - "column": 24 - } - }, + "start":161,"end":172,"loc":{"start":{"line":10,"column":13},"end":{"line":10,"column":24}}, "name": "LoginButton" }, + "attributes": [], "selfClosing": true }, "closingElement": null, @@ -509,18 +166,7 @@ }, { "type": "JSXText", - "start": 205, - "end": 210, - "loc": { - "start": { - "line": 13, - "column": 7 - }, - "end": { - "line": 14, - "column": 4 - } - }, + "start":205,"end":210,"loc":{"start":{"line":13,"column":7},"end":{"line":14,"column":4}}, "extra": { "rawValue": "\n ", "raw": "\n " diff --git a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/output.json b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/output.json index fe56e0811a..37e56eeb13 100644 --- a/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/output.json +++ b/packages/babel-parser/test/fixtures/experimental/dynamic-import/invalid-lone-import/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: import can only be used in import() or import.meta (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Import", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "parenthesized": true, "parenStart": 0 diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/default-and-named/output.json b/packages/babel-parser/test/fixtures/experimental/export-extensions/default-and-named/output.json index e65a50b154..e0734ffc46 100644 --- a/packages/babel-parser/test/fixtures/experimental/export-extensions/default-and-named/output.json +++ b/packages/babel-parser/test/fixtures/experimental/export-extensions/default-and-named/output.json @@ -1,145 +1,43 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "specifiers": [ { "type": "ExportDefaultSpecifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "exported": { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "foo" - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"foo"}, "name": "foo" } }, { "type": "ExportSpecifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "local": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "bar" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"bar"}, "name": "bar" }, "exported": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "bar" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"bar"}, "name": "bar" } } ], "source": { "type": "StringLiteral", - "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}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/default-and-ns/output.json b/packages/babel-parser/test/fixtures/experimental/export-extensions/default-and-ns/output.json index d044c96352..5b25b65ff1 100644 --- a/packages/babel-parser/test/fixtures/experimental/export-extensions/default-and-ns/output.json +++ b/packages/babel-parser/test/fixtures/experimental/export-extensions/default-and-ns/output.json @@ -1,128 +1,38 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportDefaultSpecifier", - "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}}, "exported": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "B" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"B"}, "name": "B" } }, { "type": "ExportNamespaceSpecifier", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}}, "exported": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "A" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"A"}, "name": "A" } } ], "source": { "type": "StringLiteral", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":22,"end":28,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":28}}, "extra": { "rawValue": "test", "raw": "'test'" diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/default-default/output.json b/packages/babel-parser/test/fixtures/experimental/export-extensions/default-default/output.json index 2463d38b5b..7887a5bb37 100644 --- a/packages/babel-parser/test/fixtures/experimental/export-extensions/default-default/output.json +++ b/packages/babel-parser/test/fixtures/experimental/export-extensions/default-default/output.json @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "specifiers": [ { "type": "ExportDefaultSpecifier", - "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}}, "exported": { "type": "Identifier", - "start": 7, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "default" - }, + "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14},"identifierName":"default"}, "name": "default" } } ], "source": { "type": "StringLiteral", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/default-type-without-flow/output.json b/packages/babel-parser/test/fixtures/experimental/export-extensions/default-type-without-flow/output.json index 2fa10284f6..8a7c1ce3f3 100644 --- a/packages/babel-parser/test/fixtures/experimental/export-extensions/default-type-without-flow/output.json +++ b/packages/babel-parser/test/fixtures/experimental/export-extensions/default-type-without-flow/output.json @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "specifiers": [ { "type": "ExportDefaultSpecifier", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "exported": { "type": "Identifier", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "type" - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11},"identifierName":"type"}, "name": "type" } } ], "source": { "type": "StringLiteral", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}}, "extra": { "rawValue": "test", "raw": "'test'" diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/default/output.json b/packages/babel-parser/test/fixtures/experimental/export-extensions/default/output.json index d31b6fbf36..c89f5074f8 100644 --- a/packages/babel-parser/test/fixtures/experimental/export-extensions/default/output.json +++ b/packages/babel-parser/test/fixtures/experimental/export-extensions/default/output.json @@ -1,96 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportDefaultSpecifier", - "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}}, "exported": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "A" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"A"}, "name": "A" } } ], "source": { "type": "StringLiteral", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}}, "extra": { "rawValue": "test", "raw": "'test'" diff --git a/packages/babel-parser/test/fixtures/experimental/export-extensions/export-with-ts/output.json b/packages/babel-parser/test/fixtures/experimental/export-extensions/export-with-ts/output.json index 740426fadf..e83c25a738 100644 --- a/packages/babel-parser/test/fixtures/experimental/export-extensions/export-with-ts/output.json +++ b/packages/babel-parser/test/fixtures/experimental/export-extensions/export-with-ts/output.json @@ -1,164 +1,52 @@ { "type": "File", - "start": 0, - "end": 164, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 27 - } - }, + "start":0,"end":164,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 164, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 27 - } - }, + "start":0,"end":164,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "ClassDeclaration", - "start": 7, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":7,"end":26,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":26}}, "abstract": true, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "A" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [] } } }, { "type": "ExportNamedDeclaration", - "start": 27, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":27,"end":56,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":29}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSInterfaceDeclaration", - "start": 34, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":34,"end":56,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":29}}, "id": { "type": "Identifier", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 26 - }, - "identifierName": "B" - }, + "start":52,"end":53,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":26},"identifierName":"B"}, "name": "B" }, "body": { "type": "TSInterfaceBody", - "start": 54, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":54,"end":56,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":29}}, "body": [] }, "declare": true @@ -166,50 +54,16 @@ }, { "type": "ExportNamedDeclaration", - "start": 57, - "end": 73, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":57,"end":73,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":16}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "TSEnumDeclaration", - "start": 64, - "end": 73, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":64,"end":73,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":16}}, "id": { "type": "Identifier", - "start": 69, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "C" - }, + "start":69,"end":70,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13},"identifierName":"C"}, "name": "C" }, "members": [] @@ -217,279 +71,87 @@ }, { "type": "ExportNamedDeclaration", - "start": 74, - "end": 95, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 21 - } - }, + "start":74,"end":95,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":21}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSInterfaceDeclaration", - "start": 81, - "end": 95, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 21 - } - }, + "start":81,"end":95,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":21}}, "id": { "type": "Identifier", - "start": 91, - "end": 92, - "loc": { - "start": { - "line": 4, - "column": 17 - }, - "end": { - "line": 4, - "column": 18 - }, - "identifierName": "D" - }, + "start":91,"end":92,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":18},"identifierName":"D"}, "name": "D" }, "body": { "type": "TSInterfaceBody", - "start": 93, - "end": 95, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 21 - } - }, + "start":93,"end":95,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":21}}, "body": [] } } }, { "type": "ExportNamedDeclaration", - "start": 96, - "end": 114, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 18 - } - }, + "start":96,"end":114,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":18}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "TSModuleDeclaration", - "start": 103, - "end": 114, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 18 - } - }, + "start":103,"end":114,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":18}}, "id": { "type": "Identifier", - "start": 110, - "end": 111, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 15 - }, - "identifierName": "E" - }, + "start":110,"end":111,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":15},"identifierName":"E"}, "name": "E" }, "body": { "type": "TSModuleBlock", - "start": 112, - "end": 114, - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 5, - "column": 18 - } - }, + "start":112,"end":114,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":18}}, "body": [] } } }, { "type": "ExportNamedDeclaration", - "start": 115, - "end": 136, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 21 - } - }, + "start":115,"end":136,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":21}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "TSModuleDeclaration", - "start": 122, - "end": 136, - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 21 - } - }, + "start":122,"end":136,"loc":{"start":{"line":6,"column":7},"end":{"line":6,"column":21}}, "id": { "type": "Identifier", - "start": 132, - "end": 133, - "loc": { - "start": { - "line": 6, - "column": 17 - }, - "end": { - "line": 6, - "column": 18 - }, - "identifierName": "F" - }, + "start":132,"end":133,"loc":{"start":{"line":6,"column":17},"end":{"line":6,"column":18},"identifierName":"F"}, "name": "F" }, "body": { "type": "TSModuleBlock", - "start": 134, - "end": 136, - "loc": { - "start": { - "line": 6, - "column": 19 - }, - "end": { - "line": 6, - "column": 21 - } - }, + "start":134,"end":136,"loc":{"start":{"line":6,"column":19},"end":{"line":6,"column":21}}, "body": [] } } }, { "type": "ExportNamedDeclaration", - "start": 137, - "end": 164, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 27 - } - }, + "start":137,"end":164,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":27}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSTypeAliasDeclaration", - "start": 144, - "end": 164, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 27 - } - }, + "start":144,"end":164,"loc":{"start":{"line":7,"column":7},"end":{"line":7,"column":27}}, "id": { "type": "Identifier", - "start": 149, - "end": 150, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 13 - }, - "identifierName": "G" - }, + "start":149,"end":150,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":13},"identifierName":"G"}, "name": "G" }, "typeAnnotation": { "type": "TSTypeQuery", - "start": 153, - "end": 163, - "loc": { - "start": { - "line": 7, - "column": 16 - }, - "end": { - "line": 7, - "column": 26 - } - }, + "start":153,"end":163,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":26}}, "exprName": { "type": "Identifier", - "start": 160, - "end": 163, - "loc": { - "start": { - "line": 7, - "column": 23 - }, - "end": { - "line": 7, - "column": 26 - }, - "identifierName": "foo" - }, + "start":160,"end":163,"loc":{"start":{"line":7,"column":23},"end":{"line":7,"column":26},"identifierName":"foo"}, "name": "foo" } } diff --git a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-asi-funciton-declaration/output.json b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-asi-funciton-declaration/output.json index 8f1dc7f1fd..deae7f7251 100644 --- a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-asi-funciton-declaration/output.json +++ b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-asi-funciton-declaration/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,93 +20,25 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":16,"end":42,"loc":{"start":{"line":1,"column":16},"end":{"line":4,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":20,"end":35,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}}, "expression": { "type": "CallExpression", - "start": 20, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":20,"end":35,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}}, "callee": { "type": "MetaProperty", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":20,"end":33,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "meta": { "type": "Identifier", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "function" - }, + "start":20,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10},"identifierName":"function"}, "name": "function" }, "property": { "type": "Identifier", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "sent" - }, + "start":29,"end":33,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":15},"identifierName":"sent"}, "name": "sent" } }, @@ -160,18 +47,7 @@ }, { "type": "BlockStatement", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":38,"end":40,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-call-statement/output.json b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-call-statement/output.json index 0f78ff94e3..9aa076e2d6 100644 --- a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-call-statement/output.json +++ b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-call-statement/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,93 +20,25 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":38,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":20,"end":36,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, "expression": { "type": "CallExpression", - "start": 20, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":20,"end":35,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}}, "callee": { "type": "MetaProperty", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":20,"end":33,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "meta": { "type": "Identifier", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "function" - }, + "start":20,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10},"identifierName":"function"}, "name": "function" }, "property": { "type": "Identifier", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "sent" - }, + "start":29,"end":33,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":15},"identifierName":"sent"}, "name": "sent" } }, diff --git a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-call/output.json b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-call/output.json index 6ee6b54a10..b3275b4cd4 100644 --- a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-call/output.json +++ b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-call/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,93 +20,25 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":40,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":20,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "expression": { "type": "CallExpression", - "start": 21, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":21,"end":36,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":18}}, "callee": { "type": "MetaProperty", - "start": 21, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":21,"end":34,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":16}}, "meta": { "type": "Identifier", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "function" - }, + "start":21,"end":29,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":11},"identifierName":"function"}, "name": "function" }, "property": { "type": "Identifier", - "start": 30, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "sent" - }, + "start":30,"end":34,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":16},"identifierName":"sent"}, "name": "sent" } }, diff --git a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-if-statement/output.json b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-if-statement/output.json index 12271ff154..3485397b4d 100644 --- a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-if-statement/output.json +++ b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-if-statement/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,109 +20,30 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":46,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "body": [ { "type": "IfStatement", - "start": 20, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":20,"end":44,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":26}}, "test": { "type": "BooleanLiteral", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":24,"end":28,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":10}}, "value": true }, "consequent": { "type": "ExpressionStatement", - "start": 30, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":30,"end":44,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":26}}, "expression": { "type": "MetaProperty", - "start": 30, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":30,"end":43,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":25}}, "meta": { "type": "Identifier", - "start": 30, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "function" - }, + "start":30,"end":38,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":20},"identifierName":"function"}, "name": "function" }, "property": { "type": "Identifier", - "start": 39, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "sent" - }, + "start":39,"end":43,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":25},"identifierName":"sent"}, "name": "sent" } } diff --git a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-inside-generator/output.json b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-inside-generator/output.json index d8961a920c..a0fdd5c381 100644 --- a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-inside-generator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-inside-generator/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,79 +20,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":43,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 20, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":20,"end":41,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":23}}, "argument": { "type": "MetaProperty", - "start": 27, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":27,"end":40,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":22}}, "meta": { "type": "Identifier", - "start": 27, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "function" - }, + "start":27,"end":35,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":17},"identifierName":"function"}, "name": "function" }, "property": { "type": "Identifier", - "start": 36, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "sent" - }, + "start":36,"end":40,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":22},"identifierName":"sent"}, "name": "sent" } } diff --git a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-statement/output.json b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-statement/output.json index 5bf2f923b8..64b15fcf30 100644 --- a/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-statement/output.json +++ b/packages/babel-parser/test/fixtures/experimental/function-sent/enabled-statement/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,79 +20,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":36,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":20,"end":34,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "expression": { "type": "MetaProperty", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":20,"end":33,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "meta": { "type": "Identifier", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "function" - }, + "start":20,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10},"identifierName":"function"}, "name": "function" }, "property": { "type": "Identifier", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "sent" - }, + "start":29,"end":33,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":15},"identifierName":"sent"}, "name": "sent" } } diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/output.json b/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/output.json index 12e01e17c2..003b67cda8 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-meta/error-in-script/output.json @@ -1,129 +1,38 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: import.meta may appear only with 'sourceType: \"module\"' (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":6,"end":21,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "MetaProperty", - "start": 10, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21}}, "meta": { "type": "Identifier", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "import" - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16},"identifierName":"import"}, "name": "import" }, "property": { "type": "Identifier", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "meta" - }, + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21},"identifierName":"meta"}, "name": "meta" } } diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/output.json b/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/output.json index 9b2370d8c3..c03b9e7046 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-meta/no-other-prop-names/output.json @@ -1,97 +1,29 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: The only valid meta property for import is import.meta (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "MetaProperty", - "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}}, "meta": { "type": "Identifier", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "import" - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"import"}, "name": "import" }, "property": { "type": "Identifier", - "start": 7, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "notMeta" - }, + "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14},"identifierName":"notMeta"}, "name": "notMeta" } } diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json b/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json index 7610536bea..5e1510e58f 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-meta/not-assignable/output.json @@ -1,129 +1,39 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Invalid left-hand side in assignment expression (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "operator": "=", "left": { "type": "MetaProperty", - "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}}, "meta": { "type": "Identifier", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "import" - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"import"}, "name": "import" }, "property": { "type": "Identifier", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "meta" - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11},"identifierName":"meta"}, "name": "meta" } }, "right": { "type": "BooleanLiteral", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}}, "value": true } } diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/valid-in-module/output.json b/packages/babel-parser/test/fixtures/experimental/import-meta/valid-in-module/output.json index 762e468f42..f7c0f728ad 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-meta/valid-in-module/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-meta/valid-in-module/output.json @@ -1,126 +1,35 @@ { "type": "File", - "start": 0, - "end": 116, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 34 - } - }, + "start":0,"end":116,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 116, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 34 - } - }, + "start":0,"end":116,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":6,"end":21,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "MetaProperty", - "start": 10, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21}}, "meta": { "type": "Identifier", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "import" - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16},"identifierName":"import"}, "name": "import" }, "property": { "type": "Identifier", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "meta" - }, + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21},"identifierName":"meta"}, "name": "meta" } } @@ -130,128 +39,36 @@ }, { "type": "VariableDeclaration", - "start": 23, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":23,"end":51,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 29, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":29,"end":50,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":27}}, "id": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "url" - }, + "start":29,"end":32,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"url"}, "name": "url" }, "init": { "type": "MemberExpression", - "start": 35, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":35,"end":50,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":27}}, "object": { "type": "MetaProperty", - "start": 35, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":35,"end":46,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":23}}, "meta": { "type": "Identifier", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "import" - }, + "start":35,"end":41,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":18},"identifierName":"import"}, "name": "import" }, "property": { "type": "Identifier", - "start": 42, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "meta" - }, + "start":42,"end":46,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":23},"identifierName":"meta"}, "name": "meta" } }, "property": { "type": "Identifier", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "url" - }, + "start":47,"end":50,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":27},"identifierName":"url"}, "name": "url" }, "computed": false @@ -262,160 +79,45 @@ }, { "type": "ExpressionStatement", - "start": 52, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":52,"end":64,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "expression": { "type": "MetaProperty", - "start": 52, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":52,"end":63,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":11}}, "meta": { "type": "Identifier", - "start": 52, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "import" - }, + "start":52,"end":58,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":6},"identifierName":"import"}, "name": "import" }, "property": { "type": "Identifier", - "start": 59, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "meta" - }, + "start":59,"end":63,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":11},"identifierName":"meta"}, "name": "meta" } } }, { "type": "ExpressionStatement", - "start": 65, - "end": 81, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 16 - } - }, + "start":65,"end":81,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":16}}, "expression": { "type": "MemberExpression", - "start": 65, - "end": 80, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":65,"end":80,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":15}}, "object": { "type": "MetaProperty", - "start": 65, - "end": 76, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 11 - } - }, + "start":65,"end":76,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":11}}, "meta": { "type": "Identifier", - "start": 65, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 6 - }, - "identifierName": "import" - }, + "start":65,"end":71,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":6},"identifierName":"import"}, "name": "import" }, "property": { "type": "Identifier", - "start": 72, - "end": 76, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 11 - }, - "identifierName": "meta" - }, + "start":72,"end":76,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":11},"identifierName":"meta"}, "name": "meta" } }, "property": { "type": "Identifier", - "start": 77, - "end": 80, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 15 - }, - "identifierName": "url" - }, + "start":77,"end":80,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":15},"identifierName":"url"}, "name": "url" }, "computed": false @@ -423,129 +125,38 @@ }, { "type": "ExpressionStatement", - "start": 82, - "end": 116, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 34 - } - }, + "start":82,"end":116,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":34}}, "expression": { "type": "AssignmentExpression", - "start": 82, - "end": 115, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 33 - } - }, + "start":82,"end":115,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":33}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 82, - "end": 108, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 26 - } - }, + "start":82,"end":108,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":26}}, "object": { "type": "MetaProperty", - "start": 82, - "end": 93, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":82,"end":93,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":11}}, "meta": { "type": "Identifier", - "start": 82, - "end": 88, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 6 - }, - "identifierName": "import" - }, + "start":82,"end":88,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":6},"identifierName":"import"}, "name": "import" }, "property": { "type": "Identifier", - "start": 89, - "end": 93, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 11 - }, - "identifierName": "meta" - }, + "start":89,"end":93,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":11},"identifierName":"meta"}, "name": "meta" } }, "property": { "type": "Identifier", - "start": 94, - "end": 108, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 26 - }, - "identifierName": "couldBeMutable" - }, + "start":94,"end":108,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":26},"identifierName":"couldBeMutable"}, "name": "couldBeMutable" }, "computed": false }, "right": { "type": "BooleanLiteral", - "start": 111, - "end": 115, - "loc": { - "start": { - "line": 5, - "column": 29 - }, - "end": { - "line": 5, - "column": 33 - } - }, + "start":111,"end":115,"loc":{"start":{"line":5,"column":29},"end":{"line":5,"column":33}}, "value": true } } diff --git a/packages/babel-parser/test/fixtures/experimental/import-meta/without-dynamic-import/output.json b/packages/babel-parser/test/fixtures/experimental/import-meta/without-dynamic-import/output.json index 762e468f42..f7c0f728ad 100644 --- a/packages/babel-parser/test/fixtures/experimental/import-meta/without-dynamic-import/output.json +++ b/packages/babel-parser/test/fixtures/experimental/import-meta/without-dynamic-import/output.json @@ -1,126 +1,35 @@ { "type": "File", - "start": 0, - "end": 116, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 34 - } - }, + "start":0,"end":116,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 116, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 34 - } - }, + "start":0,"end":116,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":6,"end":21,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "MetaProperty", - "start": 10, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21}}, "meta": { "type": "Identifier", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "import" - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16},"identifierName":"import"}, "name": "import" }, "property": { "type": "Identifier", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "meta" - }, + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21},"identifierName":"meta"}, "name": "meta" } } @@ -130,128 +39,36 @@ }, { "type": "VariableDeclaration", - "start": 23, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":23,"end":51,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 29, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":29,"end":50,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":27}}, "id": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "url" - }, + "start":29,"end":32,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9},"identifierName":"url"}, "name": "url" }, "init": { "type": "MemberExpression", - "start": 35, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":35,"end":50,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":27}}, "object": { "type": "MetaProperty", - "start": 35, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":35,"end":46,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":23}}, "meta": { "type": "Identifier", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "import" - }, + "start":35,"end":41,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":18},"identifierName":"import"}, "name": "import" }, "property": { "type": "Identifier", - "start": 42, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "meta" - }, + "start":42,"end":46,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":23},"identifierName":"meta"}, "name": "meta" } }, "property": { "type": "Identifier", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "url" - }, + "start":47,"end":50,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":27},"identifierName":"url"}, "name": "url" }, "computed": false @@ -262,160 +79,45 @@ }, { "type": "ExpressionStatement", - "start": 52, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":52,"end":64,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "expression": { "type": "MetaProperty", - "start": 52, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":52,"end":63,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":11}}, "meta": { "type": "Identifier", - "start": 52, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "import" - }, + "start":52,"end":58,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":6},"identifierName":"import"}, "name": "import" }, "property": { "type": "Identifier", - "start": 59, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "meta" - }, + "start":59,"end":63,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":11},"identifierName":"meta"}, "name": "meta" } } }, { "type": "ExpressionStatement", - "start": 65, - "end": 81, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 16 - } - }, + "start":65,"end":81,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":16}}, "expression": { "type": "MemberExpression", - "start": 65, - "end": 80, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":65,"end":80,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":15}}, "object": { "type": "MetaProperty", - "start": 65, - "end": 76, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 11 - } - }, + "start":65,"end":76,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":11}}, "meta": { "type": "Identifier", - "start": 65, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 6 - }, - "identifierName": "import" - }, + "start":65,"end":71,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":6},"identifierName":"import"}, "name": "import" }, "property": { "type": "Identifier", - "start": 72, - "end": 76, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 11 - }, - "identifierName": "meta" - }, + "start":72,"end":76,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":11},"identifierName":"meta"}, "name": "meta" } }, "property": { "type": "Identifier", - "start": 77, - "end": 80, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 15 - }, - "identifierName": "url" - }, + "start":77,"end":80,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":15},"identifierName":"url"}, "name": "url" }, "computed": false @@ -423,129 +125,38 @@ }, { "type": "ExpressionStatement", - "start": 82, - "end": 116, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 34 - } - }, + "start":82,"end":116,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":34}}, "expression": { "type": "AssignmentExpression", - "start": 82, - "end": 115, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 33 - } - }, + "start":82,"end":115,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":33}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 82, - "end": 108, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 26 - } - }, + "start":82,"end":108,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":26}}, "object": { "type": "MetaProperty", - "start": 82, - "end": 93, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":82,"end":93,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":11}}, "meta": { "type": "Identifier", - "start": 82, - "end": 88, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 6 - }, - "identifierName": "import" - }, + "start":82,"end":88,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":6},"identifierName":"import"}, "name": "import" }, "property": { "type": "Identifier", - "start": 89, - "end": 93, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 11 - }, - "identifierName": "meta" - }, + "start":89,"end":93,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":11},"identifierName":"meta"}, "name": "meta" } }, "property": { "type": "Identifier", - "start": 94, - "end": 108, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 26 - }, - "identifierName": "couldBeMutable" - }, + "start":94,"end":108,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":26},"identifierName":"couldBeMutable"}, "name": "couldBeMutable" }, "computed": false }, "right": { "type": "BooleanLiteral", - "start": 111, - "end": 115, - "loc": { - "start": { - "line": 5, - "column": 29 - }, - "end": { - "line": 5, - "column": 33 - } - }, + "start":111,"end":115,"loc":{"start":{"line":5,"column":29},"end":{"line":5,"column":33}}, "value": true } } diff --git a/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/and-and-equals/output.json b/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/and-and-equals/output.json index ca7f051934..f76347f82a 100644 --- a/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/and-and-equals/output.json +++ b/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/and-and-equals/output.json @@ -1,193 +1,56 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "a" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"a"}, "name": "a" }, "right": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "b" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"b"}, "name": "b" } } }, { "type": "ExpressionStatement", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":9,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "expression": { "type": "AssignmentExpression", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":9,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "operator": "&&=", "left": { "type": "MemberExpression", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":9,"end":14,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}}, "object": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "obj" - }, + "start":9,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3},"identifierName":"obj"}, "name": "obj" }, "property": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"}, "name": "a" }, "computed": false }, "right": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "b" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"b"}, "name": "b" } } diff --git a/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/mallet/output.json b/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/mallet/output.json index 955795e96b..82f46579d4 100644 --- a/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/mallet/output.json +++ b/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/mallet/output.json @@ -1,193 +1,56 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "a" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"a"}, "name": "a" }, "right": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "b" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"b"}, "name": "b" } } }, { "type": "ExpressionStatement", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":9,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "expression": { "type": "AssignmentExpression", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":9,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "operator": "||=", "left": { "type": "MemberExpression", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":9,"end":14,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}}, "object": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "obj" - }, + "start":9,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3},"identifierName":"obj"}, "name": "obj" }, "property": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"}, "name": "a" }, "computed": false }, "right": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "b" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"b"}, "name": "b" } } diff --git a/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals/output.json b/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals/output.json index ffa28bc26b..6e6d1bea81 100644 --- a/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals/output.json +++ b/packages/babel-parser/test/fixtures/experimental/logical-assignment-operator/qq-equals/output.json @@ -1,193 +1,56 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "a" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"a"}, "name": "a" }, "right": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "b" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"b"}, "name": "b" } } }, { "type": "ExpressionStatement", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":9,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "expression": { "type": "AssignmentExpression", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":9,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "operator": "??=", "left": { "type": "MemberExpression", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":9,"end":14,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}}, "object": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "obj" - }, + "start":9,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3},"identifierName":"obj"}, "name": "obj" }, "property": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"}, "name": "a" }, "computed": false }, "right": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "b" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"b"}, "name": "b" } } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/identifier-start-0/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/identifier-start-0/output.json index 8bb7a04b57..4e10fae280 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/identifier-start-0/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/identifier-start-0/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "_123" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"_123"}, "name": "_123" } } diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/output.json index bed1899ddc..f71e62cf63 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-0/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 1, "raw": "1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/output.json index c1dac77640..a685b94be0 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-1/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 11, "raw": "1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/output.json index 6839504edf..c32319f375 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-10/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 17, "raw": "0x1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/output.json index c7f4877e20..7ee60b71ca 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-100/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "extra": { "rawValue": 1, "raw": "1_", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/output.json index 1b343c3025..242847410a 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-101/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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": 11, "raw": "1_1_", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/output.json index 2ab61fd7bb..aedcced6b5 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-102/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:4)", "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "extra": { "rawValue": 11, "raw": "1_1__", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/output.json index e799ede442..6fc9be0b38 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-103/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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": 11, "raw": "1__1", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/output.json index 7eef10ad86..fa1525dea3 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-104/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 11.11, "raw": "1_1_.1_1", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/output.json index 5a3cc58cad..8c94785d66 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-105/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 11.11, "raw": "1_1._1_1", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/output.json index 45e0aecd21..83b95a0906 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-106/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 111, "raw": "1_1.1_e1", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/output.json index 73400bf8fd..fcf5f8cc4e 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-107/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 111, "raw": "1_1.1_E1", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/output.json index 6c6aa937ac..fac7984d56 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-108/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 111, "raw": "1_1.1e_1", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/output.json index a646828811..245a9416a8 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-109/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 111, "raw": "1_1.1E_1", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/output.json index 0a1b0a1103..3ce69cd5a8 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-11/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 161, "raw": "0xa_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/output.json index 34647c6e63..1694c85af9 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-110/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "rawValue": 17, "raw": "0x1_1_", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/output.json index e33208bf59..e033ff3657 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-111/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "rawValue": 161, "raw": "0xa_1_", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/output.json index 48e2d91588..5aebc0f50b 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-112/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "rawValue": 161, "raw": "0x_a_1", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/output.json index af714540b4..e8db639c56 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-113/output.json @@ -1,17 +1,6 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:4)", @@ -19,49 +8,16 @@ ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 17, "raw": "0x__1_1_", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/output.json index 151f29fb87..9d692b713f 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-114/output.json @@ -1,17 +1,6 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:5)", @@ -19,49 +8,16 @@ ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "extra": { "rawValue": 17, "raw": "0x_1__1", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/output.json index 3ec08e9eab..0b12f49112 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-115/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "extra": { "rawValue": 17, "raw": "0x_1_1_", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/output.json index b79700fd39..2629abd0de 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-116/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "rawValue": 9, "raw": "0o_1_1", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/output.json index c0bcbc71a4..f6817e0b22 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-117/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "extra": { "rawValue": 9, "raw": "0o_11", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/output.json index 00976d92c5..1a2378d0b0 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-118/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:8)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 9, "raw": "0o_01_1_", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/output.json index 1858a06292..fce3fc7578 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-119/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 3, "raw": "0b_0_1_1", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/output.json index a3ac3d5828..6900ec7205 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-12/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 161, "raw": "0x_a_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/output.json index 0b18241bc1..987d9624eb 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-120/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:8)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 3, "raw": "0b_01_1_", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/output.json index c478966220..6fd12b2edc 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-121/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "extra": { "rawValue": 3, "raw": "0b01_1_", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/output.json index 3c73b3979a..004e40f97b 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-122/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "rawValue": 9, "raw": "0o1_1_", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/output.json index 7b4538c88e..2fcbd10c80 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-123/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "extra": { "rawValue": 9, "raw": "0o_1_1_", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/output.json index 55f03701d9..cd4cd6ffeb 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-124/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "extra": { "rawValue": 1, "raw": "1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/output.json index 4c87cc2b22..a6ea0dbbc1 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-125/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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": 11, "raw": "1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/output.json index 65bec6bcbd..4e0a0023c3 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-126/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:4)", "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "extra": { "rawValue": 11, "raw": "1_1__" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/output.json index 740a870e3a..01995ddd75 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-127/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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": 11, "raw": "1__1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/output.json index 8b3ea17025..58bb3e5dec 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-128/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 11.11, "raw": "1_1_.1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/output.json index a30df38017..54d3a1050e 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-129/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 11.11, "raw": "1_1._1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/output.json index 78257d308a..ded88989d1 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-13/output.json @@ -1,17 +1,6 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:3)", @@ -19,49 +8,16 @@ ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 17, "raw": "0x__1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/output.json index a3ea6fad2e..6eb72f7417 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-130/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 111, "raw": "1_1.1_e1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/output.json index 6461d8dba2..f977883820 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-131/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 111, "raw": "1_1.1_E1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/output.json index d27ae3b4fa..bf350c9fd0 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-132/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 111, "raw": "1_1.1e_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/output.json index ee4395d21f..e06df95011 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-133/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 111, "raw": "1_1.1E_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/output.json index 29dc70b248..bb0df5540a 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-134/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "rawValue": 17, "raw": "0x1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/output.json index f08afb905e..4484f2592a 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-135/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "rawValue": 161, "raw": "0xa_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/output.json index 2507a579d6..5b86c97767 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-136/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "rawValue": 161, "raw": "0x_a_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/output.json index 89afd3efde..0a7efd31a5 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-137/output.json @@ -1,17 +1,6 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:4)", @@ -19,64 +8,20 @@ ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 17, "raw": "0x__1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/output.json index 8cad142881..7e5e1b87de 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-138/output.json @@ -1,17 +1,6 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:5)", @@ -19,64 +8,20 @@ ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "extra": { "rawValue": 17, "raw": "0x_1__1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/output.json index 9d86aac219..a904876ecc 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-139/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "extra": { "rawValue": 17, "raw": "0x_1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/output.json index 477b3c1f3c..9b87ecd61c 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-14/output.json @@ -1,17 +1,6 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:4)", @@ -19,49 +8,16 @@ ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 17, "raw": "0x_1__1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/output.json index 73b694a665..09eda4f99d 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-140/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "rawValue": 9, "raw": "0o_1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/output.json index 3e602cf8e3..1fa9b9b565 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-141/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "extra": { "rawValue": 9, "raw": "0o_11" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/output.json index 7b96b478be..ab2be9d065 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-142/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:8)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 9, "raw": "0o_01_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/output.json index bd3c89e955..2f01f1cdfc 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-143/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 3, "raw": "0b_0_1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/output.json index df4e4858fa..19996c619d 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-144/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:8)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 3, "raw": "0b_01_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/output.json index f9203546d1..73d0352df2 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-145/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "extra": { "rawValue": 3, "raw": "0b01_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/output.json index 3138ed9234..26e13a1532 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-146/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "rawValue": 9, "raw": "0o1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/output.json index 5cd647c2bf..21d200a0d6 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-147/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "ExpressionStatement", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "expression": { "type": "NumericLiteral", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "extra": { "rawValue": 9, "raw": "0o_1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/output.json index a43596db0e..c0679de758 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-15/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 17, "raw": "0x_1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/output.json index c6b5154666..67f7f44633 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-16/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o_1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/output.json index 4788bc8874..e641715002 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-17/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o_11" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/output.json index e797620a32..c9862c7c74 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-18/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o_01_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/output.json index 509fa7be53..59ef8dcfe7 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-19/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "0b_0_1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/output.json index 71b523cdc3..259a3f3a14 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-2/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 11, "raw": "1_1__" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/output.json index 386c54cac8..f83fa6ea3e 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-20/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "0b_01_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/output.json index 9932926344..7390d0e73c 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-21/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "0b01_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/output.json index 031ce3f9fc..f3aadce6c7 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-22/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/output.json index cf60b4557b..482160a3f2 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-23/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o_1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/output.json index 0de8505e11..ea8fc8c204 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-25/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:4)", "SyntaxError: Expected number in radix 8 (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 8, "raw": "0o01_8" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/output.json index ab45a08cb8..9a263fd785 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-26/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected number in radix 2 (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 1, "raw": "0b2_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/output.json index 22352b5f30..4fa0a1810f 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-28/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 1, "raw": "1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/output.json index 109e146777..0d67691d81 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-29/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 11, "raw": "1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/output.json index 39f6afe910..872895190f 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-3/output.json @@ -1,66 +1,22 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:1)", "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 11, "raw": "1__1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/output.json index 422bdd6c63..1743eab00f 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-30/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 11, "raw": "1_1__" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/output.json index 4cf178b208..836a76bd99 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-31/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:1)", "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 11, "raw": "1__1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/output.json index 3ac121a5ee..e9cfbc456c 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-32/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 11.11, "raw": "1_1_.1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/output.json index 4e344f6fd3..0e74e29fea 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-33/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 11.11, "raw": "1_1._1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/output.json index d8a2a2deda..269b48e7fb 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-34/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 111, "raw": "1_1.1_e1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/output.json index 0b63b96818..d9086f1000 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-35/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 111, "raw": "1_1.1_E1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/output.json index 6a9efc6929..12858208a0 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-36/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 111, "raw": "1_1.1e_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/output.json index f68c592835..2128458509 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-37/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 111, "raw": "1_1.1E_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/output.json index 0c35b02966..195c69a6e0 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-38/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 17, "raw": "0x1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/output.json index 8076713df2..98b20b22a3 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-39/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 161, "raw": "0xa_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/output.json index ad70ca6fc2..96e6972816 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-4/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 11.11, "raw": "1_1_.1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/output.json index 31bfeccc15..bae33528af 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-40/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 161, "raw": "0x_a_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/output.json index ca8eaf7c7c..e08b976812 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-41/output.json @@ -1,17 +1,6 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:3)", @@ -19,49 +8,16 @@ ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 17, "raw": "0x__1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/output.json index 689560a3bb..17b25f9fb3 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-42/output.json @@ -1,17 +1,6 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:4)", @@ -19,49 +8,16 @@ ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 17, "raw": "0x_1__1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/output.json index b92b88fa4a..37fb1b9d90 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-43/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 17, "raw": "0x_1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/output.json index 9487edc545..0c576d51f4 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-44/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o_1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/output.json index 1c39ba7a1d..f26f8dd544 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-45/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o_11" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/output.json index 2890e46ca7..c721e17050 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-46/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o_01_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/output.json index 6de8c77bf9..32b05f9776 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-47/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "0b_0_1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/output.json index ae93a10976..370cad5f22 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-48/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "0b_01_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/output.json index fdede7a21a..7302b58872 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-49/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "0b01_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/output.json index ae808dbc99..104bab8bfb 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-5/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 11.11, "raw": "1_1._1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/output.json index 784d1a3498..1696b72036 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-50/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/output.json index 678bccf4fa..4a170306f9 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-51/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o_1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/output.json index 2c53bf532c..ef36209f39 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-52/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 1, "raw": "1_" @@ -83,18 +28,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/output.json index f3956eac08..b594061053 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-53/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 11, "raw": "1_1_" @@ -83,18 +28,7 @@ }, { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/output.json index fa8e18cac1..a240786ccd 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-54/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 11, "raw": "1_1__" @@ -84,18 +29,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/output.json index d2ac83f657..327ca06461 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-55/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:1)", "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 11, "raw": "1__1" @@ -84,18 +29,7 @@ }, { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/output.json index 154d9a6f46..a1f3a2f797 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-56/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 11.11, "raw": "1_1_.1_1" @@ -83,18 +28,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/output.json index 6e462c0e07..5be8427a63 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-57/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 11.11, "raw": "1_1._1_1" @@ -83,18 +28,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/output.json index 95a795d633..be53084784 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-58/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 111, "raw": "1_1.1_e1" @@ -83,18 +28,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/output.json index 51953305e0..8946a1d3df 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-59/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 111, "raw": "1_1.1_E1" @@ -83,18 +28,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/output.json index d0b1538b39..47194a33cc 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-6/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 111, "raw": "1_1.1_e1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/output.json index a394466973..2fcf0f2e71 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-60/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 111, "raw": "1_1.1e_1" @@ -83,18 +28,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/output.json index 3660527771..7b94176ac8 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-61/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 111, "raw": "1_1.1E_1" @@ -83,18 +28,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/output.json index 347125ca2b..9ccb458bc2 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-62/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 17, "raw": "0x1_1_" @@ -83,18 +28,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/output.json index ac06aae7f8..270a3c6f12 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-63/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 161, "raw": "0xa_1_" @@ -83,18 +28,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/output.json index a70fc4a0fa..f11b9f23a5 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-64/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 161, "raw": "0x_a_1" @@ -83,18 +28,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/output.json index b75b68e18c..b115442a12 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-65/output.json @@ -1,17 +1,6 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:3)", @@ -19,64 +8,20 @@ ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 17, "raw": "0x__1_1_" @@ -85,18 +30,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/output.json index 7ddf567a29..8460ef9ed9 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-66/output.json @@ -1,17 +1,6 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:4)", @@ -19,64 +8,20 @@ ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 17, "raw": "0x_1__1" @@ -85,18 +30,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/output.json index 849bdb6de9..af0c112309 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-67/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 17, "raw": "0x_1_1_" @@ -84,18 +29,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/output.json index 112bef72c9..b4baab71f7 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-68/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o_1_1" @@ -83,18 +28,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/output.json index e702d612d2..67b40a8158 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-69/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o_11" @@ -83,18 +28,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/output.json index 13d9caf030..d332a8378d 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-7/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 111, "raw": "1_1.1_E1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/output.json index 5f86cf161b..7e2e98b195 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-70/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o_01_1_" @@ -84,18 +29,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/output.json index 5ce3d7e5f1..1e72221130 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-71/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "0b_0_1_1" @@ -83,18 +28,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/output.json index 3364a2a11b..b6fc5e3e25 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-72/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "0b_01_1_" @@ -84,18 +29,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/output.json index 77046a4ee1..87cbb9e74a 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-73/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "0b01_1_" @@ -83,18 +28,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/output.json index fdc0933003..e13589825c 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-74/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o1_1_" @@ -83,18 +28,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/output.json index 7f14d41f53..99aaeee036 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-75/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "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}}, "expressions": [ { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o_1_1_" @@ -84,18 +29,7 @@ }, { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/output.json index f505cbb816..6a5210632f 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-76/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "ArrayExpression", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "extra": { "rawValue": 1, "raw": "1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/output.json index 2648664f29..3daf76e319 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-77/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "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": 11, "raw": "1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/output.json index a270c24206..945775d56e 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-78/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:4)", "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "extra": { "rawValue": 11, "raw": "1_1__" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/output.json index 650a98a4cb..961a9442c7 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-79/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:2)", "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "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": 11, "raw": "1__1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/output.json index 037c60cbef..ac19c3b8fe 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-8/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 111, "raw": "1_1.1e_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/output.json index 1410809beb..5ac02a8104 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-80/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 11.11, "raw": "1_1_.1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/output.json index 5ac0337bfe..f85156325d 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-81/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 11.11, "raw": "1_1._1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/output.json index 417003e07e..63db3421d8 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-82/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 111, "raw": "1_1.1_e1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/output.json index 9aa4e5c834..34de6f8035 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-83/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 111, "raw": "1_1.1_E1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/output.json index 859e6d5d53..bd892f5bef 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-84/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 111, "raw": "1_1.1e_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/output.json index 5020300be0..4ed7d8e9c0 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-85/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 111, "raw": "1_1.1E_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/output.json index 3f132f0547..2038ff8d78 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-86/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "rawValue": 17, "raw": "0x1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/output.json index 173a126235..593809dbd3 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-87/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "rawValue": 161, "raw": "0xa_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/output.json index 4f7277b6d9..67a557a8d3 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-88/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "rawValue": 161, "raw": "0x_a_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/output.json index 1e5f3a747c..8a9f3fe0cf 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-89/output.json @@ -1,17 +1,6 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:4)", @@ -19,64 +8,20 @@ ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 17, "raw": "0x__1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/output.json index ea1d580472..28cdddee6c 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-9/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 111, "raw": "1_1.1E_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/output.json index 9723cfbd4f..a46838420e 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-90/output.json @@ -1,17 +1,6 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:5)", @@ -19,64 +8,20 @@ ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "extra": { "rawValue": 17, "raw": "0x_1__1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/output.json index e802a59e07..a4f7ce2d86 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-91/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "extra": { "rawValue": 17, "raw": "0x_1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/output.json index ffc792a8db..238b8d7eb9 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-92/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "rawValue": 9, "raw": "0o_1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/output.json index 583643ac78..aca4cb9eaa 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-93/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "extra": { "rawValue": 9, "raw": "0o_11" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/output.json index 71984f0f6d..0f6ee969f9 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-94/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:8)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 9, "raw": "0o_01_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/output.json index 92169c50ab..ebeef35878 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-95/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 3, "raw": "0b_0_1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/output.json index 8775652f6e..90ccb24c12 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-96/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:8)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "extra": { "rawValue": 3, "raw": "0b_01_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/output.json index 8427ff4fef..d354fd52d7 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-97/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "extra": { "rawValue": 3, "raw": "0b01_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/output.json index ab96b90e5f..fb6a380124 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-98/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "extra": { "rawValue": 9, "raw": "0o1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/output.json index a3925ad6c8..a54bd3bbf5 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-99/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: A numeric separator is only allowed between two digits (1:3)", "SyntaxError: A numeric separator is only allowed between two digits (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "extra": { "rawValue": 9, "raw": "0o_1_1_" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/output.json index f47a3612a9..e0ca2b4b00 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-hex/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:4)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\x1_0", "extra": { "raw": "\"\\x1_0\"", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/output.json index b9271342b1..1d2d8a1aa2 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-leading-zero/output.json @@ -1,65 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Numeric separator can not be used after leading 0 (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 8, "raw": "0_8" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/output.json index 9677b88e4b..2571dfafd4 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-legacy-octal-literal/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Numeric separator can not be used after leading 0 (1:2)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 0, "raw": "00_0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/output.json index da24fe2bdd..1c28d1ead3 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-non-octal-decimal-int/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Numeric separator can not be used after leading 0 (1:2)", "SyntaxError: Invalid BigIntLiteral (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BigIntLiteral", - "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}}, "extra": { "rawValue": "080", "raw": "08_0n" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/output.json index b3d5564b94..8dbcd31afd 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode-2/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\u12_34", "extra": { "raw": "\"\\u12_34\"", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/output.json index e30a6e6b73..f7497689fd 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/invalid-unicode/output.json @@ -1,66 +1,22 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Numeric separators are not allowed inside unicode escape sequences or hex escape sequences (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "\\u{1F_639}", "extra": { "raw": "\"\\u{1F_639}\"", diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-0/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-0/output.json index f07811a91f..06face3b6e 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-0/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-0/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 11, "raw": "1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-1/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-1/output.json index 8ef9043d9f..9c8faafda7 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-1/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-1/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 11.11, "raw": "1_1.1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-10/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-10/output.json index 3bfad936fc..2a1e30bb67 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-10/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-10/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 171, "raw": "0xA_b" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-11/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-11/output.json index 27f38c5789..417231fb21 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-11/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-11/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 448585456, "raw": "0x1_a_b_c_d_e_f_0" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-12/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-12/output.json index f5d9d8f4e7..6ff730338e 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-12/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-12/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "0b01_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-13/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-13/output.json index 1e6a1e5b7b..216ca53415 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-13/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-13/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 3, "raw": "0b0_1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-14/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-14/output.json index 0562a2e1b5..ae85107199 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-14/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-14/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-15/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-15/output.json index 70fa1ecfe7..ca8a87f25d 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-15/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-15/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 9, "raw": "0o0_11" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-2/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-2/output.json index cb89d2e867..44c0e7ee2c 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-2/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-2/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 11.01, "raw": "1.1_0_1e1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-3/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-3/output.json index 8e6356f7c1..4e04af8dc4 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-3/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-3/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 11.01, "raw": "1.1_0_1E1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-4/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-4/output.json index 12a2e33585..5e0c2d44d9 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-4/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-4/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "NumericLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "extra": { "rawValue": 0.11, "raw": ".1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-5/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-5/output.json index 62e3ad2e4f..81326d22f8 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-5/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-5/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 17, "raw": "0x1_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-6/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-6/output.json index 5f3bb0f0c9..38a640ca3a 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-6/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-6/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 161, "raw": "0xa_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-7/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-7/output.json index b9e808d490..bf1fbf975e 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-7/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-7/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 161, "raw": "0xA_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-8/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-8/output.json index f060c82f7e..ae611586fb 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-8/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-8/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 417, "raw": "0x1_a_1" diff --git a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-9/output.json b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-9/output.json index c4a785b2ee..a01b262a87 100644 --- a/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-9/output.json +++ b/packages/babel-parser/test/fixtures/experimental/numeric-separator/valid-9/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 170, "raw": "0xA_a" diff --git a/packages/babel-parser/test/fixtures/experimental/partial-application/call-expr/output.json b/packages/babel-parser/test/fixtures/experimental/partial-application/call-expr/output.json index ac7ce3111b..970d655f0a 100644 --- a/packages/babel-parser/test/fixtures/experimental/partial-application/call-expr/output.json +++ b/packages/babel-parser/test/fixtures/experimental/partial-application/call-expr/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "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": "ArgumentPlaceholder", - "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}} } ] } @@ -96,4 +29,4 @@ ], "directives": [] } -} +} \ No newline at end of file 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 39bdbf7439..b6196e69a2 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 @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":10,"end":78,"loc":{"start":{"line":1,"column":10},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 16, - "end": 76, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":16,"end":76,"loc":{"start":{"line":2,"column":4},"end":{"line":4,"column":5}}, "static": false, "key": { "type": "Identifier", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "constructor" - }, + "start":16,"end":27,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":15},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -116,156 +37,44 @@ "params": [], "body": { "type": "BlockStatement", - "start": 30, - "end": 76, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":30,"end":76,"loc":{"start":{"line":2,"column":18},"end":{"line":4,"column":5}}, "body": [ { "type": "ExpressionStatement", - "start": 40, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 38 - } - }, + "start":40,"end":70,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":38}}, "expression": { "type": "CallExpression", - "start": 40, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 37 - } - }, + "start":40,"end":69,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":37}}, "callee": { "type": "Identifier", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "baz" - }, + "start":40,"end":43,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":11},"identifierName":"baz"}, "name": "baz" }, "arguments": [ { "type": "ThisExpression", - "start": 44, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 16 - } - } + "start":44,"end":48,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":16}} }, { "type": "ArrowFunctionExpression", - "start": 50, - "end": 68, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":50,"end":68,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":36}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "CallExpression", - "start": 56, - "end": 68, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":56,"end":68,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":36}}, "callee": { "type": "MemberExpression", - "start": 56, - "end": 65, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 33 - } - }, + "start":56,"end":65,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":33}}, "object": { "type": "Super", - "start": 56, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 29 - } - } + "start":56,"end":61,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":29}} }, "property": { "type": "Identifier", - "start": 62, - "end": 65, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 33 - }, - "identifierName": "bar" - }, + "start":62,"end":65,"loc":{"start":{"line":3,"column":30},"end":{"line":3,"column":33},"identifierName":"bar"}, "name": "bar" }, "computed": false @@ -273,18 +82,7 @@ "arguments": [ { "type": "ArgumentPlaceholder", - "start": 66, - "end": 67, - "loc": { - "start": { - "line": 3, - "column": 34 - }, - "end": { - "line": 3, - "column": 35 - } - } + "start":66,"end":67,"loc":{"start":{"line":3,"column":34},"end":{"line":3,"column":35}} } ] } @@ -302,4 +100,4 @@ ], "directives": [] } -} +} \ No newline at end of file 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 61338f1650..dd58d9538a 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 @@ -1,204 +1,57 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":16}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":16}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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": 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": "ArgumentPlaceholder", - "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}} }, { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, { "type": "ArgumentPlaceholder", - "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}} } ] } }, { "type": "ExpressionStatement", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":12,"end":28,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":16}}, "expression": { "type": "CallExpression", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":12,"end":28,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":16}}, "callee": { "type": "MemberExpression", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":12,"end":19,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":7}}, "object": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "bar" - }, + "start":12,"end":15,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3},"identifierName":"bar"}, "name": "bar" }, "property": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "foo" - }, + "start":16,"end":19,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"foo"}, "name": "foo" }, "computed": false @@ -206,50 +59,16 @@ "arguments": [ { "type": "ArgumentPlaceholder", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - } - } + "start":20,"end":21,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9}} }, { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 12 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":12},"identifierName":"x"}, "name": "x" }, { "type": "ArgumentPlaceholder", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - } - } + "start":26,"end":27,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}} } ] } @@ -257,4 +76,4 @@ ], "directives": [] } -} +} \ No newline at end of file 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 59529de050..50b9590533 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 @@ -1,189 +1,53 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "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": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, { "type": "ArgumentPlaceholder", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} } ] } }, { "type": "ExpressionStatement", - "start": 10, - "end": 22, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":10,"end":22,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "expression": { "type": "CallExpression", - "start": 10, - "end": 22, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":10,"end":22,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "callee": { "type": "MemberExpression", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":10,"end":17,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":7}}, "object": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "bar" - }, + "start":10,"end":13,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3},"identifierName":"bar"}, "name": "bar" }, "property": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"foo"}, "name": "foo" }, "computed": false @@ -191,35 +55,12 @@ "arguments": [ { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9},"identifierName":"x"}, "name": "x" }, { "type": "ArgumentPlaceholder", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - } - } + "start":20,"end":21,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11}} } ] } @@ -227,4 +68,4 @@ ], "directives": [] } -} +} \ No newline at end of file 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 3b558a170e..fec2b9a606 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 @@ -1,110 +1,31 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "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": "ArgumentPlaceholder", - "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}} }, { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" } ] @@ -112,78 +33,21 @@ }, { "type": "ExpressionStatement", - "start": 10, - "end": 22, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":10,"end":22,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "expression": { "type": "CallExpression", - "start": 10, - "end": 22, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":10,"end":22,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "callee": { "type": "MemberExpression", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":10,"end":17,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":7}}, "object": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "bar" - }, + "start":10,"end":13,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3},"identifierName":"bar"}, "name": "bar" }, "property": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7},"identifierName":"foo"}, "name": "foo" }, "computed": false @@ -191,34 +55,11 @@ "arguments": [ { "type": "ArgumentPlaceholder", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - } - } + "start":18,"end":19,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9}} }, { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" } ] @@ -227,4 +68,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/output.json b/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/output.json index 14f531a7e1..f92740eabc 100644 --- a/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/output.json +++ b/packages/babel-parser/test/fixtures/experimental/partial-application/in-SuperCall/output.json @@ -1,131 +1,40 @@ { "type": "File", - "start": 0, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":86,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ "SyntaxError: Unexpected argument placeholder (3:16)", "SyntaxError: Unexpected argument placeholder (3:19)" ], "program": { "type": "Program", - "start": 0, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":86,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":86,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "Bar" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"Bar"}, "name": "Bar" }, "body": { "type": "ClassBody", - "start": 22, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":22,"end":86,"loc":{"start":{"line":1,"column":22},"end":{"line":6,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 26, - "end": 84, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":26,"end":84,"loc":{"start":{"line":2,"column":2},"end":{"line":5,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 26, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":26,"end":37,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -136,112 +45,33 @@ "params": [ { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":38,"end":39,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x" } ], "body": { "type": "BlockStatement", - "start": 40, - "end": 84, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":40,"end":84,"loc":{"start":{"line":2,"column":16},"end":{"line":5,"column":3}}, "body": [ { "type": "ExpressionStatement", - "start": 46, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":46,"end":64,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":22}}, "expression": { "type": "CallExpression", - "start": 46, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":46,"end":63,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":21}}, "callee": { "type": "Super", - "start": 46, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 9 - } - } + "start":46,"end":51,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":9}} }, "arguments": [ { "type": "Identifier", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":52,"end":53,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" }, { "type": "NumericLiteral", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":55,"end":56,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":14}}, "extra": { "rawValue": 1, "raw": "1" @@ -250,129 +80,39 @@ }, { "type": "ArgumentPlaceholder", - "start": 58, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - } - } + "start":58,"end":59,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17}} }, { "type": "ArgumentPlaceholder", - "start": 61, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 20 - } - } + "start":61,"end":62,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":20}} } ] } }, { "type": "ExpressionStatement", - "start": 69, - "end": 80, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":69,"end":80,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}}, "expression": { "type": "AssignmentExpression", - "start": 69, - "end": 79, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":69,"end":79,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":14}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 69, - "end": 75, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":69,"end":75,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":10}}, "object": { "type": "ThisExpression", - "start": 69, - "end": 73, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 8 - } - } + "start":69,"end":73,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":8}} }, "property": { "type": "Identifier", - "start": 74, - "end": 75, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 10 - }, - "identifierName": "x" - }, + "start":74,"end":75,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10},"identifierName":"x"}, "name": "x" }, "computed": false }, "right": { "type": "Identifier", - "start": 78, - "end": 79, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 14 - }, - "identifierName": "x" - }, + "start":78,"end":79,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":14},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/output.json b/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/output.json index d12380e482..6b08f2e6eb 100644 --- a/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/output.json +++ b/packages/babel-parser/test/fixtures/experimental/partial-application/in-new/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Unexpected argument placeholder (1:11)", "SyntaxError: Unexpected argument placeholder (1:17)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "NewExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "callee": { "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" }, "arguments": [ { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" }, { "type": "ArgumentPlaceholder", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}} }, { "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" @@ -133,18 +43,7 @@ }, { "type": "ArgumentPlaceholder", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}} } ] } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body-with-operator/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body-with-operator/output.json index 0ed567f15e..f97121b437 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body-with-operator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body-with-operator/output.json @@ -1,227 +1,69 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "start": 5, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":5,"end":36,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":36}}, "left": { "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" }, "operator": "|>", "right": { "type": "ArrayExpression", - "start": 10, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":10,"end":36,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":36}}, "elements": [ { "type": "ArrowFunctionExpression", - "start": 11, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":11,"end":35,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":35}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "y" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"y"}, "name": "y" } ], "body": { "type": "BinaryExpression", - "start": 16, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":16,"end":35,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":35}}, "left": { "type": "BinaryExpression", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "left": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "y" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"y"}, "name": "y" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "extra": { "rawValue": 1, "raw": "1" @@ -232,86 +74,29 @@ "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 25, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":25,"end":35,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":35}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "z" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"z"}, "name": "z" } ], "body": { "type": "BinaryExpression", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35}}, "left": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "z" - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"z"}, "name": "z" }, "operator": "*", "right": { "type": "NumericLiteral", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body/output.json index ef37548ee9..1c99975018 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-array-in-body/output.json @@ -1,227 +1,69 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "start": 5, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":5,"end":36,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":36}}, "left": { "type": "BinaryExpression", - "start": 5, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":5,"end":22,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":22}}, "left": { "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" }, "operator": "|>", "right": { "type": "ArrayExpression", - "start": 10, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":10,"end":22,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":22}}, "elements": [ { "type": "ArrowFunctionExpression", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "y" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"y"}, "name": "y" } ], "body": { "type": "BinaryExpression", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "left": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "y" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"y"}, "name": "y" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "extra": { "rawValue": 1, "raw": "1" @@ -236,86 +78,29 @@ "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 26, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":26,"end":36,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":36}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "z" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"z"}, "name": "z" } ], "body": { "type": "BinaryExpression", - "start": 31, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":31,"end":36,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":36}}, "left": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "z" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"z"}, "name": "z" }, "operator": "*", "right": { "type": "NumericLiteral", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-assignment-in-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-assignment-in-body/output.json index 5f2e34747d..6ad681373f 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-assignment-in-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-assignment-in-body/output.json @@ -1,208 +1,61 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "start": 5, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":5,"end":27,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":27}}, "left": { "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" }, "operator": "|>", "right": { "type": "CallExpression", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":27}}, "callee": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "arguments": [ { "type": "AssignmentExpression", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "operator": "=", "left": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" }, "right": { "type": "BinaryExpression", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "left": { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 1, "raw": "1" @@ -212,19 +65,7 @@ "operator": "|>", "right": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "foo" - }, + "start":23,"end":26,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":26},"identifierName":"foo"}, "name": "foo" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body-with-operator/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body-with-operator/output.json index de81437144..b2433fa8b0 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body-with-operator/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body-with-operator/output.json @@ -1,261 +1,80 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "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": "x" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"x"}, "name": "x" }, "operator": "|>", "right": { "type": "ObjectExpression", - "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}}, "properties": [ { "type": "ObjectProperty", - "start": 12, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":12,"end":44,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":44}}, "method": false, "key": { "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "method" - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18},"identifierName":"method"}, "name": "method" }, "computed": false, "shorthand": false, "value": { "type": "ArrowFunctionExpression", - "start": 20, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":20,"end":44,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":44}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "y" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"y"}, "name": "y" } ], "body": { "type": "BinaryExpression", - "start": 25, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":25,"end":44,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":44}}, "left": { "type": "BinaryExpression", - "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}}, "left": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "y" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"y"}, "name": "y" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30}}, "extra": { "rawValue": 1, "raw": "1" @@ -266,86 +85,29 @@ "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 34, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":34,"end":44,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":44}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "z" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"z"}, "name": "z" } ], "body": { "type": "BinaryExpression", - "start": 39, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":39,"end":44,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":44}}, "left": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "z" - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"z"}, "name": "z" }, "operator": "*", "right": { "type": "NumericLiteral", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body/output.json index d1e39e6cce..a2e7f80458 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-and-object-in-body/output.json @@ -1,261 +1,80 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "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": "BinaryExpression", - "start": 5, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":5,"end":32,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":32}}, "left": { "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" }, "operator": "|>", "right": { "type": "ObjectExpression", - "start": 10, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":10,"end":32,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":32}}, "properties": [ { "type": "ObjectProperty", - "start": 12, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":12,"end":30,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":30}}, "method": false, "key": { "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "method" - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18},"identifierName":"method"}, "name": "method" }, "computed": false, "shorthand": false, "value": { "type": "ArrowFunctionExpression", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "y" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"y"}, "name": "y" } ], "body": { "type": "BinaryExpression", - "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}}, "left": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "y" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"y"}, "name": "y" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30}}, "extra": { "rawValue": 1, "raw": "1" @@ -271,86 +90,29 @@ "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 36, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":36,"end":46,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":46}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "z" - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37},"identifierName":"z"}, "name": "z" } ], "body": { "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": "z" - }, + "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42},"identifierName":"z"}, "name": "z" }, "operator": "*", "right": { "type": "NumericLiteral", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":45,"end":46,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":46}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head-indented/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head-indented/output.json index 4f7a815237..40519c9b38 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head-indented/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head-indented/output.json @@ -1,164 +1,50 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "start": 5, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":5,"end":23,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":23}}, "left": { "type": "BinaryExpression", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}}, "left": { "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" }, "operator": "|>", "right": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "inc" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"inc"}, "name": "inc" } }, "operator": "|>", "right": { "type": "Identifier", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "double" - }, + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23},"identifierName":"double"}, "name": "double" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head/output.json index 4f7a815237..40519c9b38 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-at-head/output.json @@ -1,164 +1,50 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "start": 5, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":5,"end":23,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":23}}, "left": { "type": "BinaryExpression", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}}, "left": { "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" }, "operator": "|>", "right": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "inc" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"inc"}, "name": "inc" } }, "operator": "|>", "right": { "type": "Identifier", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "double" - }, + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23},"identifierName":"double"}, "name": "double" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-alt-parens/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-alt-parens/output.json index fee1e93aba..a21637e0a1 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-alt-parens/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-alt-parens/output.json @@ -1,212 +1,65 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "start": 5, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":5,"end":38,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":38}}, "left": { "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" }, "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 11, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":11,"end":37,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":37}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "y" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"y"}, "name": "y" } ], "body": { "type": "BinaryExpression", - "start": 16, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":16,"end":37,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":37}}, "left": { "type": "BinaryExpression", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "left": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "y" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"y"}, "name": "y" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "extra": { "rawValue": 3, "raw": "3" @@ -217,87 +70,29 @@ "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 26, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":26,"end":36,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":36}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "b" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"b"}, "name": "b" } ], "body": { "type": "BinaryExpression", - "start": 31, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":31,"end":36,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":36}}, "left": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "y" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"y"}, "name": "y" }, "operator": "+", "right": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "b" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"b"}, "name": "b" } }, diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented-with-arg-parens/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented-with-arg-parens/output.json index 313e3fa4b8..24c9f9af57 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented-with-arg-parens/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented-with-arg-parens/output.json @@ -1,212 +1,65 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":17}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":17}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":17}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":17}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "start": 7, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":7,"end":44,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":17}}, "left": { "type": "BinaryExpression", - "start": 7, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":7,"end":26,"loc":{"start":{"line":1,"column":7},"end":{"line":2,"column":17}}, "left": { "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" }, "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":14,"end":26,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":17}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "y" - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"y"}, "name": "y" } ], "body": { "type": "BinaryExpression", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":21,"end":26,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":17}}, "left": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "y" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"y"}, "name": "y" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17}}, "extra": { "rawValue": 1, "raw": "1" @@ -219,86 +72,29 @@ "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 32, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":32,"end":44,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":17}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "z" - }, + "start":33,"end":34,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7},"identifierName":"z"}, "name": "z" } ], "body": { "type": "BinaryExpression", - "start": 39, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":39,"end":44,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":17}}, "left": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "z" - }, + "start":39,"end":40,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13},"identifierName":"z"}, "name": "z" }, "operator": "*", "right": { "type": "NumericLiteral", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":43,"end":44,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented/output.json index cf3c546e74..6bf47be1b3 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-indented/output.json @@ -1,212 +1,65 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":15}}, "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":15}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":15}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":15}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "start": 5, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":5,"end":38,"loc":{"start":{"line":1,"column":5},"end":{"line":3,"column":15}}, "left": { "type": "BinaryExpression", - "start": 5, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":5,"end":22,"loc":{"start":{"line":1,"column":5},"end":{"line":2,"column":15}}, "left": { "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" }, "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":12,"end":22,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":15}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "y" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"y"}, "name": "y" } ], "body": { "type": "BinaryExpression", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":17,"end":22,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":15}}, "left": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "y" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"y"}, "name": "y" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "extra": { "rawValue": 1, "raw": "1" @@ -219,86 +72,29 @@ "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 28, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":28,"end":38,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":15}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "z" - }, + "start":28,"end":29,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":6},"identifierName":"z"}, "name": "z" } ], "body": { "type": "BinaryExpression", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":33,"end":38,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":15}}, "left": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "z" - }, + "start":33,"end":34,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"z"}, "name": "z" }, "operator": "*", "right": { "type": "NumericLiteral", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":37,"end":38,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":15}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-with-arg-parens/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-with-arg-parens/output.json index 06ac009ecf..27d164f4e2 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-with-arg-parens/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens-with-arg-parens/output.json @@ -1,212 +1,65 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "start": 7, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":7,"end":40,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":40}}, "left": { "type": "BinaryExpression", - "start": 7, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":24}}, "left": { "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" }, "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "left": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "y" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"y"}, "name": "y" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "extra": { "rawValue": 1, "raw": "1" @@ -219,86 +72,29 @@ "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 28, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":28,"end":40,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":40}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "z" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"z"}, "name": "z" } ], "body": { "type": "BinaryExpression", - "start": 35, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":35,"end":40,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":40}}, "left": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "z" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"z"}, "name": "z" }, "operator": "*", "right": { "type": "NumericLiteral", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens/output.json index 31cd9f27dc..2580540480 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-arrow-in-body-no-parens/output.json @@ -1,212 +1,65 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "start": 5, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":5,"end":34,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":34}}, "left": { "type": "BinaryExpression", - "start": 5, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":5,"end":20,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":20}}, "left": { "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" }, "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "y" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"y"}, "name": "y" } ], "body": { "type": "BinaryExpression", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "left": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "y" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"y"}, "name": "y" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" @@ -219,86 +72,29 @@ "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 24, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":24,"end":34,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":34}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "z" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"z"}, "name": "z" } ], "body": { "type": "BinaryExpression", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":29,"end":34,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":34}}, "left": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "z" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"z"}, "name": "z" }, "operator": "*", "right": { "type": "NumericLiteral", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await-end/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await-end/output.json index 49c1e410dc..c3dac63fa7 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await-end/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await-end/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "test" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"test"}, "name": "test" }, "generator": false, @@ -65,79 +20,23 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":23,"end":47,"loc":{"start":{"line":1,"column":23},"end":{"line":3,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 27, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":27,"end":45,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "argument": { "type": "BinaryExpression", - "start": 34, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":34,"end":44,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":19}}, "left": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"x"}, "name": "x" }, "operator": "|>", "right": { "type": "AwaitExpression", - "start": 39, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 19 - } - } + "start":39,"end":44,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":19}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await/output.json index fa743ed7e4..07d38e5e38 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-await/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "test" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"test"}, "name": "test" }, "generator": false, @@ -65,111 +20,32 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":23,"end":52,"loc":{"start":{"line":1,"column":23},"end":{"line":3,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 27, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":27,"end":50,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":25}}, "argument": { "type": "BinaryExpression", - "start": 34, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":34,"end":49,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":24}}, "left": { "type": "BinaryExpression", - "start": 34, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":34,"end":44,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":19}}, "left": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"x"}, "name": "x" }, "operator": "|>", "right": { "type": "AwaitExpression", - "start": 39, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 19 - } - } + "start":39,"end":44,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":19}} } }, "operator": "|>", "right": { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "f" - }, + "start":48,"end":49,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":24},"identifierName":"f"}, "name": "f" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-base/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-base/output.json index fbf187592a..3660fb6254 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-base/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-base/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "a" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"a"}, "name": "a" }, "operator": "|>", "right": { "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" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-chain/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-chain/output.json index 797dec6733..7099351a2e 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-chain/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-fsharp-chain/output.json @@ -1,128 +1,37 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "left": { "type": "BinaryExpression", - "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}}, "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": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "inc" - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"inc"}, "name": "inc" } }, "operator": "|>", "right": { "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "double" - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18},"identifierName":"double"}, "name": "double" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-await-requires-parens/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-await-requires-parens/output.json index ca6d697c46..c18b78dc08 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-await-requires-parens/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-await-requires-parens/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,108 +20,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":21,"end":54,"loc":{"start":{"line":1,"column":21},"end":{"line":3,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 25, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":25,"end":52,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":29}}, "argument": { "type": "BinaryExpression", - "start": 32, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":32,"end":51,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":28}}, "left": { "type": "BinaryExpression", - "start": 32, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":32,"end":46,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":23}}, "left": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "a" - }, + "start":32,"end":33,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"a"}, "name": "a" }, "operator": "|>", "right": { "type": "AwaitExpression", - "start": 38, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":38,"end":45,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":22}}, "argument": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "f" - }, + "start":44,"end":45,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22},"identifierName":"f"}, "name": "f" }, "extra": { @@ -178,19 +54,7 @@ "operator": "|>", "right": { "type": "Identifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 28 - }, - "identifierName": "g" - }, + "start":50,"end":51,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":28},"identifierName":"g"}, "name": "g" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-base/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-base/output.json index fbf187592a..3660fb6254 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-base/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-base/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "a" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"a"}, "name": "a" }, "operator": "|>", "right": { "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" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-chain/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-chain/output.json index 4f7a815237..40519c9b38 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-chain/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-chain/output.json @@ -1,164 +1,50 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "start": 5, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":5,"end":23,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":23}}, "left": { "type": "BinaryExpression", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}}, "left": { "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" }, "operator": "|>", "right": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "inc" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"inc"}, "name": "inc" } }, "operator": "|>", "right": { "type": "Identifier", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "double" - }, + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23},"identifierName":"double"}, "name": "double" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-multiline/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-multiline/output.json index 8e5b517358..d4653c73e6 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-multiline/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-multiline/output.json @@ -1,136 +1,36 @@ { "type": "File", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":13}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":13}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 4, - "column": 12 - } - }, + "start":4,"end":64,"loc":{"start":{"line":1,"column":4},"end":{"line":4,"column":12}}, "id": { "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "result" - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10},"identifierName":"result"}, "name": "result" }, "init": { "type": "BinaryExpression", - "start": 13, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 4, - "column": 12 - } - }, + "start":13,"end":64,"loc":{"start":{"line":1,"column":13},"end":{"line":4,"column":12}}, "left": { "type": "BinaryExpression", - "start": 13, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":13,"end":51,"loc":{"start":{"line":1,"column":13},"end":{"line":3,"column":15}}, "left": { "type": "BinaryExpression", - "start": 13, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":13,"end":35,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":14}}, "left": { "type": "StringLiteral", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "extra": { "rawValue": "hello", "raw": "\"hello\"" @@ -140,57 +40,21 @@ "operator": "|>", "right": { "type": "Identifier", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "doubleSay" - }, + "start":26,"end":35,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":14},"identifierName":"doubleSay"}, "name": "doubleSay" } }, "operator": "|>", "right": { "type": "Identifier", - "start": 41, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "capitalize" - }, + "start":41,"end":51,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":15},"identifierName":"capitalize"}, "name": "capitalize" } }, "operator": "|>", "right": { "type": "Identifier", - "start": 57, - "end": 64, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 12 - }, - "identifierName": "exclaim" - }, + "start":57,"end":64,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":12},"identifierName":"exclaim"}, "name": "exclaim" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-precedence/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-precedence/output.json index 9a18738b06..62cfba2b16 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-precedence/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-precedence/output.json @@ -1,90 +1,24 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "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": "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" @@ -94,18 +28,7 @@ "operator": "||", "right": { "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": 9, "raw": "9" @@ -116,79 +39,23 @@ "operator": "|>", "right": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "inc" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"inc"}, "name": "inc" } } }, { "type": "ExpressionStatement", - "start": 15, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":15,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "expression": { "type": "BinaryExpression", - "start": 15, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":15,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "left": { "type": "BinaryExpression", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":15,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "left": { "type": "NumericLiteral", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":15,"end":17,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "extra": { "rawValue": 10, "raw": "10" @@ -198,51 +65,16 @@ "operator": "|>", "right": { "type": "LogicalExpression", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":21,"end":27,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":12}}, "left": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "f" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"f"}, "name": "f" }, "operator": "||", "right": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "h" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"h"}, "name": "h" } } @@ -250,19 +82,7 @@ "operator": "|>", "right": { "type": "Identifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "inc" - }, + "start":31,"end":34,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":19},"identifierName":"inc"}, "name": "inc" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow-parend-params/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow-parend-params/output.json index 620abadb05..0c2f55089a 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow-parend-params/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow-parend-params/output.json @@ -1,76 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "left": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 10, "raw": "10" @@ -80,86 +25,29 @@ "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x" } ], "body": { "type": "BinaryExpression", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "left": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow/output.json index 57c57f0f63..1ce20aa52e 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-minimal-with-arrow/output.json @@ -1,76 +1,21 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "left": { "type": "NumericLiteral", - "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}}, "extra": { "rawValue": 10, "raw": "10" @@ -80,86 +25,29 @@ "operator": "|>", "right": { "type": "ArrowFunctionExpression", - "start": 7, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":7,"end":17,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":17}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17}}, "left": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-multiline/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-multiline/output.json index 889bb7a69b..a5c71deace 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-multiline/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-multiline/output.json @@ -1,136 +1,36 @@ { "type": "File", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":15}}, "program": { "type": "Program", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":15}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":15}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":4,"end":67,"loc":{"start":{"line":1,"column":4},"end":{"line":4,"column":14}}, "id": { "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "result" - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10},"identifierName":"result"}, "name": "result" }, "init": { "type": "BinaryExpression", - "start": 13, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":13,"end":67,"loc":{"start":{"line":1,"column":13},"end":{"line":4,"column":14}}, "left": { "type": "BinaryExpression", - "start": 13, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":13,"end":52,"loc":{"start":{"line":1,"column":13},"end":{"line":3,"column":18}}, "left": { "type": "BinaryExpression", - "start": 13, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":13,"end":33,"loc":{"start":{"line":1,"column":13},"end":{"line":2,"column":12}}, "left": { "type": "StringLiteral", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "extra": { "rawValue": "hello", "raw": "\"hello\"" @@ -140,33 +40,10 @@ "operator": "|>", "right": { "type": "PipelineBareFunction", - "start": 24, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":24,"end":33,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":12}}, "callee": { "type": "Identifier", - "start": 24, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "doubleSay" - }, + "start":24,"end":33,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":12},"identifierName":"doubleSay"}, "name": "doubleSay" } } @@ -174,64 +51,18 @@ "operator": "|>", "right": { "type": "PipelineBareFunction", - "start": 37, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":37,"end":52,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":18}}, "callee": { "type": "MemberExpression", - "start": 37, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":37,"end":52,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":18}}, "object": { "type": "Identifier", - "start": 37, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "text" - }, + "start":37,"end":41,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":7},"identifierName":"text"}, "name": "text" }, "property": { "type": "Identifier", - "start": 42, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 18 - }, - "identifierName": "capitalize" - }, + "start":42,"end":52,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":18},"identifierName":"capitalize"}, "name": "capitalize" }, "computed": false @@ -241,97 +72,28 @@ "operator": "|>", "right": { "type": "PipelineBareFunction", - "start": 56, - "end": 67, - "loc": { - "start": { - "line": 4, - "column": 3 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":56,"end":67,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":14}}, "callee": { "type": "MemberExpression", - "start": 56, - "end": 67, - "loc": { - "start": { - "line": 4, - "column": 3 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":56,"end":67,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":14}}, "object": { "type": "MemberExpression", - "start": 56, - "end": 59, - "loc": { - "start": { - "line": 4, - "column": 3 - }, - "end": { - "line": 4, - "column": 6 - } - }, + "start":56,"end":59,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":6}}, "object": { "type": "Identifier", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 4, - "column": 3 - }, - "end": { - "line": 4, - "column": 4 - }, - "identifierName": "a" - }, + "start":56,"end":57,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":4},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 58, - "end": 59, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 6 - }, - "identifierName": "b" - }, + "start":58,"end":59,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":6},"identifierName":"b"}, "name": "b" }, "computed": false }, "property": { "type": "Identifier", - "start": 60, - "end": 67, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 14 - }, - "identifierName": "exclaim" - }, + "start":60,"end":67,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":14},"identifierName":"exclaim"}, "name": "exclaim" }, "computed": false diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-single-line-arrow-function/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-single-line-arrow-function/output.json index 71953d9db9..0827c20fe9 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-single-line-arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-chained,-single-line-arrow-function/output.json @@ -1,190 +1,54 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": null, "generator": false, "async": false, "params": [ { "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" } ], "body": { "type": "BinaryExpression", - "start": 5, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":5,"end":30,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":30}}, "left": { "type": "BinaryExpression", - "start": 5, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":5,"end":20,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":20}}, "left": { "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" }, "operator": "|>", "right": { "type": "PipelineBareFunction", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "callee": { "type": "MemberExpression", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "object": { "type": "Identifier", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "number" - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16},"identifierName":"number"}, "name": "number" }, "property": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "inc" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"inc"}, "name": "inc" }, "computed": false @@ -194,33 +58,10 @@ "operator": "|>", "right": { "type": "PipelineBareFunction", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}}, "callee": { "type": "Identifier", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "double" - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30},"identifierName":"double"}, "name": "double" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-identifier/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-identifier/output.json index 0aef90100f..2468104c68 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-identifier/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-identifier/output.json @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineBareFunction", - "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}}, "callee": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-property/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-property/output.json index 0fbd40308b..8ae28448c0 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-property/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-bare-style,-function-calls,-single,-property/output.json @@ -1,206 +1,58 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineBareFunction", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, "callee": { "type": "MemberExpression", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, "object": { "type": "MemberExpression", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "object": { "type": "MemberExpression", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "object": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "b" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"b"}, "name": "b" }, "computed": false }, "property": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "c" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"c"}, "name": "c" }, "computed": false }, "property": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "f" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"f"}, "name": "f" }, "computed": false diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/output.json index b061867026..21cf0ef977 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-bare-style,-head-with-topic-reference-pair/output.json @@ -1,94 +1,28 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Pipeline head should not be a comma-separated sequence expression (1:0)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "SequenceExpression", - "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}}, "expressions": [ { "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" @@ -97,18 +31,7 @@ }, { "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": 2, "raw": "2" @@ -124,33 +47,10 @@ "operator": "|>", "right": { "type": "PipelineBareFunction", - "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}}, "callee": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "f" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"f"}, "name": "f" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/output.json index 9aceb13325..d7262f7ab7 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-bare-style,-no-outer-topic-reference/output.json @@ -1,194 +1,58 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "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": "PipelineTopicExpression", - "start": 5, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":5,"end":18,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":18}}, "expression": { "type": "ArrowFunctionExpression", - "start": 6, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "$" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"$"}, "name": "$" } ], "body": { "type": "BinaryExpression", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "left": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "$" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"$"}, "name": "$" }, "operator": "|>", "right": { "type": "PipelineBareFunction", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "callee": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "f" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"f"}, "name": "f" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/output.json index a4b95926f3..e8ce055d0d 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-inner-topic-reference/output.json @@ -1,223 +1,66 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:16)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "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": "PipelineTopicExpression", - "start": 5, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":5,"end":22,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":22}}, "expression": { "type": "ArrowFunctionExpression", - "start": 6, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":6,"end":21,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":21}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "$" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"$"}, "name": "$" } ], "body": { "type": "BinaryExpression", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21}}, "left": { "type": "PipelinePrimaryTopicReference", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}} }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "expression": { "type": "BinaryExpression", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "left": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "$" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"$"}, "name": "$" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/output.json index 257c98280e..1c55597d1e 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-arrow-function-with-topic-style,-no-outer-topic-reference/output.json @@ -1,193 +1,58 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "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": "PipelineTopicExpression", - "start": 5, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":5,"end":18,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":18}}, "expression": { "type": "ArrowFunctionExpression", - "start": 6, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "$" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"$"}, "name": "$" } ], "body": { "type": "BinaryExpression", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "left": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "$" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"$"}, "name": "$" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "expression": { "type": "PipelinePrimaryTopicReference", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}} } } }, diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/output.json index 5644ff0140..4e08420cc8 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-inner-topic-reference/output.json @@ -1,170 +1,47 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:11)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "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": "PipelineTopicExpression", - "start": 5, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":5,"end":15,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":15}}, "expression": { "type": "BinaryExpression", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "left": { "type": "PipelinePrimaryTopicReference", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "expression": { "type": "CallExpression", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "callee": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "f" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"f"}, "name": "f" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/output.json index f274dbc1ad..9c89df8ebf 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-nested-pipelines,-topic-style-with-inner-topic-style,-no-outer-topic-reference/output.json @@ -1,158 +1,45 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "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": "PipelineTopicExpression", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}}, "expression": { "type": "BinaryExpression", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "left": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "$" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"$"}, "name": "$" }, "operator": "|>", "right": { "type": "PipelineBareFunction", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "callee": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "f" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"f"}, "name": "f" } }, diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/output.json index b0b8ec5955..f4a75092e3 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-followed-by-bare-style-pipeline-body/output.json @@ -1,93 +1,27 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Pipeline body may not be a comma-separated sequence expression (1:6)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "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": "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": "NumericLiteral", - "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}}, "extra": { "rawValue": 10, "raw": "10" @@ -97,62 +31,18 @@ "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "expression": { "type": "SequenceExpression", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "expressions": [ { "type": "PipelinePrimaryTopicReference", - "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}} }, { "type": "PipelinePrimaryTopicReference", - "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": { @@ -165,33 +55,10 @@ "operator": "|>", "right": { "type": "PipelineBareFunction", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "callee": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "h" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"h"}, "name": "h" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/output.json index 89c673d0bc..c774d9cb44 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-sequence-style,-body-with-topic-reference-pair-then-end/output.json @@ -1,79 +1,24 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Pipeline body may not be a comma-separated sequence expression (1:6)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "NumericLiteral", - "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}}, "extra": { "rawValue": 10, "raw": "10" @@ -83,62 +28,18 @@ "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "expression": { "type": "SequenceExpression", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "expressions": [ { "type": "PipelinePrimaryTopicReference", - "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}} }, { "type": "PipelinePrimaryTopicReference", - "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": { diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json index feca14ebaf..556699d07a 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-computed,-no-topic-reference/output.json @@ -1,143 +1,41 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "expression": { "type": "MemberExpression", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "object": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "property": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "b" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"b"}, "name": "b" }, "computed": true diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json index c1399c71af..6e09acd357 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-addition/output.json @@ -1,144 +1,42 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "expression": { "type": "BinaryExpression", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "left": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "operator": "+", "right": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "b" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"b"}, "name": "b" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json index da79f8d294..4c0d88c5a7 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-class-expression/output.json @@ -1,127 +1,38 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "expression": { "type": "ClassExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json index 63e37b4604..18fa5a9166 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-no-topic-reference,-function-expression/output.json @@ -1,162 +1,50 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "errors": [ "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33}}, "expression": { "type": "FunctionExpression", - "start": 9, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "x" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"x"}, "name": "x" } ], "body": { "type": "BlockStatement", - "start": 22, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":22,"end":33,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":33}}, "body": [ { "type": "ReturnStatement", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}}, "argument": null } ], diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/output.json index 95125a326a..06a45df42f 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-body/output.json @@ -1,250 +1,71 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "errors": [ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:22)", "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":9,"end":42,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":42}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":9,"end":42,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":42}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":12,"end":42,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":42}}, "body": [ { "type": "DoWhileStatement", - "start": 14, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":14,"end":40,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":40}}, "body": { "type": "ExpressionStatement", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}}, "expression": { "type": "AssignmentExpression", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}}, "operator": "+=", "left": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"x"}, "name": "x" }, "right": { "type": "PipelinePrimaryTopicReference", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}} } } }, "test": { "type": "BinaryExpression", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}}, "left": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "x" - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"x"}, "name": "x" }, "operator": "<", "right": { "type": "NumericLiteral", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38}}, "extra": { "rawValue": 50, "raw": "50" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/output.json index 372a871e8b..e673a7df67 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-body/output.json @@ -1,67 +1,22 @@ { "type": "File", - "start": 0, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":77,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Topic reference was used in a lexical context without topic binding (2:48)", "SyntaxError: Pipeline is in topic style but does not use topic reference (2:11)" ], "program": { "type": "Program", - "start": 0, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":77,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":77,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "af" - }, + "start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17},"identifierName":"af"}, "name": "af" }, "generator": false, @@ -69,167 +24,44 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":21,"end":77,"loc":{"start":{"line":1,"column":21},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 25, - "end": 75, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 52 - } - }, + "start":25,"end":75,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":52}}, "expression": { "type": "BinaryExpression", - "start": 25, - "end": 75, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 52 - } - }, + "start":25,"end":75,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":52}}, "left": { "type": "Identifier", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "value" - }, + "start":25,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 34, - "end": 75, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 52 - } - }, + "start":34,"end":75,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":52}}, "expression": { "type": "DoExpression", - "start": 34, - "end": 75, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 52 - } - }, + "start":34,"end":75,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":52}}, "body": { "type": "BlockStatement", - "start": 37, - "end": 75, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 52 - } - }, + "start":37,"end":75,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":52}}, "body": [ { "type": "ForOfStatement", - "start": 39, - "end": 73, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 50 - } - }, + "start":39,"end":73,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":50}}, "await": true, "left": { "type": "VariableDeclaration", - "start": 50, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":50,"end":57,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 33 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":56,"end":57,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":34}}, "id": { "type": "Identifier", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 33 - }, - "end": { - "line": 2, - "column": 34 - }, - "identifierName": "e" - }, + "start":56,"end":57,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":34},"identifierName":"e"}, "name": "e" }, "init": null @@ -239,49 +71,15 @@ }, "right": { "type": "Identifier", - "start": 61, - "end": 69, - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 2, - "column": 46 - }, - "identifierName": "sequence" - }, + "start":61,"end":69,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":46},"identifierName":"sequence"}, "name": "sequence" }, "body": { "type": "ExpressionStatement", - "start": 71, - "end": 73, - "loc": { - "start": { - "line": 2, - "column": 48 - }, - "end": { - "line": 2, - "column": 50 - } - }, + "start":71,"end":73,"loc":{"start":{"line":2,"column":48},"end":{"line":2,"column":50}}, "expression": { "type": "PipelinePrimaryTopicReference", - "start": 71, - "end": 72, - "loc": { - "start": { - "line": 2, - "column": 48 - }, - "end": { - "line": 2, - "column": 49 - } - } + "start":71,"end":72,"loc":{"start":{"line":2,"column":48},"end":{"line":2,"column":49}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/output.json index 58ca8064b5..b413aeb837 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-body/output.json @@ -1,201 +1,56 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "errors": [ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:45)", "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":9,"end":49,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":49}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":9,"end":49,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":49}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":12,"end":49,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":49}}, "body": [ { "type": "ForStatement", - "start": 14, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":14,"end":47,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":47}}, "init": { "type": "VariableDeclaration", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":19,"end":28,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "i" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"i"}, "name": "i" }, "init": { "type": "NumericLiteral", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28}}, "extra": { "rawValue": 0, "raw": "0" @@ -208,100 +63,31 @@ }, "test": { "type": "BinaryExpression", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35}}, "left": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "i" - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"i"}, "name": "i" }, "operator": "<", "right": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "n" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"n"}, "name": "n" } }, "update": { "type": "AssignmentExpression", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43}}, "operator": "+=", "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" }, "right": { "type": "NumericLiteral", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43}}, "extra": { "rawValue": 1, "raw": "1" @@ -311,32 +97,10 @@ }, "body": { "type": "ExpressionStatement", - "start": 45, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":45,"end":47,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":47}}, "expression": { "type": "PipelinePrimaryTopicReference", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 46 - } - } + "start":45,"end":46,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":46}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/output.json index 6f19747912..f907f6c39b 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-body/output.json @@ -1,203 +1,57 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:32)", "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":9,"end":36,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":36}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":9,"end":36,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":36}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":12,"end":36,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":36}}, "body": [ { "type": "ForInStatement", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":14,"end":34,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":34}}, "left": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "e" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"e"}, "name": "e" }, "right": { "type": "Identifier", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "object" - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30},"identifierName":"object"}, "name": "object" }, "body": { "type": "ExpressionStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "expression": { "type": "PipelinePrimaryTopicReference", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - } - } + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/output.json index b4bdcb7bcd..b5610cbd55 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-body/output.json @@ -1,204 +1,58 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:34)", "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":9,"end":38,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":38}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":9,"end":38,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":38}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":12,"end":38,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":38}}, "body": [ { "type": "ForOfStatement", - "start": 14, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":14,"end":36,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":36}}, "await": false, "left": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "e" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"e"}, "name": "e" }, "right": { "type": "Identifier", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "sequence" - }, + "start":24,"end":32,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":32},"identifierName":"sequence"}, "name": "sequence" }, "body": { "type": "ExpressionStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "expression": { "type": "PipelinePrimaryTopicReference", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/output.json index f168982f9d..cd596f541b 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-try-statement,-outer-topic-reference-in-catch-clause/output.json @@ -1,229 +1,61 @@ { "type": "File", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Topic reference was used in a lexical context without topic binding (3:32)" ], "program": { "type": "Program", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":9,"end":78,"loc":{"start":{"line":1,"column":9},"end":{"line":4,"column":1}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":9,"end":78,"loc":{"start":{"line":1,"column":9},"end":{"line":4,"column":1}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":12,"end":78,"loc":{"start":{"line":1,"column":12},"end":{"line":4,"column":1}}, "body": [ { "type": "TryStatement", - "start": 16, - "end": 76, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 37 - } - }, + "start":16,"end":76,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":37}}, "block": { "type": "BlockStatement", - "start": 20, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":20,"end":38,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":24}}, "body": [ { "type": "ExpressionStatement", - "start": 22, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":22,"end":36,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":22}}, "expression": { "type": "CallExpression", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":22,"end":35,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":21}}, "callee": { "type": "MemberExpression", - "start": 22, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":22,"end":32,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":18}}, "object": { "type": "Identifier", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "JSON" - }, + "start":22,"end":26,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":12},"identifierName":"JSON"}, "name": "JSON" }, "property": { "type": "Identifier", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "parse" - }, + "start":27,"end":32,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18},"identifierName":"parse"}, "name": "parse" }, "computed": false @@ -231,18 +63,7 @@ "arguments": [ { "type": "PipelinePrimaryTopicReference", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - } - } + "start":33,"end":34,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20}} } ] } @@ -252,124 +73,33 @@ }, "handler": { "type": "CatchClause", - "start": 41, - "end": 76, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 37 - } - }, + "start":41,"end":76,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":37}}, "param": { "type": "Identifier", - "start": 48, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 14 - }, - "identifierName": "error" - }, + "start":48,"end":53,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":14},"identifierName":"error"}, "name": "error" }, "body": { "type": "BlockStatement", - "start": 55, - "end": 76, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 37 - } - }, + "start":55,"end":76,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":37}}, "body": [ { "type": "ExpressionStatement", - "start": 57, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":57,"end":74,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":35}}, "expression": { "type": "CallExpression", - "start": 57, - "end": 73, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 34 - } - }, + "start":57,"end":73,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":34}}, "callee": { "type": "MemberExpression", - "start": 57, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 31 - } - }, + "start":57,"end":70,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":31}}, "object": { "type": "Identifier", - "start": 57, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 25 - }, - "identifierName": "console" - }, + "start":57,"end":64,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":25},"identifierName":"console"}, "name": "console" }, "property": { "type": "Identifier", - "start": 65, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 26 - }, - "end": { - "line": 3, - "column": 31 - }, - "identifierName": "error" - }, + "start":65,"end":70,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":31},"identifierName":"error"}, "name": "error" }, "computed": false @@ -377,18 +107,7 @@ "arguments": [ { "type": "PipelinePrimaryTopicReference", - "start": 71, - "end": 72, - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 33 - } - } + "start":71,"end":72,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":33}} } ] } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/output.json index 899a066505..cde715cc8a 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-while-loop,-outer-topic-reference-in-loop-body/output.json @@ -1,187 +1,53 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:34)", "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":9,"end":38,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":38}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":9,"end":38,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":38}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":12,"end":38,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":38}}, "body": [ { "type": "WhileStatement", - "start": 14, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":14,"end":36,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":36}}, "test": { "type": "BinaryExpression", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}}, "left": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"x"}, "name": "x" }, "operator": "<", "right": { "type": "NumericLiteral", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "extra": { "rawValue": 50, "raw": "50" @@ -191,64 +57,19 @@ }, "body": { "type": "ExpressionStatement", - "start": 29, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":29,"end":36,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":36}}, "expression": { "type": "AssignmentExpression", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":29,"end":35,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":35}}, "operator": "+=", "left": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "x" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"x"}, "name": "x" }, "right": { "type": "PipelinePrimaryTopicReference", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/output.json index a185b59836..10719f0083 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-topic-style,-unbound-topic,-do-expression,-with-statement,-outer-topic-reference-in-with-body/output.json @@ -1,185 +1,52 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:24)", "SyntaxError: Pipeline is in topic style but does not use topic reference (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":9,"end":28,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":28}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":9,"end":28,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":28}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":12,"end":28,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":28}}, "body": [ { "type": "WithStatement", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "object": { "type": "ObjectExpression", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "properties": [] }, "body": { "type": "ExpressionStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "expression": { "type": "PipelinePrimaryTopicReference", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/output.json index 64fb49d735..499705448d 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-class-in-pipeline-body/output.json @@ -1,159 +1,47 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:39)", "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "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": "PipelineTopicExpression", - "start": 5, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":5,"end":45,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":45}}, "expression": { "type": "ClassExpression", - "start": 5, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":5,"end":45,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":45}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "start": 11, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":11,"end":45,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":45}}, "body": [ { "type": "ClassMethod", - "start": 13, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":13,"end":43,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":43}}, "static": false, "key": { "type": "Identifier", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "constructor" - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -164,110 +52,32 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":28,"end":43,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":43}}, "body": [ { "type": "ExpressionStatement", - "start": 30, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":30,"end":41,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":41}}, "expression": { "type": "AssignmentExpression", - "start": 30, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":30,"end":40,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":40}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}}, "object": { "type": "ThisExpression", - "start": 30, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 34 - } - } + "start":30,"end":34,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":34}} }, "property": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "x" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"x"}, "name": "x" }, "computed": false }, "right": { "type": "PipelinePrimaryTopicReference", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - } - } + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/output.json index df16ab34e4..1aa91e74b1 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-inner-function-in-pipeline-body/output.json @@ -1,159 +1,48 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:19)", "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "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": "PipelineTopicExpression", - "start": 5, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":5,"end":22,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":22}}, "expression": { "type": "FunctionExpression", - "start": 5, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":5,"end":22,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":22}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "expression": { "type": "PipelinePrimaryTopicReference", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}} } } ], diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/output.json index 0023723944..6c2b7a1acf 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-error,-unbound-topic,-pipeline-head-in-inner-function-in-pipeline-body/output.json @@ -1,203 +1,59 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ "SyntaxError: Topic reference was used in a lexical context without topic binding (1:19)", "SyntaxError: Pipeline is in topic style but does not use topic reference (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "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": "PipelineTopicExpression", - "start": 5, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":5,"end":27,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":27}}, "expression": { "type": "FunctionExpression", - "start": 5, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":5,"end":27,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":27}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 17, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":17,"end":27,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":27}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}}, "expression": { "type": "BinaryExpression", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}}, "left": { "type": "PipelinePrimaryTopicReference", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}} }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}}, "expression": { "type": "PipelinePrimaryTopicReference", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-bare-style/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-bare-style/output.json index 20fef485fd..2aeb5206b5 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-bare-style/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-bare-style/output.json @@ -1,171 +1,48 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "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": "PipelineTopicExpression", - "start": 5, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":5,"end":19,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":19}}, "expression": { "type": "ArrowFunctionExpression", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BinaryExpression", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}}, "left": { "type": "PipelinePrimaryTopicReference", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}} }, "operator": "|>", "right": { "type": "PipelineBareFunction", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "callee": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "f" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"f"}, "name": "f" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-topic-style/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-topic-style/output.json index ae7bef130c..c110c8d178 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-topic-style/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-arrow-function-with-topic-style/output.json @@ -1,236 +1,67 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "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": "PipelineTopicExpression", - "start": 5, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":5,"end":24,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":24}}, "expression": { "type": "ArrowFunctionExpression", - "start": 6, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":6,"end":23,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":23}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "$" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"$"}, "name": "$" } ], "body": { "type": "BinaryExpression", - "start": 11, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":11,"end":23,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":23}}, "left": { "type": "PipelinePrimaryTopicReference", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}} }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":16,"end":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23}}, "expression": { "type": "CallExpression", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":16,"end":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23}}, "callee": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "f" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "PipelinePrimaryTopicReference", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}} }, { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "$" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"$"}, "name": "$" } ] diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-bare-style/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-bare-style/output.json index 51d79d3318..4259a597ed 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-bare-style/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-bare-style/output.json @@ -1,153 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "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": "PipelineTopicExpression", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}}, "expression": { "type": "BinaryExpression", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "left": { "type": "PipelinePrimaryTopicReference", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} }, "operator": "|>", "right": { "type": "PipelineBareFunction", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "callee": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "f" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"f"}, "name": "f" } }, diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-topic-style/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-topic-style/output.json index 7b38baf900..a2fd989f47 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-topic-style/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-nested-pipelines,-topic-style-with-inner-topic-style/output.json @@ -1,200 +1,54 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "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": "PipelineTopicExpression", - "start": 5, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":5,"end":19,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":19}}, "expression": { "type": "BinaryExpression", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, "left": { "type": "PipelinePrimaryTopicReference", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 11, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18}}, "expression": { "type": "CallExpression", - "start": 11, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18}}, "callee": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "f" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "PipelinePrimaryTopicReference", - "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}} }, { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "x" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"x"}, "name": "x" } ] diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-first/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-first/output.json index 195e3bb795..06531b72d5 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-first/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-first/output.json @@ -1,138 +1,38 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "expression": { "type": "BinaryExpression", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "left": { "type": "PipelinePrimaryTopicReference", - "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}} }, "operator": "+", "right": { "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": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-last/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-last/output.json index 3a206964c2..524d6e4d87 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-last/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-addition,-single-line-arrow-function,-topic-reference-last/output.json @@ -1,122 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "expression": { "type": "BinaryExpression", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "left": { "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" @@ -126,18 +37,7 @@ "operator": "+", "right": { "type": "PipelinePrimaryTopicReference", - "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}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/output.json index 9337eb29bf..248522740c 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-async-await/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "f" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,107 +20,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":20,"end":46,"loc":{"start":{"line":1,"column":20},"end":{"line":3,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 24, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":24,"end":44,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":22}}, "argument": { "type": "BinaryExpression", - "start": 31, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":31,"end":43,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":21}}, "left": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "x" - }, + "start":31,"end":32,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"x"}, "name": "x" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 36, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":36,"end":43,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":21}}, "expression": { "type": "AwaitExpression", - "start": 36, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":36,"end":43,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":21}}, "argument": { "type": "PipelinePrimaryTopicReference", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 21 - } - } + "start":42,"end":43,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":21}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-head/output.json index 18b3068859..0321177a10 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-head/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-do-while-loop,-outer-topic-reference-in-loop-head/output.json @@ -1,197 +1,52 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":9,"end":41,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":41}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":9,"end":41,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":41}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":12,"end":41,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":41}}, "body": [ { "type": "DoWhileStatement", - "start": 14, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":14,"end":39,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":39}}, "body": { "type": "ExpressionStatement", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}}, "expression": { "type": "AssignmentExpression", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}}, "operator": "+=", "left": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "x" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, "extra": { "rawValue": 1, "raw": "1" @@ -202,50 +57,16 @@ }, "test": { "type": "BinaryExpression", - "start": 32, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":32,"end":37,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":37}}, "left": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "x" - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"x"}, "name": "x" }, "operator": "<", "right": { "type": "PipelinePrimaryTopicReference", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-head/output.json index 15b7a61ce7..aebaee1b7d 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-head/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-await-of-loop,-outer-topic-reference-in-loop-head/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "af" - }, + "start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17},"identifierName":"af"}, "name": "af" }, "generator": false, @@ -65,167 +20,44 @@ "params": [], "body": { "type": "BlockStatement", - "start": 21, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":21,"end":70,"loc":{"start":{"line":1,"column":21},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 25, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 45 - } - }, + "start":25,"end":68,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":45}}, "expression": { "type": "BinaryExpression", - "start": 25, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 45 - } - }, + "start":25,"end":68,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":45}}, "left": { "type": "Identifier", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "value" - }, + "start":25,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 34, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 45 - } - }, + "start":34,"end":68,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":45}}, "expression": { "type": "DoExpression", - "start": 34, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 45 - } - }, + "start":34,"end":68,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":45}}, "body": { "type": "BlockStatement", - "start": 37, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 45 - } - }, + "start":37,"end":68,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":45}}, "body": [ { "type": "ForOfStatement", - "start": 39, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 43 - } - }, + "start":39,"end":66,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":43}}, "await": true, "left": { "type": "VariableDeclaration", - "start": 50, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":50,"end":57,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 33 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":56,"end":57,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":34}}, "id": { "type": "Identifier", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 33 - }, - "end": { - "line": 2, - "column": 34 - }, - "identifierName": "e" - }, + "start":56,"end":57,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":34},"identifierName":"e"}, "name": "e" }, "init": null @@ -235,48 +67,14 @@ }, "right": { "type": "PipelinePrimaryTopicReference", - "start": 61, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 2, - "column": 39 - } - } + "start":61,"end":62,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":39}} }, "body": { "type": "ExpressionStatement", - "start": 64, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 41 - }, - "end": { - "line": 2, - "column": 43 - } - }, + "start":64,"end":66,"loc":{"start":{"line":2,"column":41},"end":{"line":2,"column":43}}, "expression": { "type": "Identifier", - "start": 64, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 41 - }, - "end": { - "line": 2, - "column": 42 - }, - "identifierName": "e" - }, + "start":64,"end":65,"loc":{"start":{"line":2,"column":41},"end":{"line":2,"column":42},"identifierName":"e"}, "name": "e" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-head/output.json index 2fb6945eeb..a6331818eb 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-head/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-classic-loop,-outer-topic-reference-in-loop-head/output.json @@ -1,197 +1,52 @@ { "type": "File", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "program": { "type": "Program", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":9,"end":59,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":59}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":9,"end":59,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":59}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":12,"end":59,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":59}}, "body": [ { "type": "ForStatement", - "start": 14, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":14,"end":57,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":57}}, "init": { "type": "VariableDeclaration", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":19,"end":28,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "i" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"i"}, "name": "i" }, "init": { "type": "PipelinePrimaryTopicReference", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28}} } } ], @@ -199,147 +54,44 @@ }, "test": { "type": "CallExpression", - "start": 30, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":30,"end":45,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":45}}, "callee": { "type": "Identifier", - "start": 30, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "predicate" - }, + "start":30,"end":39,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":39},"identifierName":"predicate"}, "name": "predicate" }, "arguments": [ { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "i" - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"i"}, "name": "i" }, { "type": "PipelinePrimaryTopicReference", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - } - } + "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44}} } ] }, "update": { "type": "AssignmentExpression", - "start": 47, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":47,"end":53,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":53}}, "operator": "+=", "left": { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "i" - }, + "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48},"identifierName":"i"}, "name": "i" }, "right": { "type": "PipelinePrimaryTopicReference", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 53 - } - } + "start":52,"end":53,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":53}} } }, "body": { "type": "ExpressionStatement", - "start": 55, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":55,"end":57,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":57}}, "expression": { "type": "Identifier", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 56 - }, - "identifierName": "i" - }, + "start":55,"end":56,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":56},"identifierName":"i"}, "name": "i" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-head/output.json index 4571a8f3b9..e3b406e4da 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-head/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-in-loop,-outer-topic-reference-in-loop-head/output.json @@ -1,198 +1,52 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":12,"end":31,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":31}}, "body": [ { "type": "ForInStatement", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "left": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "e" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"e"}, "name": "e" }, "right": { "type": "PipelinePrimaryTopicReference", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}} }, "body": { "type": "ExpressionStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "expression": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "e" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"e"}, "name": "e" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-head/output.json index 25757328eb..297a910a32 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-head/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-for-of-loop,-outer-topic-reference-in-loop-head/output.json @@ -1,199 +1,53 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":12,"end":31,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":31}}, "body": [ { "type": "ForOfStatement", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "await": false, "left": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "e" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"e"}, "name": "e" }, "right": { "type": "PipelinePrimaryTopicReference", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}} }, "body": { "type": "ExpressionStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "expression": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "e" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"e"}, "name": "e" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-identity/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-identity/output.json index d0c29a3cc7..d90e701dc4 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-identity/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-identity/output.json @@ -1,151 +1,40 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}}, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "expression": { "type": "PipelinePrimaryTopicReference", - "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}} } } ], diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-body/output.json index be74d493c2..57f62fe4a6 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-body/output.json @@ -1,243 +1,64 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":9,"end":46,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":46}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":9,"end":46,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":46}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":12,"end":46,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":46}}, "body": [ { "type": "IfStatement", - "start": 14, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":14,"end":44,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":44}}, "test": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "yes" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"yes"}, "name": "yes" }, "consequent": { "type": "ExpressionStatement", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "expression": { "type": "NullLiteral", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27}} } }, "alternate": { "type": "IfStatement", - "start": 34, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":34,"end":44,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":44}}, "test": { "type": "Identifier", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "no" - }, + "start":38,"end":40,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":40},"identifierName":"no"}, "name": "no" }, "consequent": { "type": "ExpressionStatement", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":42,"end":44,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":44}}, "expression": { "type": "PipelinePrimaryTopicReference", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - } - } + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43}} } }, "alternate": null diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-if-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-if-body/output.json index eb53ce59a7..2c33b45a64 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-if-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-else-if-body/output.json @@ -1,212 +1,56 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":9,"end":38,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":38}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":9,"end":38,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":38}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":12,"end":38,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":38}}, "body": [ { "type": "IfStatement", - "start": 14, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":14,"end":36,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":36}}, "test": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "yes" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"yes"}, "name": "yes" }, "consequent": { "type": "ExpressionStatement", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "expression": { "type": "NullLiteral", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27}} } }, "alternate": { "type": "ExpressionStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "expression": { "type": "PipelinePrimaryTopicReference", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-body/output.json index 501bbac6fa..a2a0ef2bc6 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-body/output.json @@ -1,182 +1,48 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":9,"end":27,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":27}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":9,"end":27,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":27}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":12,"end":27,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":27}}, "body": [ { "type": "IfStatement", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":14,"end":25,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":25}}, "test": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "yes" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"yes"}, "name": "yes" }, "consequent": { "type": "ExpressionStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "expression": { "type": "PipelinePrimaryTopicReference", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} } }, "alternate": null diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-head/output.json index e2fb435ec8..e966a43e47 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-head/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-if-statement,-outer-topic-reference-in-if-head/output.json @@ -1,180 +1,47 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":12,"end":33,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":33}}, "body": [ { "type": "IfStatement", - "start": 14, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":14,"end":31,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":31}}, "test": { "type": "PipelinePrimaryTopicReference", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}} }, "consequent": { "type": "ExpressionStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "expression": { "type": "NumericLiteral", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}}, "extra": { "rawValue": 1, "raw": "1" @@ -184,32 +51,10 @@ }, "alternate": { "type": "ExpressionStatement", - "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}}, "expression": { "type": "NumericLiteral", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-body/output.json index 7ab18f8fbc..6ea4db4a6f 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-body/output.json @@ -1,215 +1,59 @@ { "type": "File", - "start": 0, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":9,"end":94,"loc":{"start":{"line":1,"column":9},"end":{"line":7,"column":1}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":9,"end":94,"loc":{"start":{"line":1,"column":9},"end":{"line":7,"column":1}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":12,"end":94,"loc":{"start":{"line":1,"column":12},"end":{"line":7,"column":1}}, "body": [ { "type": "SwitchStatement", - "start": 16, - "end": 92, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":16,"end":92,"loc":{"start":{"line":2,"column":2},"end":{"line":6,"column":3}}, "discriminant": { "type": "Identifier", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "number" - }, + "start":24,"end":30,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16},"identifierName":"number"}, "name": "number" }, "cases": [ { "type": "SwitchCase", - "start": 38, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":38,"end":48,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":14}}, "consequent": [ { "type": "ExpressionStatement", - "start": 46, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":46,"end":48,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":14}}, "expression": { "type": "PipelinePrimaryTopicReference", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":46,"end":47,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}} } } ], "test": { "type": "NumericLiteral", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":43,"end":44,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, "extra": { "rawValue": 0, "raw": "0" @@ -219,77 +63,22 @@ }, { "type": "SwitchCase", - "start": 53, - "end": 67, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":53,"end":67,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":18}}, "consequent": [ { "type": "ExpressionStatement", - "start": 61, - "end": 67, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":61,"end":67,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":18}}, "expression": { "type": "BinaryExpression", - "start": 61, - "end": 66, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 17 - } - }, + "start":61,"end":66,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":17}}, "left": { "type": "PipelinePrimaryTopicReference", - "start": 61, - "end": 62, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 13 - } - } + "start":61,"end":62,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":13}} }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 65, - "end": 66, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 17 - } - }, + "start":65,"end":66,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":17}}, "extra": { "rawValue": 1, "raw": "1" @@ -301,18 +90,7 @@ ], "test": { "type": "NumericLiteral", - "start": 58, - "end": 59, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":58,"end":59,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10}}, "extra": { "rawValue": 1, "raw": "1" @@ -322,77 +100,22 @@ }, { "type": "SwitchCase", - "start": 72, - "end": 88, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 20 - } - }, + "start":72,"end":88,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":20}}, "consequent": [ { "type": "ExpressionStatement", - "start": 81, - "end": 88, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 20 - } - }, + "start":81,"end":88,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":20}}, "expression": { "type": "BinaryExpression", - "start": 81, - "end": 87, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 19 - } - }, + "start":81,"end":87,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":19}}, "left": { "type": "PipelinePrimaryTopicReference", - "start": 81, - "end": 82, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 14 - } - } + "start":81,"end":82,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":14}} }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 85, - "end": 87, - "loc": { - "start": { - "line": 5, - "column": 17 - }, - "end": { - "line": 5, - "column": 19 - } - }, + "start":85,"end":87,"loc":{"start":{"line":5,"column":17},"end":{"line":5,"column":19}}, "extra": { "rawValue": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-head/output.json index 75c2478667..215e0119e4 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-head/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-switch-statement,-outer-topic-reference-in-switch-head/output.json @@ -1,196 +1,52 @@ { "type": "File", - "start": 0, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":9,"end":83,"loc":{"start":{"line":1,"column":9},"end":{"line":7,"column":1}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":9,"end":83,"loc":{"start":{"line":1,"column":9},"end":{"line":7,"column":1}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":12,"end":83,"loc":{"start":{"line":1,"column":12},"end":{"line":7,"column":1}}, "body": [ { "type": "SwitchStatement", - "start": 16, - "end": 81, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":16,"end":81,"loc":{"start":{"line":2,"column":2},"end":{"line":6,"column":3}}, "discriminant": { "type": "PipelinePrimaryTopicReference", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - } + "start":24,"end":25,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}} }, "cases": [ { "type": "SwitchCase", - "start": 33, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":33,"end":44,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":15}}, "consequent": [ { "type": "ExpressionStatement", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":41,"end":44,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":15}}, "expression": { "type": "NumericLiteral", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":41,"end":43,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":14}}, "extra": { "rawValue": 50, "raw": "50" @@ -201,18 +57,7 @@ ], "test": { "type": "NumericLiteral", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":38,"end":39,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, "extra": { "rawValue": 0, "raw": "0" @@ -222,47 +67,14 @@ }, { "type": "SwitchCase", - "start": 49, - "end": 60, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":49,"end":60,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}}, "consequent": [ { "type": "ExpressionStatement", - "start": 57, - "end": 60, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":57,"end":60,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":15}}, "expression": { "type": "NumericLiteral", - "start": 57, - "end": 59, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":57,"end":59,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":14}}, "extra": { "rawValue": 60, "raw": "60" @@ -273,18 +85,7 @@ ], "test": { "type": "NumericLiteral", - "start": 54, - "end": 55, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":54,"end":55,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10}}, "extra": { "rawValue": 1, "raw": "1" @@ -294,47 +95,14 @@ }, { "type": "SwitchCase", - "start": 65, - "end": 77, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 16 - } - }, + "start":65,"end":77,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":16}}, "consequent": [ { "type": "ExpressionStatement", - "start": 74, - "end": 77, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 16 - } - }, + "start":74,"end":77,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":16}}, "expression": { "type": "NumericLiteral", - "start": 74, - "end": 76, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":74,"end":76,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":15}}, "extra": { "rawValue": 70, "raw": "70" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-finally-clause-with-catch-and-finally/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-finally-clause-with-catch-and-finally/output.json index a2feff08dc..8493ab8735 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-finally-clause-with-catch-and-finally/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-finally-clause-with-catch-and-finally/output.json @@ -1,226 +1,58 @@ { "type": "File", - "start": 0, - "end": 117, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":117,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 117, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":117,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 117, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":117,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 117, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":117,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 117, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":9,"end":117,"loc":{"start":{"line":1,"column":9},"end":{"line":5,"column":1}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 117, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":9,"end":117,"loc":{"start":{"line":1,"column":9},"end":{"line":5,"column":1}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 117, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":12,"end":117,"loc":{"start":{"line":1,"column":12},"end":{"line":5,"column":1}}, "body": [ { "type": "TryStatement", - "start": 16, - "end": 115, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 27 - } - }, + "start":16,"end":115,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":27}}, "block": { "type": "BlockStatement", - "start": 20, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":20,"end":45,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":31}}, "body": [ { "type": "ExpressionStatement", - "start": 22, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":22,"end":43,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":29}}, "expression": { "type": "CallExpression", - "start": 22, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":22,"end":42,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":28}}, "callee": { "type": "MemberExpression", - "start": 22, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":22,"end":32,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":18}}, "object": { "type": "Identifier", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "JSON" - }, + "start":22,"end":26,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":12},"identifierName":"JSON"}, "name": "JSON" }, "property": { "type": "Identifier", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "parse" - }, + "start":27,"end":32,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18},"identifierName":"parse"}, "name": "parse" }, "computed": false @@ -228,19 +60,7 @@ "arguments": [ { "type": "Identifier", - "start": 33, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "whatever" - }, + "start":33,"end":41,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":27},"identifierName":"whatever"}, "name": "whatever" } ] @@ -251,124 +71,33 @@ }, "handler": { "type": "CatchClause", - "start": 48, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":48,"end":87,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":41}}, "param": { "type": "Identifier", - "start": 55, - "end": 60, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 14 - }, - "identifierName": "error" - }, + "start":55,"end":60,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":14},"identifierName":"error"}, "name": "error" }, "body": { "type": "BlockStatement", - "start": 62, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":62,"end":87,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":41}}, "body": [ { "type": "ExpressionStatement", - "start": 64, - "end": 85, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":64,"end":85,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":39}}, "expression": { "type": "CallExpression", - "start": 64, - "end": 84, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 38 - } - }, + "start":64,"end":84,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":38}}, "callee": { "type": "MemberExpression", - "start": 64, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 31 - } - }, + "start":64,"end":77,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":31}}, "object": { "type": "Identifier", - "start": 64, - "end": 71, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 25 - }, - "identifierName": "console" - }, + "start":64,"end":71,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":25},"identifierName":"console"}, "name": "console" }, "property": { "type": "Identifier", - "start": 72, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 26 - }, - "end": { - "line": 3, - "column": 31 - }, - "identifierName": "error" - }, + "start":72,"end":77,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":31},"identifierName":"error"}, "name": "error" }, "computed": false @@ -376,19 +105,7 @@ "arguments": [ { "type": "Identifier", - "start": 78, - "end": 83, - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 37 - }, - "identifierName": "error" - }, + "start":78,"end":83,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":37},"identifierName":"error"}, "name": "error" } ] @@ -400,79 +117,23 @@ }, "finalizer": { "type": "BlockStatement", - "start": 98, - "end": 115, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 27 - } - }, + "start":98,"end":115,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":27}}, "body": [ { "type": "ExpressionStatement", - "start": 100, - "end": 113, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":100,"end":113,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":25}}, "expression": { "type": "CallExpression", - "start": 100, - "end": 112, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 24 - } - }, + "start":100,"end":112,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":24}}, "callee": { "type": "Identifier", - "start": 100, - "end": 109, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 21 - }, - "identifierName": "something" - }, + "start":100,"end":109,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":21},"identifierName":"something"}, "name": "something" }, "arguments": [ { "type": "PipelinePrimaryTopicReference", - "start": 110, - "end": 111, - "loc": { - "start": { - "line": 4, - "column": 22 - }, - "end": { - "line": 4, - "column": 23 - } - } + "start":110,"end":111,"loc":{"start":{"line":4,"column":22},"end":{"line":4,"column":23}} } ] } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch-and-finally/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch-and-finally/output.json index 95c03c8c90..117b71e8c5 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch-and-finally/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch-and-finally/output.json @@ -1,226 +1,58 @@ { "type": "File", - "start": 0, - "end": 109, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":109,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 109, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":109,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 109, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":109,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 109, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":109,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 109, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":9,"end":109,"loc":{"start":{"line":1,"column":9},"end":{"line":5,"column":1}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 109, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":9,"end":109,"loc":{"start":{"line":1,"column":9},"end":{"line":5,"column":1}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 109, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":12,"end":109,"loc":{"start":{"line":1,"column":12},"end":{"line":5,"column":1}}, "body": [ { "type": "TryStatement", - "start": 16, - "end": 107, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 26 - } - }, + "start":16,"end":107,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":26}}, "block": { "type": "BlockStatement", - "start": 20, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":20,"end":38,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":24}}, "body": [ { "type": "ExpressionStatement", - "start": 22, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":22,"end":36,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":22}}, "expression": { "type": "CallExpression", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":22,"end":35,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":21}}, "callee": { "type": "MemberExpression", - "start": 22, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":22,"end":32,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":18}}, "object": { "type": "Identifier", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "JSON" - }, + "start":22,"end":26,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":12},"identifierName":"JSON"}, "name": "JSON" }, "property": { "type": "Identifier", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "parse" - }, + "start":27,"end":32,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18},"identifierName":"parse"}, "name": "parse" }, "computed": false @@ -228,18 +60,7 @@ "arguments": [ { "type": "PipelinePrimaryTopicReference", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - } - } + "start":33,"end":34,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20}} } ] } @@ -249,124 +70,33 @@ }, "handler": { "type": "CatchClause", - "start": 41, - "end": 80, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":41,"end":80,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":41}}, "param": { "type": "Identifier", - "start": 48, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 14 - }, - "identifierName": "error" - }, + "start":48,"end":53,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":14},"identifierName":"error"}, "name": "error" }, "body": { "type": "BlockStatement", - "start": 55, - "end": 80, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":55,"end":80,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":41}}, "body": [ { "type": "ExpressionStatement", - "start": 57, - "end": 78, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":57,"end":78,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":39}}, "expression": { "type": "CallExpression", - "start": 57, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 38 - } - }, + "start":57,"end":77,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":38}}, "callee": { "type": "MemberExpression", - "start": 57, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 31 - } - }, + "start":57,"end":70,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":31}}, "object": { "type": "Identifier", - "start": 57, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 25 - }, - "identifierName": "console" - }, + "start":57,"end":64,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":25},"identifierName":"console"}, "name": "console" }, "property": { "type": "Identifier", - "start": 65, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 26 - }, - "end": { - "line": 3, - "column": 31 - }, - "identifierName": "error" - }, + "start":65,"end":70,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":31},"identifierName":"error"}, "name": "error" }, "computed": false @@ -374,19 +104,7 @@ "arguments": [ { "type": "Identifier", - "start": 71, - "end": 76, - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 37 - }, - "identifierName": "error" - }, + "start":71,"end":76,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":37},"identifierName":"error"}, "name": "error" } ] @@ -398,62 +116,17 @@ }, "finalizer": { "type": "BlockStatement", - "start": 91, - "end": 107, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 26 - } - }, + "start":91,"end":107,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":26}}, "body": [ { "type": "ExpressionStatement", - "start": 93, - "end": 105, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 24 - } - }, + "start":93,"end":105,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":24}}, "expression": { "type": "CallExpression", - "start": 93, - "end": 104, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 23 - } - }, + "start":93,"end":104,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":23}}, "callee": { "type": "Identifier", - "start": 93, - "end": 102, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 21 - }, - "identifierName": "something" - }, + "start":93,"end":102,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":21},"identifierName":"something"}, "name": "something" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch/output.json index cf2f95415e..74e0c37287 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-try-statement,-outer-topic-reference-in-try-clause-with-catch/output.json @@ -1,226 +1,58 @@ { "type": "File", - "start": 0, - "end": 82, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":82,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 82, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":82,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 82, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":82,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 82, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":82,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 82, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":9,"end":82,"loc":{"start":{"line":1,"column":9},"end":{"line":4,"column":1}}, "expression": { "type": "DoExpression", - "start": 9, - "end": 82, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":9,"end":82,"loc":{"start":{"line":1,"column":9},"end":{"line":4,"column":1}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 82, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":12,"end":82,"loc":{"start":{"line":1,"column":12},"end":{"line":4,"column":1}}, "body": [ { "type": "TryStatement", - "start": 16, - "end": 80, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":16,"end":80,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":41}}, "block": { "type": "BlockStatement", - "start": 20, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":20,"end":38,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":24}}, "body": [ { "type": "ExpressionStatement", - "start": 22, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":22,"end":36,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":22}}, "expression": { "type": "CallExpression", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":22,"end":35,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":21}}, "callee": { "type": "MemberExpression", - "start": 22, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":22,"end":32,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":18}}, "object": { "type": "Identifier", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "JSON" - }, + "start":22,"end":26,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":12},"identifierName":"JSON"}, "name": "JSON" }, "property": { "type": "Identifier", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "parse" - }, + "start":27,"end":32,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18},"identifierName":"parse"}, "name": "parse" }, "computed": false @@ -228,18 +60,7 @@ "arguments": [ { "type": "PipelinePrimaryTopicReference", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - } - } + "start":33,"end":34,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20}} } ] } @@ -249,124 +70,33 @@ }, "handler": { "type": "CatchClause", - "start": 41, - "end": 80, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":41,"end":80,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":41}}, "param": { "type": "Identifier", - "start": 48, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 14 - }, - "identifierName": "error" - }, + "start":48,"end":53,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":14},"identifierName":"error"}, "name": "error" }, "body": { "type": "BlockStatement", - "start": 55, - "end": 80, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":55,"end":80,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":41}}, "body": [ { "type": "ExpressionStatement", - "start": 57, - "end": 78, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":57,"end":78,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":39}}, "expression": { "type": "CallExpression", - "start": 57, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 38 - } - }, + "start":57,"end":77,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":38}}, "callee": { "type": "MemberExpression", - "start": 57, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 31 - } - }, + "start":57,"end":70,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":31}}, "object": { "type": "Identifier", - "start": 57, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 25 - }, - "identifierName": "console" - }, + "start":57,"end":64,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":25},"identifierName":"console"}, "name": "console" }, "property": { "type": "Identifier", - "start": 65, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 26 - }, - "end": { - "line": 3, - "column": 31 - }, - "identifierName": "error" - }, + "start":65,"end":70,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":31},"identifierName":"error"}, "name": "error" }, "computed": false @@ -374,19 +104,7 @@ "arguments": [ { "type": "Identifier", - "start": 71, - "end": 76, - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 37 - }, - "identifierName": "error" - }, + "start":71,"end":76,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":37},"identifierName":"error"}, "name": "error" } ] diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-while-loop,-outer-topic-reference-in-loop-head/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-while-loop,-outer-topic-reference-in-loop-head/output.json index e3714c89c3..0e266f4100 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-while-loop,-outer-topic-reference-in-loop-head/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-do-expression,-while-loop,-outer-topic-reference-in-loop-head/output.json @@ -1,245 +1,66 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "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}}, "expression": { "type": "DoExpression", - "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}}, "body": { "type": "BlockStatement", - "start": 12, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":12,"end":37,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":37}}, "body": [ { "type": "WhileStatement", - "start": 14, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":14,"end":35,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":35}}, "test": { "type": "BinaryExpression", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26}}, "left": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"x"}, "name": "x" }, "operator": "<", "right": { "type": "PipelinePrimaryTopicReference", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - } + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}} } }, "body": { "type": "ExpressionStatement", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35}}, "expression": { "type": "AssignmentExpression", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":28,"end":34,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":34}}, "operator": "+=", "left": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "x" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-call,-identifier-with-topic-reference/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-call,-identifier-with-topic-reference/output.json index 3ee59b9da5..db2ecd0113 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-call,-identifier-with-topic-reference/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-call,-identifier-with-topic-reference/output.json @@ -1,140 +1,39 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "expression": { "type": "CallExpression", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "callee": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "PipelinePrimaryTopicReference", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}} } ] } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-definition,-outer-topic-reference-in-default-parameter-expression/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-definition,-outer-topic-reference-in-default-parameter-expression/output.json index c5ba3fb13a..8723507835 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-definition,-outer-topic-reference-in-default-parameter-expression/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-function-definition,-outer-topic-reference-in-default-parameter-expression/output.json @@ -1,204 +1,58 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":9,"end":39,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":39}}, "expression": { "type": "FunctionExpression", - "start": 9, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":9,"end":39,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":39}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "left": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "x" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"x"}, "name": "x" }, "right": { "type": "PipelinePrimaryTopicReference", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} } } ], "body": { "type": "BlockStatement", - "start": 26, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":26,"end":39,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":39}}, "body": [ { "type": "ReturnStatement", - "start": 28, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":28,"end":37,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":37}}, "argument": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "x" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-generator-yield/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-generator-yield/output.json index ad59accc2d..3df77e4676 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-generator-yield/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-generator-yield/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "f" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"f"}, "name": "f" }, "generator": true, @@ -65,108 +20,30 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":44,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 20, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":20,"end":42,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":24}}, "argument": { "type": "BinaryExpression", - "start": 27, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":27,"end":41,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":23}}, "left": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "x" - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"x"}, "name": "x" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":32,"end":41,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":23}}, "expression": { "type": "YieldExpression", - "start": 33, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":33,"end":40,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":22}}, "delegate": false, "argument": { "type": "PipelinePrimaryTopicReference", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - } - } + "start":39,"end":40,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22}} }, "extra": { "parenthesized": true, diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-parenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-parenthesized/output.json index 3d951c7dcb..81102e182a 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-parenthesized/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-parenthesized/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "expression": { "type": "PipelinePrimaryTopicReference", - "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": { "parenthesized": true, "parenStart": 9 diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-unparenthesized/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-unparenthesized/output.json index 147e066345..cb533784bc 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-unparenthesized/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-identity,-unparenthesized/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "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}}, "expression": { "type": "PipelinePrimaryTopicReference", - "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}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-mixed-pipeline-plugins/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-mixed-pipeline-plugins/output.json index 147e066345..cb533784bc 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-mixed-pipeline-plugins/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-mixed-pipeline-plugins/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "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}}, "expression": { "type": "PipelinePrimaryTopicReference", - "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}} } } } diff --git a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-parenthesized-single-line-arrow-function,-with-empty-parameter-list-and-bare-addition-body/output.json b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-parenthesized-single-line-arrow-function,-with-empty-parameter-list-and-bare-addition-body/output.json index 23ba6b6a9d..c6606b33e1 100644 --- a/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-parenthesized-single-line-arrow-function,-with-empty-parameter-list-and-bare-addition-body/output.json +++ b/packages/babel-parser/test/fixtures/experimental/pipeline-operator/proposal-smart-topic-style,-parenthesized-single-line-arrow-function,-with-empty-parameter-list-and-bare-addition-body/output.json @@ -1,156 +1,45 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "value" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"value"}, "name": "value" }, "operator": "|>", "right": { "type": "PipelineTopicExpression", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "expression": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BinaryExpression", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "left": { "type": "PipelinePrimaryTopicReference", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}} }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/bar-flow/output.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/bar-flow/output.json index dc325327e4..33b1ddf85e 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/bar-flow/output.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/bar-flow/output.json @@ -1,138 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":4,"end":35,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":35}}, "id": { "type": "Identifier", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "a" - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":5,"end":22,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":22}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 7, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":7,"end":22,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":22}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 10, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19}}, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" }, "static": false, @@ -141,18 +40,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}} }, "variance": null, "optional": false @@ -167,67 +55,22 @@ }, "init": { "type": "RecordExpression", - "start": 25, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":25,"end":35,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":35}}, "properties": [ { "type": "ObjectProperty", - "start": 28, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":28,"end":32,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":32}}, "method": false, "key": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "x" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/bar/output.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/bar/output.json index db51a8cf70..0efc35cc94 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/bar/output.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/bar/output.json @@ -1,142 +1,42 @@ { "type": "File", - "start": 0, - "end": 112, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 16, - "column": 19 - } - }, + "start":0,"end":112,"loc":{"start":{"line":1,"column":0},"end":{"line":16,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 112, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 16, - "column": 19 - } - }, + "start":0,"end":112,"loc":{"start":{"line":1,"column":0},"end":{"line":16,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "RecordExpression", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "properties": [] } }, { "type": "ExpressionStatement", - "start": 7, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":7,"end":30,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":23}}, "expression": { "type": "RecordExpression", - "start": 7, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":7,"end":29,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":22}}, "properties": [ { "type": "ObjectProperty", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":10,"end":14,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":7}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":13,"end":14,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -146,52 +46,18 @@ }, { "type": "ObjectProperty", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":16,"end":20,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":13}}, "method": false, "key": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "b" - }, + "start":16,"end":17,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":19,"end":20,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}}, "extra": { "rawValue": 2, "raw": "2" @@ -201,52 +67,18 @@ }, { "type": "ObjectProperty", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":22,"end":26,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":19}}, "method": false, "key": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 16 - }, - "identifierName": "c" - }, + "start":22,"end":23,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":16},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":25,"end":26,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":19}}, "extra": { "rawValue": 3, "raw": "3" @@ -259,81 +91,25 @@ }, { "type": "ExpressionStatement", - "start": 32, - "end": 70, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 10, - "column": 3 - } - }, + "start":32,"end":70,"loc":{"start":{"line":5,"column":0},"end":{"line":10,"column":3}}, "expression": { "type": "RecordExpression", - "start": 32, - "end": 69, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 10, - "column": 2 - } - }, + "start":32,"end":69,"loc":{"start":{"line":5,"column":0},"end":{"line":10,"column":2}}, "properties": [ { "type": "ObjectProperty", - "start": 37, - "end": 41, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 6 - } - }, + "start":37,"end":41,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":6}}, "method": false, "key": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - }, - "identifierName": "a" - }, + "start":37,"end":38,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 6 - } - }, + "start":40,"end":41,"loc":{"start":{"line":6,"column":5},"end":{"line":6,"column":6}}, "extra": { "rawValue": 1, "raw": "1" @@ -343,101 +119,33 @@ }, { "type": "ObjectProperty", - "start": 45, - "end": 65, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 9, - "column": 4 - } - }, + "start":45,"end":65,"loc":{"start":{"line":7,"column":2},"end":{"line":9,"column":4}}, "method": false, "key": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 3 - }, - "identifierName": "b" - }, + "start":45,"end":46,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":3},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "RecordExpression", - "start": 48, - "end": 65, - "loc": { - "start": { - "line": 7, - "column": 5 - }, - "end": { - "line": 9, - "column": 4 - } - }, + "start":48,"end":65,"loc":{"start":{"line":7,"column":5},"end":{"line":9,"column":4}}, "properties": [ { "type": "ObjectProperty", - "start": 55, - "end": 59, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 8 - } - }, + "start":55,"end":59,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":8}}, "method": false, "key": { "type": "Identifier", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 5 - }, - "identifierName": "c" - }, + "start":55,"end":56,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":5},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 58, - "end": 59, - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 8 - } - }, + "start":58,"end":59,"loc":{"start":{"line":8,"column":7},"end":{"line":8,"column":8}}, "extra": { "rawValue": 3, "raw": "3" @@ -459,78 +167,23 @@ }, { "type": "ExpressionStatement", - "start": 72, - "end": 77, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 5 - } - }, + "start":72,"end":77,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":5}}, "expression": { "type": "TupleExpression", - "start": 72, - "end": 76, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 4 - } - }, + "start":72,"end":76,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":4}}, "elements": [] } }, { "type": "ExpressionStatement", - "start": 79, - "end": 91, - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 12 - } - }, + "start":79,"end":91,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":12}}, "expression": { "type": "TupleExpression", - "start": 79, - "end": 90, - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 11 - } - }, + "start":79,"end":90,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":11}}, "elements": [ { "type": "NumericLiteral", - "start": 81, - "end": 82, - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 3 - } - }, + "start":81,"end":82,"loc":{"start":{"line":14,"column":2},"end":{"line":14,"column":3}}, "extra": { "rawValue": 1, "raw": "1" @@ -539,18 +192,7 @@ }, { "type": "NumericLiteral", - "start": 84, - "end": 85, - "loc": { - "start": { - "line": 14, - "column": 5 - }, - "end": { - "line": 14, - "column": 6 - } - }, + "start":84,"end":85,"loc":{"start":{"line":14,"column":5},"end":{"line":14,"column":6}}, "extra": { "rawValue": 2, "raw": "2" @@ -559,18 +201,7 @@ }, { "type": "NumericLiteral", - "start": 87, - "end": 88, - "loc": { - "start": { - "line": 14, - "column": 8 - }, - "end": { - "line": 14, - "column": 9 - } - }, + "start":87,"end":88,"loc":{"start":{"line":14,"column":8},"end":{"line":14,"column":9}}, "extra": { "rawValue": 3, "raw": "3" @@ -582,47 +213,14 @@ }, { "type": "ExpressionStatement", - "start": 93, - "end": 112, - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 16, - "column": 19 - } - }, + "start":93,"end":112,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":19}}, "expression": { "type": "TupleExpression", - "start": 93, - "end": 111, - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 16, - "column": 18 - } - }, + "start":93,"end":111,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":18}}, "elements": [ { "type": "NumericLiteral", - "start": 95, - "end": 96, - "loc": { - "start": { - "line": 16, - "column": 2 - }, - "end": { - "line": 16, - "column": 3 - } - }, + "start":95,"end":96,"loc":{"start":{"line":16,"column":2},"end":{"line":16,"column":3}}, "extra": { "rawValue": 1, "raw": "1" @@ -631,33 +229,11 @@ }, { "type": "TupleExpression", - "start": 98, - "end": 106, - "loc": { - "start": { - "line": 16, - "column": 5 - }, - "end": { - "line": 16, - "column": 13 - } - }, + "start":98,"end":106,"loc":{"start":{"line":16,"column":5},"end":{"line":16,"column":13}}, "elements": [ { "type": "NumericLiteral", - "start": 100, - "end": 101, - "loc": { - "start": { - "line": 16, - "column": 7 - }, - "end": { - "line": 16, - "column": 8 - } - }, + "start":100,"end":101,"loc":{"start":{"line":16,"column":7},"end":{"line":16,"column":8}}, "extra": { "rawValue": 2, "raw": "2" @@ -666,18 +242,7 @@ }, { "type": "NumericLiteral", - "start": 103, - "end": 104, - "loc": { - "start": { - "line": 16, - "column": 10 - }, - "end": { - "line": 16, - "column": 11 - } - }, + "start":103,"end":104,"loc":{"start":{"line":16,"column":10},"end":{"line":16,"column":11}}, "extra": { "rawValue": 3, "raw": "3" @@ -688,18 +253,7 @@ }, { "type": "NumericLiteral", - "start": 108, - "end": 109, - "loc": { - "start": { - "line": 16, - "column": 15 - }, - "end": { - "line": 16, - "column": 16 - } - }, + "start":108,"end":109,"loc":{"start":{"line":16,"column":15},"end":{"line":16,"column":16}}, "extra": { "rawValue": 4, "raw": "4" diff --git a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/hash/output.json b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/hash/output.json index c5d7401728..6cba070ffe 100644 --- a/packages/babel-parser/test/fixtures/experimental/record-and-tuple/hash/output.json +++ b/packages/babel-parser/test/fixtures/experimental/record-and-tuple/hash/output.json @@ -1,142 +1,42 @@ { "type": "File", - "start": 0, - "end": 104, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 16, - "column": 17 - } - }, + "start":0,"end":104,"loc":{"start":{"line":1,"column":0},"end":{"line":16,"column":17}}, "program": { "type": "Program", - "start": 0, - "end": 104, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 16, - "column": 17 - } - }, + "start":0,"end":104,"loc":{"start":{"line":1,"column":0},"end":{"line":16,"column":17}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "RecordExpression", - "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}}, "properties": [] } }, { "type": "ExpressionStatement", - "start": 6, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":6,"end":28,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":22}}, "expression": { "type": "RecordExpression", - "start": 6, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":6,"end":27,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":21}}, "properties": [ { "type": "ObjectProperty", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":9,"end":13,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":7}}, "method": false, "key": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":12,"end":13,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -146,52 +46,18 @@ }, { "type": "ObjectProperty", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":15,"end":19,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":13}}, "method": false, "key": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "b" - }, + "start":15,"end":16,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":18,"end":19,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}}, "extra": { "rawValue": 2, "raw": "2" @@ -201,52 +67,18 @@ }, { "type": "ObjectProperty", - "start": 21, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":21,"end":25,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":19}}, "method": false, "key": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 16 - }, - "identifierName": "c" - }, + "start":21,"end":22,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":16},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":24,"end":25,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":19}}, "extra": { "rawValue": 3, "raw": "3" @@ -259,81 +91,25 @@ }, { "type": "ExpressionStatement", - "start": 30, - "end": 66, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 10, - "column": 2 - } - }, + "start":30,"end":66,"loc":{"start":{"line":5,"column":0},"end":{"line":10,"column":2}}, "expression": { "type": "RecordExpression", - "start": 30, - "end": 65, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":30,"end":65,"loc":{"start":{"line":5,"column":0},"end":{"line":10,"column":1}}, "properties": [ { "type": "ObjectProperty", - "start": 35, - "end": 39, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 6 - } - }, + "start":35,"end":39,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":6}}, "method": false, "key": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - }, - "identifierName": "a" - }, + "start":35,"end":36,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 6 - } - }, + "start":38,"end":39,"loc":{"start":{"line":6,"column":5},"end":{"line":6,"column":6}}, "extra": { "rawValue": 1, "raw": "1" @@ -343,101 +119,33 @@ }, { "type": "ObjectProperty", - "start": 43, - "end": 62, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 9, - "column": 3 - } - }, + "start":43,"end":62,"loc":{"start":{"line":7,"column":2},"end":{"line":9,"column":3}}, "method": false, "key": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 3 - }, - "identifierName": "b" - }, + "start":43,"end":44,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":3},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "RecordExpression", - "start": 46, - "end": 62, - "loc": { - "start": { - "line": 7, - "column": 5 - }, - "end": { - "line": 9, - "column": 3 - } - }, + "start":46,"end":62,"loc":{"start":{"line":7,"column":5},"end":{"line":9,"column":3}}, "properties": [ { "type": "ObjectProperty", - "start": 53, - "end": 57, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 8 - } - }, + "start":53,"end":57,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":8}}, "method": false, "key": { "type": "Identifier", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 5 - }, - "identifierName": "c" - }, + "start":53,"end":54,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":5},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 8 - } - }, + "start":56,"end":57,"loc":{"start":{"line":8,"column":7},"end":{"line":8,"column":8}}, "extra": { "rawValue": 3, "raw": "3" @@ -459,78 +167,23 @@ }, { "type": "ExpressionStatement", - "start": 68, - "end": 72, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 4 - } - }, + "start":68,"end":72,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":4}}, "expression": { "type": "TupleExpression", - "start": 68, - "end": 71, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 3 - } - }, + "start":68,"end":71,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":3}}, "elements": [] } }, { "type": "ExpressionStatement", - "start": 74, - "end": 85, - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 11 - } - }, + "start":74,"end":85,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":11}}, "expression": { "type": "TupleExpression", - "start": 74, - "end": 84, - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 10 - } - }, + "start":74,"end":84,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":10}}, "elements": [ { "type": "NumericLiteral", - "start": 76, - "end": 77, - "loc": { - "start": { - "line": 14, - "column": 2 - }, - "end": { - "line": 14, - "column": 3 - } - }, + "start":76,"end":77,"loc":{"start":{"line":14,"column":2},"end":{"line":14,"column":3}}, "extra": { "rawValue": 1, "raw": "1" @@ -539,18 +192,7 @@ }, { "type": "NumericLiteral", - "start": 79, - "end": 80, - "loc": { - "start": { - "line": 14, - "column": 5 - }, - "end": { - "line": 14, - "column": 6 - } - }, + "start":79,"end":80,"loc":{"start":{"line":14,"column":5},"end":{"line":14,"column":6}}, "extra": { "rawValue": 2, "raw": "2" @@ -559,18 +201,7 @@ }, { "type": "NumericLiteral", - "start": 82, - "end": 83, - "loc": { - "start": { - "line": 14, - "column": 8 - }, - "end": { - "line": 14, - "column": 9 - } - }, + "start":82,"end":83,"loc":{"start":{"line":14,"column":8},"end":{"line":14,"column":9}}, "extra": { "rawValue": 3, "raw": "3" @@ -582,47 +213,14 @@ }, { "type": "ExpressionStatement", - "start": 87, - "end": 104, - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 16, - "column": 17 - } - }, + "start":87,"end":104,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":17}}, "expression": { "type": "TupleExpression", - "start": 87, - "end": 103, - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 16, - "column": 16 - } - }, + "start":87,"end":103,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":16}}, "elements": [ { "type": "NumericLiteral", - "start": 89, - "end": 90, - "loc": { - "start": { - "line": 16, - "column": 2 - }, - "end": { - "line": 16, - "column": 3 - } - }, + "start":89,"end":90,"loc":{"start":{"line":16,"column":2},"end":{"line":16,"column":3}}, "extra": { "rawValue": 1, "raw": "1" @@ -631,33 +229,11 @@ }, { "type": "TupleExpression", - "start": 92, - "end": 99, - "loc": { - "start": { - "line": 16, - "column": 5 - }, - "end": { - "line": 16, - "column": 12 - } - }, + "start":92,"end":99,"loc":{"start":{"line":16,"column":5},"end":{"line":16,"column":12}}, "elements": [ { "type": "NumericLiteral", - "start": 94, - "end": 95, - "loc": { - "start": { - "line": 16, - "column": 7 - }, - "end": { - "line": 16, - "column": 8 - } - }, + "start":94,"end":95,"loc":{"start":{"line":16,"column":7},"end":{"line":16,"column":8}}, "extra": { "rawValue": 2, "raw": "2" @@ -666,18 +242,7 @@ }, { "type": "NumericLiteral", - "start": 97, - "end": 98, - "loc": { - "start": { - "line": 16, - "column": 10 - }, - "end": { - "line": 16, - "column": 11 - } - }, + "start":97,"end":98,"loc":{"start":{"line":16,"column":10},"end":{"line":16,"column":11}}, "extra": { "rawValue": 3, "raw": "3" @@ -688,18 +253,7 @@ }, { "type": "NumericLiteral", - "start": 101, - "end": 102, - "loc": { - "start": { - "line": 16, - "column": 14 - }, - "end": { - "line": 16, - "column": 15 - } - }, + "start":101,"end":102,"loc":{"start":{"line":16,"column":14},"end":{"line":16,"column":15}}, "extra": { "rawValue": 4, "raw": "4" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/output.json index b6d0cedb6d..dad87f1a67 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/1/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "value": { "raw": "\\01", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/output.json index c2e61b7dcc..805b977e02 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/10/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "expressions": [ { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "value": { "raw": "\\xg", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/output.json index 3ca94e61c6..7d1057ebdf 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/11/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "value": { "raw": "\\xg", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/output.json index 635e109f11..66db1d9667 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/12/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,7 @@ }, { "type": "NumericLiteral", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "value": { "raw": "\\xg", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "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}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/output.json index 7f0b58140c..7f23399bd7 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/13/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "\\xAg", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/output.json index 3b5099e248..3d6415843c 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/14/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "\\xAg", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/output.json index dad1acd882..52964dd67c 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/15/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "value": { "raw": "\\xAg", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/output.json index 980991e098..de4e948b6f 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/16/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":9,"end":32,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":32}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,7 @@ }, { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "value": { "raw": "\\xAg", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/output.json index 9aa91ba180..4ea96f95f6 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/17/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "value": { "raw": "\\u0", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/output.json index 1f6e730f77..9c2fa5d831 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/18/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "expressions": [ { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "value": { "raw": "\\u0", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/output.json index 4d0a4a3823..0531e07725 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/19/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "value": { "raw": "\\u0", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/output.json index f644f6f77c..2b72eb9e94 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/2/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "expressions": [ { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "value": { "raw": "\\01", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/output.json index 7012d6b344..602c59d44b 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/20/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,7 @@ }, { "type": "NumericLiteral", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "value": { "raw": "\\u0", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "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}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/output.json index 80582542dc..7a32c398fc 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/21/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "\\u0g", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/output.json index c692f5634e..78208a0d1b 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/22/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "\\u0g", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/output.json index 57ba6b14ba..ce7c6247f6 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/23/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "value": { "raw": "\\u0g", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/output.json index 1eb4c54777..bf7992eebc 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/24/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":9,"end":32,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":32}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,7 @@ }, { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "value": { "raw": "\\u0g", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/output.json index e2929b5688..e1d3be39b3 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/25/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "value": { "raw": "\\u00g", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/output.json index d765da348a..38eff5e054 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/26/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":9,"end":25,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":25}}, "expressions": [ { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "value": { "raw": "\\u00g", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/output.json index e9ce95b154..b1b043ee40 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/27/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "\\u00g", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/output.json index 6ef630c216..8d68a188cc 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/28/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,7 @@ }, { "type": "NumericLiteral", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "\\u00g", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/output.json index 7d080201f8..31f3f9f5a4 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/29/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}}, "value": { "raw": "\\u000g", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/output.json index 35d36a435d..1117fb9bfb 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/3/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "value": { "raw": "\\01", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/output.json index 234638108d..d4adad3aab 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/30/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":9,"end":26,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":26}}, "expressions": [ { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}}, "value": { "raw": "\\u000g", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/output.json index 01ba58dde0..400efe6d5f 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/31/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":9,"end":25,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":25}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}}, "value": { "raw": "\\u000g", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/output.json index d6c9de764f..3f3ca0d3d5 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/32/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":9,"end":34,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":34}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,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": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}}, "value": { "raw": "\\u000g", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/output.json index d4989ed391..85bfc592f8 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/33/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "\\u{}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/output.json index f070f46d18..50214d1502 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/34/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "\\u{}", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/output.json index 75c1433476..2d99aea456 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/35/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "value": { "raw": "\\u{}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/output.json index edbbef5c29..423b95bfc9 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/36/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":9,"end":32,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":32}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,7 @@ }, { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "value": { "raw": "\\u{}", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/output.json index a8fa636685..747bd08fd1 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/37/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}}, "value": { "raw": "\\u{-0}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/output.json index 7dd1fb5e55..76dd4a67d8 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/38/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":9,"end":26,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":26}}, "expressions": [ { "type": "NumericLiteral", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}}, "value": { "raw": "\\u{-0}", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/output.json index 98c5fbe6f8..6a5f61a441 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/39/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":9,"end":25,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":25}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}}, "value": { "raw": "\\u{-0}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/output.json index c7aa3ef7db..8d8096e542 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/4/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,7 @@ }, { "type": "NumericLiteral", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "value": { "raw": "\\01", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "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}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/output.json index c1153e8ef9..9faf5390f8 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/40/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":9,"end":34,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":34}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,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": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}}, "value": { "raw": "\\u{-0}", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/output.json index 6785374292..7a70c20099 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/41/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "value": { "raw": "\\u{g}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/output.json index 3e96fd7f6e..df86a70b2a 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/42/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":9,"end":25,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":25}}, "expressions": [ { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "value": { "raw": "\\u{g}", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/output.json index 072db71bd3..9f0a0bfc1d 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/43/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "\\u{g}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/output.json index fdbd4372b1..d6bc57308f 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/44/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,7 @@ }, { "type": "NumericLiteral", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "\\u{g}", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/output.json index 8d89468bd9..e86e6a2871 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/45/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "value": { "raw": "\\u{", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/output.json index caff17537e..67a243bde9 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/46/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "expressions": [ { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "value": { "raw": "\\u{", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/output.json index c84eb9ef6c..cd424ff672 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/47/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "value": { "raw": "\\u{", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/output.json index 41f694cea6..65da3199ea 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/48/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,7 @@ }, { "type": "NumericLiteral", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "value": { "raw": "\\u{", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "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}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/output.json index 0467351a38..5926ac8938 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/49/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "value": { "raw": "\\u{\\\\", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/output.json index a0b4ed8873..ad9dec9755 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/5/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "value": { "raw": "\\1", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/output.json index 783cfac7f3..6b7c37b415 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/50/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":9,"end":25,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":25}}, "expressions": [ { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "value": { "raw": "\\u{\\\\", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/output.json index 8f770a0b52..4e0de67a89 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/51/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "\\u{\\\\", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/output.json index e9c9ec66f5..26b92f4ebb 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/52/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,7 @@ }, { "type": "NumericLiteral", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "\\u{\\\\", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/output.json index 140d1ca3a5..c25d7475fd 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/53/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "value": { "raw": "\\u{\\`", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/output.json index 1ba67b8a91..f63451acca 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/54/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":9,"end":25,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":25}}, "expressions": [ { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "value": { "raw": "\\u{\\`", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/output.json index 0acda94d44..72ae1ab47d 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/55/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "\\u{\\`", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/output.json index a486c2f93d..57e112e272 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/56/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,7 @@ }, { "type": "NumericLiteral", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "\\u{\\`", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/output.json index 787369211a..fbd1e2201d 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/57/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "\\u{0", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/output.json index ac1b66efba..9bc05a72f3 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/58/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "\\u{0", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/output.json index d996015a1b..c08c3328ed 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/59/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "value": { "raw": "\\u{0", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/output.json index 41ad167999..d6ac90f7e3 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/6/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "expressions": [ { "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": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "value": { "raw": "\\1", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/output.json index eefdc6fa08..ca481d3e2a 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/60/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":9,"end":32,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":32}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,7 @@ }, { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "value": { "raw": "\\u{0", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/output.json index 533b224afe..8ddeec634a 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/61/output.json @@ -1,109 +1,31 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":10,"end":18,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":18}}, "value": { "raw": "\\u{\\u{0}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/output.json index 0ac527181b..b494d245ac 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/62/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":9,"end":28,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":28}}, "expressions": [ { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":10,"end":18,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":18}}, "value": { "raw": "\\u{\\u{0}", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/output.json index f54fd54c65..54766534dd 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/63/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":9,"end":27,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":27}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "value": { "raw": "\\u{\\u{0}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/output.json index 341d69a0c9..28c0d4b1d0 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/64/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":9,"end":36,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":36}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,7 @@ }, { "type": "NumericLiteral", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "value": { "raw": "\\u{\\u{0}", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/output.json index 0fee8b87f9..5f89215691 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/65/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":21}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "value": { "raw": "\\u{110000}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/output.json index c18f0204be..985490008a 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/66/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":9,"end":30,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":30}}, "expressions": [ { "type": "NumericLiteral", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "value": { "raw": "\\u{110000}", "cooked": null @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/output.json index bfc54baaba..ff4d68c939 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/67/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":9,"end":29,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":29}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":18,"end":28,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":28}}, "value": { "raw": "\\u{110000}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/output.json index 29e020e74f..e84414a33e 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/68/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":9,"end":38,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":38}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,7 @@ }, { "type": "NumericLiteral", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":18,"end":28,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":28}}, "value": { "raw": "\\u{110000}", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "start": 32, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":32,"end":37,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":37}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/output.json index 8cb12ab25a..83c7892aee 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/7/output.json @@ -1,108 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":21}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -113,18 +35,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -133,18 +44,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "value": { "raw": "\\1", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/output.json index e5813f87f8..d9117d3b92 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/8/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expression": { "type": "TaggedTemplateExpression", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":9,"end":30,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":30}}, "expressions": [ { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 0, "raw": "0" @@ -111,18 +33,7 @@ }, { "type": "NumericLiteral", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, "extra": { "rawValue": 1, "raw": "1" @@ -133,18 +44,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "value": { "raw": "left", "cooked": "left" @@ -153,18 +53,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "value": { "raw": "\\1", "cooked": null @@ -173,18 +62,7 @@ }, { "type": "TemplateElement", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/output.json index f2d5e3c3dd..44fe37d1f0 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-tagged/9/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "sampleTag" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"sampleTag"}, "name": "sampleTag" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "value": { "raw": "\\xg", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/output.json index f2d99c02f8..609dda3bbf 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/1/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "value": { "raw": "\\01", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/output.json index 84ac3db2b3..e3b8e5b001 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/10/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "value": { "raw": "\\xg", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/output.json index ad1bda1a1f..0179dbeaea 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/11/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "value": { "raw": "\\xg", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/output.json index 5c60a91a94..3c29809b70 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/12/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "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": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "value": { "raw": "\\xg", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/output.json index 76b845845c..a1809a9c8d 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/13/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "\\xAg", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/output.json index 6dd7932c62..8e236a6ead 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/14/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "\\xAg", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/output.json index 46ca5191ad..e7b1472328 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/15/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "value": { "raw": "\\xAg", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/output.json index b050c973d6..4a43408b0f 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/16/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "value": { "raw": "\\xAg", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/output.json index 5876338e6e..44c794754a 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/17/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "value": { "raw": "\\u0", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/output.json index ab51dae8c7..455448a59a 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/18/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "value": { "raw": "\\u0", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/output.json index 7e0fe1f7af..8168708424 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/19/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "value": { "raw": "\\u0", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/output.json index 05034cfa43..ce52b8a327 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/2/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "value": { "raw": "\\01", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/output.json index 4daf639555..35f991fe7e 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/20/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "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": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "value": { "raw": "\\u0", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/output.json index 93487dccb2..7cb4030735 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/21/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "\\u0g", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/output.json index d90c680f75..eff90743fb 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/22/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "\\u0g", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/output.json index 11b9589834..1087c48d75 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/23/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "value": { "raw": "\\u0g", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/output.json index aef068ff0d..c5667acab8 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/24/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "value": { "raw": "\\u0g", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/output.json index 83c602cde6..79f7bd562e 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/25/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "value": { "raw": "\\u00g", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/output.json index b775d5821a..4f81da2ce9 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/26/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "value": { "raw": "\\u00g", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/output.json index 7bfe8f7bc3..723655879b 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/27/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "value": { "raw": "\\u00g", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/output.json index b148595b1c..e4a9490764 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/28/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "value": { "raw": "\\u00g", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/output.json index b0e6a55f8b..da8fed17fc 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/29/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "value": { "raw": "\\u000g", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/output.json index 0d3190ef7f..7ae0eef006 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/3/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "value": { "raw": "\\01", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/output.json index a7b5e0bd1b..c24fdfc69c 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/30/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "value": { "raw": "\\u000g", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/output.json index ac3a715553..82c45a0863 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/31/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "value": { "raw": "\\u000g", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/output.json index 5163754673..653f4d1157 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/32/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "value": { "raw": "\\u000g", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/output.json index 2273b5e141..411c960f4b 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/33/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "\\u{}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/output.json index fecd37e4b1..58f335c032 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/34/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "\\u{}", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/output.json index 83150d31de..1bb35ed64a 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/35/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "value": { "raw": "\\u{}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/output.json index f5d1e7ad2e..b713e29da1 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/36/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "value": { "raw": "\\u{}", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/output.json index 1f51bd4689..f46c259f1f 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/37/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "value": { "raw": "\\u{-0}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/output.json index 2654eccc8c..0bc304bb7f 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/38/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "value": { "raw": "\\u{-0}", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/output.json index b3b301d701..d49ff0ece2 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/39/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "value": { "raw": "\\u{-0}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/output.json index 1d30df1fa4..e5802b2347 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/4/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "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": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "value": { "raw": "\\01", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/output.json index 124c7c8c9d..fd45665f95 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/40/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "value": { "raw": "\\u{-0}", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/output.json index e22b350457..5778cecc9d 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/41/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "value": { "raw": "\\u{g}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/output.json index e25755bdf0..fde0d72e80 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/42/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "value": { "raw": "\\u{g}", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/output.json index 3dfeb7480f..ed08a002f9 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/43/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "value": { "raw": "\\u{g}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/output.json index 8da7d9e51b..17bae3ae99 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/44/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "value": { "raw": "\\u{g}", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/output.json index 07b00d6194..66c1f8c3f7 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/45/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "value": { "raw": "\\u{", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/output.json index b03d29b782..e0a9cd51c3 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/46/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "value": { "raw": "\\u{", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/output.json index dab814bd83..f6098844bb 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/47/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "value": { "raw": "\\u{", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/output.json index 28b0d47818..73f36b31b1 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/48/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "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": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "value": { "raw": "\\u{", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/output.json index 0c1f9bcd50..c20647b9ca 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/49/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "value": { "raw": "\\u{\\\\", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/output.json index 6ce800288f..6d1d532d73 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/5/output.json @@ -1,81 +1,26 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "value": { "raw": "\\1", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/output.json index 2e283e2f77..14f94a2dfd 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/50/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "value": { "raw": "\\u{\\\\", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/output.json index 151b718a43..9dc1704ccb 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/51/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "value": { "raw": "\\u{\\\\", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/output.json index 0ca0c69ed0..bf1a1f2cd6 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/52/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "value": { "raw": "\\u{\\\\", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/output.json index eb1dc9edcf..a091d166a9 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/53/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "value": { "raw": "\\u{\\`", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/output.json index a0df02ed03..00c9046112 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/54/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "value": { "raw": "\\u{\\`", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/output.json index b757f165c1..1a31ef55aa 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/55/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "value": { "raw": "\\u{\\`", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/output.json index 8ee240a36b..0743ba7823 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/56/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "value": { "raw": "\\u{\\`", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/output.json index 1450743b5c..3ca7f733f3 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/57/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "\\u{0", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/output.json index 24b6f69d7f..dd14b44892 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/58/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "\\u{0", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/output.json index 26af843c60..46e5846787 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/59/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "value": { "raw": "\\u{0", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/output.json index cf4eef5577..d765a4698e 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/6/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":1,"end":3,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":3}}, "value": { "raw": "\\1", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/output.json index ad94447a58..85fc081b8e 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/60/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "value": { "raw": "\\u{0", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/output.json index c1f7f255fe..2b9b23d376 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/61/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "value": { "raw": "\\u{\\u{0}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/output.json index 5782d9c9ba..05837f4a97 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/62/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expressions": [ { "type": "NumericLiteral", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "extra": { "rawValue": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9}}, "value": { "raw": "\\u{\\u{0}", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/output.json index 2c3d41a7a4..aad86fddc4 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/63/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "value": { "raw": "\\u{\\u{0}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/output.json index 4dccbdb5cd..1710ddd99d 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/64/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "TemplateLiteral", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "value": { "raw": "\\u{\\u{0}", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/output.json index ae5fba46a8..aee11de08c 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/65/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, "value": { "raw": "\\u{110000}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/output.json index ea93f11c41..0e1c9101eb 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/66/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, "value": { "raw": "\\u{110000}", "cooked": null @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/output.json index a37b45899d..c705268ab8 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/67/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19}}, "value": { "raw": "\\u{110000}", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/output.json index 2215405793..e7434d46f7 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/68/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "type": "NumericLiteral", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}}, "extra": { "rawValue": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19}}, "value": { "raw": "\\u{110000}", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/output.json index ce27b82a7d..5a00ed65e7 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/7/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -85,18 +30,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -105,18 +39,7 @@ }, { "type": "TemplateElement", - "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}}, "value": { "raw": "\\1", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/output.json index 81d9e807fc..4d6328f56d 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/8/output.json @@ -1,80 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [ { "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": 0, "raw": "0" @@ -83,18 +28,7 @@ }, { "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": 1, "raw": "1" @@ -105,18 +39,7 @@ "quasis": [ { "type": "TemplateElement", - "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}}, "value": { "raw": "left", "cooked": "left" @@ -125,18 +48,7 @@ }, { "type": "TemplateElement", - "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}}, "value": { "raw": "\\1", "cooked": null @@ -145,18 +57,7 @@ }, { "type": "TemplateElement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "value": { "raw": "right", "cooked": "right" diff --git a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/output.json b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/output.json index 67d2c1d0b2..e2385a4024 100644 --- a/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/output.json +++ b/packages/babel-parser/test/fixtures/experimental/template-literal-invalid-escapes-untagged/9/output.json @@ -1,81 +1,26 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid escape sequence in template (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "value": { "raw": "\\xg", "cooked": null diff --git a/packages/babel-parser/test/fixtures/experimental/throw-expression/comma/output.json b/packages/babel-parser/test/fixtures/experimental/throw-expression/comma/output.json index 57d230a74e..a435e5387f 100644 --- a/packages/babel-parser/test/fixtures/experimental/throw-expression/comma/output.json +++ b/packages/babel-parser/test/fixtures/experimental/throw-expression/comma/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "test" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"test"}, "name": "test" }, "generator": false, @@ -65,78 +20,23 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":35,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":20,"end":33,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "expression": { "type": "SequenceExpression", - "start": 21, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":21,"end":31,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":13}}, "expressions": [ { "type": "UnaryExpression", - "start": 21, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":21,"end":28,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":10}}, "operator": "throw", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "extra": { "rawValue": 1, "raw": "1" @@ -146,18 +46,7 @@ }, { "type": "NumericLiteral", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":30,"end":31,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/experimental/throw-expression/expression/output.json b/packages/babel-parser/test/fixtures/experimental/throw-expression/expression/output.json index 91c2e1441d..624332e91a 100644 --- a/packages/babel-parser/test/fixtures/experimental/throw-expression/expression/output.json +++ b/packages/babel-parser/test/fixtures/experimental/throw-expression/expression/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "test" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"test"}, "name": "test" }, "generator": false, @@ -65,63 +20,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":32,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":20,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "expression": { "type": "UnaryExpression", - "start": 21, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":21,"end":28,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":10}}, "operator": "throw", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/experimental/throw-expression/logical/output.json b/packages/babel-parser/test/fixtures/experimental/throw-expression/logical/output.json index ed02f24ca9..510edbfca9 100644 --- a/packages/babel-parser/test/fixtures/experimental/throw-expression/logical/output.json +++ b/packages/babel-parser/test/fixtures/experimental/throw-expression/logical/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "test" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"test"}, "name": "test" }, "generator": false, @@ -65,94 +20,28 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":38,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":20,"end":36,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, "expression": { "type": "LogicalExpression", - "start": 20, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":20,"end":35,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}}, "left": { "type": "BooleanLiteral", - "start": 20, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":20,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "value": true }, "operator": "&&", "right": { "type": "UnaryExpression", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":28,"end":35,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":17}}, "operator": "throw", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":34,"end":35,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/experimental/throw-expression/statement/output.json b/packages/babel-parser/test/fixtures/experimental/throw-expression/statement/output.json index 21a73cbfdc..b639cf4ee0 100644 --- a/packages/babel-parser/test/fixtures/experimental/throw-expression/statement/output.json +++ b/packages/babel-parser/test/fixtures/experimental/throw-expression/statement/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "test" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"test"}, "name": "test" }, "generator": false, @@ -65,47 +20,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":30,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "body": [ { "type": "ThrowStatement", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":20,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10}}, "argument": { "type": "NumericLiteral", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/output.json index 81e260bd12..9a2bfcf9f3 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/export-default/output.json @@ -1,76 +1,21 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "declaration": { "type": "AwaitExpression", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22}}, "argument": { "type": "NumericLiteral", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/output.json index 42be5c156a..4e5b3ec144 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/for-await-module/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ForOfStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "await": true, "left": { "type": "VariableDeclaration", - "start": 11, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "a" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"a"}, "name": "a" }, "init": null @@ -97,35 +30,12 @@ }, "right": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "b" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"b"}, "name": "b" }, "body": { "type": "EmptyStatement", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}} } } ], diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/output.json index b70dffe352..120d7e5ff2 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/inside-block/output.json @@ -1,121 +1,33 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "IfStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "test": { "type": "BooleanLiteral", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "value": true }, "consequent": { "type": "BlockStatement", - "start": 10, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":24,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":14,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10}}, "expression": { "type": "AwaitExpression", - "start": 14, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":14,"end":21,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "argument": { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/output.json index 02ef8ffabf..b528894be6 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/top-level-module/output.json @@ -1,76 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AwaitExpression", - "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}}, "argument": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/output.json index 76e30779fc..73871157f8 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-allowAwaitOutsideFunction/output.json @@ -1,76 +1,21 @@ { "type": "File", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AwaitExpression", - "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}}, "argument": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" @@ -81,62 +26,18 @@ }, { "type": "ExpressionStatement", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":9,"end":18,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":9}}, "expression": { "type": "AwaitExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":9,"end":18,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":9}}, "argument": { "type": "UnaryExpression", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":15,"end":18,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9}}, "operator": "+", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":17,"end":18,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9}}, "extra": { "rawValue": 0, "raw": "0" @@ -148,62 +49,18 @@ }, { "type": "ExpressionStatement", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":19,"end":28,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":9}}, "expression": { "type": "AwaitExpression", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":19,"end":28,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":9}}, "argument": { "type": "UnaryExpression", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":25,"end":28,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":9}}, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":27,"end":28,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":9}}, "extra": { "rawValue": 0, "raw": "0" @@ -215,46 +72,13 @@ }, { "type": "ExpressionStatement", - "start": 29, - "end": 40, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":29,"end":40,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":11}}, "expression": { "type": "AwaitExpression", - "start": 29, - "end": 40, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":29,"end":40,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":11}}, "argument": { "type": "NumericLiteral", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 9 - } - }, + "start":37,"end":38,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":9}}, "extra": { "rawValue": 0, "raw": "0", @@ -267,61 +91,17 @@ }, { "type": "ExpressionStatement", - "start": 41, - "end": 52, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 11 - } - }, + "start":41,"end":52,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":11}}, "expression": { "type": "AwaitExpression", - "start": 41, - "end": 52, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 11 - } - }, + "start":41,"end":52,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":11}}, "argument": { "type": "ArrayExpression", - "start": 47, - "end": 52, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 11 - } - }, + "start":47,"end":52,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":11}}, "elements": [ { "type": "NumericLiteral", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 6, - "column": 9 - } - }, + "start":49,"end":50,"loc":{"start":{"line":6,"column":8},"end":{"line":6,"column":9}}, "extra": { "rawValue": 0, "raw": "0" @@ -334,46 +114,13 @@ }, { "type": "ExpressionStatement", - "start": 53, - "end": 65, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":53,"end":65,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":12}}, "expression": { "type": "AwaitExpression", - "start": 53, - "end": 65, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":53,"end":65,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":12}}, "argument": { "type": "RegExpLiteral", - "start": 59, - "end": 65, - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":59,"end":65,"loc":{"start":{"line":7,"column":6},"end":{"line":7,"column":12}}, "extra": { "raw": "/ 0 /u" }, diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/output.json index 5805e31955..65c37bcdec 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-modulo/output.json @@ -1,126 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "await" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"await"}, "name": "await" }, "operator": "%", "right": { "type": "CallExpression", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "callee": { "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" }, "arguments": [ { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/output.json index 76a211cbb4..0ade27b47b 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-script/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 12 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 12 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":12}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "await" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"await"}, "name": "await" } }, { "type": "ExpressionStatement", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":6,"end":7,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1}}, "expression": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":6,"end":7,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1}}, "extra": { "rawValue": 0, "raw": "0" @@ -98,64 +31,19 @@ }, { "type": "ExpressionStatement", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":9,"end":18,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":9}}, "expression": { "type": "BinaryExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":9,"end":18,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":9}}, "left": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "await" - }, + "start":9,"end":14,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":5},"identifierName":"await"}, "name": "await" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":17,"end":18,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":9}}, "extra": { "rawValue": 0, "raw": "0" @@ -166,64 +54,19 @@ }, { "type": "ExpressionStatement", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 9 - } - }, + "start":19,"end":28,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":9}}, "expression": { "type": "BinaryExpression", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 9 - } - }, + "start":19,"end":28,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":9}}, "left": { "type": "Identifier", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 5 - }, - "identifierName": "await" - }, + "start":19,"end":24,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":5},"identifierName":"await"}, "name": "await" }, "operator": "-", "right": { "type": "NumericLiteral", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 9 - } - }, + "start":27,"end":28,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":9}}, "extra": { "rawValue": 0, "raw": "0" @@ -234,64 +77,19 @@ }, { "type": "ExpressionStatement", - "start": 29, - "end": 40, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 11 - } - }, + "start":29,"end":40,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":11}}, "expression": { "type": "CallExpression", - "start": 29, - "end": 40, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 11 - } - }, + "start":29,"end":40,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":11}}, "callee": { "type": "Identifier", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 5 - }, - "identifierName": "await" - }, + "start":29,"end":34,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":5},"identifierName":"await"}, "name": "await" }, "arguments": [ { "type": "NumericLiteral", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 6, - "column": 9 - } - }, + "start":37,"end":38,"loc":{"start":{"line":6,"column":8},"end":{"line":6,"column":9}}, "extra": { "rawValue": 0, "raw": "0" @@ -303,63 +101,18 @@ }, { "type": "ExpressionStatement", - "start": 41, - "end": 52, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 11 - } - }, + "start":41,"end":52,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":11}}, "expression": { "type": "MemberExpression", - "start": 41, - "end": 52, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 11 - } - }, + "start":41,"end":52,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":11}}, "object": { "type": "Identifier", - "start": 41, - "end": 46, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 5 - }, - "identifierName": "await" - }, + "start":41,"end":46,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":5},"identifierName":"await"}, "name": "await" }, "property": { "type": "NumericLiteral", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 7, - "column": 8 - }, - "end": { - "line": 7, - "column": 9 - } - }, + "start":49,"end":50,"loc":{"start":{"line":7,"column":8},"end":{"line":7,"column":9}}, "extra": { "rawValue": 0, "raw": "0" @@ -371,78 +124,22 @@ }, { "type": "ExpressionStatement", - "start": 53, - "end": 65, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 12 - } - }, + "start":53,"end":65,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":12}}, "expression": { "type": "BinaryExpression", - "start": 53, - "end": 65, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 12 - } - }, + "start":53,"end":65,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":12}}, "left": { "type": "BinaryExpression", - "start": 53, - "end": 62, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 9 - } - }, + "start":53,"end":62,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":9}}, "left": { "type": "Identifier", - "start": 53, - "end": 58, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 5 - }, - "identifierName": "await" - }, + "start":53,"end":58,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":5},"identifierName":"await"}, "name": "await" }, "operator": "/", "right": { "type": "NumericLiteral", - "start": 61, - "end": 62, - "loc": { - "start": { - "line": 8, - "column": 8 - }, - "end": { - "line": 8, - "column": 9 - } - }, + "start":61,"end":62,"loc":{"start":{"line":8,"column":8},"end":{"line":8,"column":9}}, "extra": { "rawValue": 0, "raw": "0" @@ -453,19 +150,7 @@ "operator": "/", "right": { "type": "Identifier", - "start": 64, - "end": 65, - "loc": { - "start": { - "line": 8, - "column": 11 - }, - "end": { - "line": 8, - "column": 12 - }, - "identifierName": "u" - }, + "start":64,"end":65,"loc":{"start":{"line":8,"column":11},"end":{"line":8,"column":12},"identifierName":"u"}, "name": "u" } } diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/output.json index 5805e31955..65c37bcdec 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-ambiguous-v8intrinsinc/output.json @@ -1,126 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "await" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"await"}, "name": "await" }, "operator": "%", "right": { "type": "CallExpression", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "callee": { "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" }, "arguments": [ { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/output.json b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/output.json index 18617474f2..b1327978a1 100644 --- a/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/output.json +++ b/packages/babel-parser/test/fixtures/experimental/top-level-await/unambiguous-module/output.json @@ -1,76 +1,21 @@ { "type": "File", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":12}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AwaitExpression", - "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}}, "argument": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" @@ -81,62 +26,18 @@ }, { "type": "ExpressionStatement", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":9,"end":18,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":9}}, "expression": { "type": "AwaitExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":9,"end":18,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":9}}, "argument": { "type": "UnaryExpression", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":15,"end":18,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9}}, "operator": "+", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":17,"end":18,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9}}, "extra": { "rawValue": 0, "raw": "0" @@ -148,62 +49,18 @@ }, { "type": "ExpressionStatement", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":19,"end":28,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":9}}, "expression": { "type": "AwaitExpression", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":19,"end":28,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":9}}, "argument": { "type": "UnaryExpression", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":25,"end":28,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":9}}, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":27,"end":28,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":9}}, "extra": { "rawValue": 0, "raw": "0" @@ -215,46 +72,13 @@ }, { "type": "ExpressionStatement", - "start": 29, - "end": 40, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":29,"end":40,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":11}}, "expression": { "type": "AwaitExpression", - "start": 29, - "end": 40, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":29,"end":40,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":11}}, "argument": { "type": "NumericLiteral", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 9 - } - }, + "start":37,"end":38,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":9}}, "extra": { "rawValue": 0, "raw": "0", @@ -267,61 +91,17 @@ }, { "type": "ExpressionStatement", - "start": 41, - "end": 52, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 11 - } - }, + "start":41,"end":52,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":11}}, "expression": { "type": "AwaitExpression", - "start": 41, - "end": 52, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 11 - } - }, + "start":41,"end":52,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":11}}, "argument": { "type": "ArrayExpression", - "start": 47, - "end": 52, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 11 - } - }, + "start":47,"end":52,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":11}}, "elements": [ { "type": "NumericLiteral", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 6, - "column": 9 - } - }, + "start":49,"end":50,"loc":{"start":{"line":6,"column":8},"end":{"line":6,"column":9}}, "extra": { "rawValue": 0, "raw": "0" @@ -334,46 +114,13 @@ }, { "type": "ExpressionStatement", - "start": 53, - "end": 65, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":53,"end":65,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":12}}, "expression": { "type": "AwaitExpression", - "start": 53, - "end": 65, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":53,"end":65,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":12}}, "argument": { "type": "RegExpLiteral", - "start": 59, - "end": 65, - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":59,"end":65,"loc":{"start":{"line":7,"column":6},"end":{"line":7,"column":12}}, "extra": { "raw": "/ 0 /u" }, diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/40/output.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/40/output.json index 5ac3740768..447e720d0d 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/40/output.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/40/output.json @@ -1,196 +1,60 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "decorators": [ { "type": "Decorator", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "Identifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "bar" - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"bar"}, "name": "bar" } } ], "id": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "Foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"Foo"}, "name": "Foo" }, "superClass": { "type": "ClassExpression", - "start": 23, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":23,"end":40,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":40}}, "decorators": [ { "type": "Decorator", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27}}, "expression": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "foo" - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27},"identifierName":"foo"}, "name": "foo" } } ], "id": { "type": "Identifier", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "Bar" - }, + "start":34,"end":37,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":37},"identifierName":"Bar"}, "name": "Bar" }, "superClass": null, "body": { "type": "ClassBody", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":38,"end":40,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":40}}, "body": [] } }, "body": { "type": "ClassBody", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":41,"end":43,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":43}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/43/output.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/43/output.json index 0832c75e1b..85cdb8bc35 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/43/output.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/43/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":10,"end":26,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":26}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "foo" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"foo"}, "name": "foo" }, "computed": false, "value": { "type": "StringLiteral", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/44/output.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/44/output.json index cf4693d780..52faf1f983 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/44/output.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/44/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":10,"end":18,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":18}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "foo" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"foo"}, "name": "foo" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/45/output.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/45/output.json index 151fa64ab2..9c1064e402 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/45/output.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/45/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":10,"end":25,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":25}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":12,"end":23,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":23}}, "static": true, "key": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "foo" - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"foo"}, "name": "foo" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/46/output.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/46/output.json index 9aba248217..0c47e0453e 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/46/output.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/46/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":10,"end":33,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":33}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":12,"end":31,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":31}}, "static": true, "key": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "foo" - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"foo"}, "name": "foo" }, "computed": false, "value": { "type": "StringLiteral", - "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}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/47/output.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/47/output.json index 6f706f4594..0157ee146f 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/47/output.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/47/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":10,"end":31,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":31}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":12,"end":29,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":29}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "bar" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"bar"}, "name": "bar" } } @@ -127,36 +37,13 @@ "static": false, "key": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"foo"}, "name": "foo" }, "computed": false, "value": { "type": "StringLiteral", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/48/output.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/48/output.json index 44a2796b64..aa726dbfc5 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/48/output.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/48/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":10,"end":38,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":38}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":12,"end":36,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":36}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "bar" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"bar"}, "name": "bar" } } @@ -127,36 +37,13 @@ "static": true, "key": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "foo" - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27},"identifierName":"foo"}, "name": "foo" }, "computed": false, "value": { "type": "StringLiteral", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/49/output.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/49/output.json index c1a06bff10..0aff824b08 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/49/output.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/49/output.json @@ -1,139 +1,38 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":4,"end":29,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":29}}, "id": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "obj" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"obj"}, "name": "obj" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":10,"end":29,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":29}}, "properties": [ { "type": "ObjectProperty", - "start": 17, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":17,"end":27,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":27}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" } } @@ -141,37 +40,14 @@ "method": false, "key": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "bar" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"bar"}, "name": "bar" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27}}, "extra": { "rawValue": "wow", "raw": "'wow'" diff --git a/packages/babel-parser/test/fixtures/experimental/uncategorised/62/output.json b/packages/babel-parser/test/fixtures/experimental/uncategorised/62/output.json index 08ee75175b..485ab02b59 100644 --- a/packages/babel-parser/test/fixtures/experimental/uncategorised/62/output.json +++ b/packages/babel-parser/test/fixtures/experimental/uncategorised/62/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "decorators": [ { "type": "Decorator", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":1,"end":24,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":24}}, "callee": { "type": "Identifier", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "decorate" - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9},"identifierName":"decorate"}, "name": "decorate" }, "arguments": [ { "type": "ArrowFunctionExpression", - "start": 10, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":10,"end":23,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":23}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "arg" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"arg"}, "name": "arg" } ], "body": { "type": "NullLiteral", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":19,"end":23,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":23}} } } ] @@ -148,36 +47,13 @@ ], "id": { "type": "Identifier", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "Ex" - }, + "start":31,"end":33,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8},"identifierName":"Ex"}, "name": "Ex" }, "superClass": null, "body": { "type": "ClassBody", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":34,"end":37,"loc":{"start":{"line":2,"column":9},"end":{"line":3,"column":1}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_01/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_01/output.json index 6bf303dba1..1eff0862e7 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_01/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_01/output.json @@ -1,129 +1,40 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "FunctionTypeAnnotation", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "params": [ { "type": "FunctionTypeParam", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "name": null, "optional": false, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } } ], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":19,"end":23,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":23}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_02/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_02/output.json index baa5c0d9ed..2cd1eb6e0b 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_02/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_02/output.json @@ -1,158 +1,46 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "FunctionTypeAnnotation", - "start": 9, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":9,"end":30,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":30}}, "params": [ { "type": "FunctionTypeParam", - "start": 9, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":9,"end":25,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":25}}, "name": null, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":14,"end":22,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":22}}, "params": [ { "type": "StringTypeAnnotation", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}} } ] }, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "Array" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"Array"}, "name": "Array" } } @@ -161,18 +49,7 @@ "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 26, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":26,"end":30,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":30}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_03/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_03/output.json index 6a9c52404e..161049d508 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_03/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_03/output.json @@ -1,123 +1,34 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":4,"end":25,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":8,"end":25,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":25}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":10,"end":18,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":18}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}} } }, "id": null, @@ -126,18 +37,7 @@ "params": [], "body": { "type": "NumericLiteral", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "extra": { "rawValue": 123, "raw": "123" diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_04/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_04/output.json index 85d58b0afd..7f3d3aa197 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_04/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_04/output.json @@ -1,153 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":4,"end":34,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":8,"end":34,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":34}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "UnionTypeAnnotation", - "start": 12, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":12,"end":27,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":27}}, "types": [ { "type": "StringTypeAnnotation", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}} }, { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } ] } @@ -158,18 +47,7 @@ "params": [], "body": { "type": "NumericLiteral", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":31,"end":34,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":34}}, "extra": { "rawValue": 123, "raw": "123" diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_05/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_05/output.json index 94cfa8948a..537fb2972f 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_05/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_05/output.json @@ -1,172 +1,50 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":4,"end":35,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":35}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":8,"end":35,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":35}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 11, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":11,"end":28,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":28}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":14,"end":27,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":27}}, "params": [ { "type": "FunctionTypeParam", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}}, "name": null, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}} } } ], "rest": null, "returnType": { "type": "NumberLiteralTypeAnnotation", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27}}, "extra": { "rawValue": 123, "raw": "123" @@ -182,36 +60,13 @@ "params": [ { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" } ], "body": { "type": "NumericLiteral", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":32,"end":35,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":35}}, "extra": { "rawValue": 123, "raw": "123" diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_06/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_06/output.json index 1fd25ad194..d2ca76ff8b 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_06/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_06/output.json @@ -1,159 +1,48 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "UnionTypeAnnotation", - "start": 9, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":9,"end":35,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":35}}, "types": [ { "type": "StringTypeAnnotation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} }, { "type": "FunctionTypeAnnotation", - "start": 18, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":18,"end":35,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":35}}, "params": [ { "type": "FunctionTypeParam", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":18,"end":27,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":27}}, "name": null, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}} } } ], "rest": null, "returnType": { "type": "BooleanTypeAnnotation", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_07/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_07/output.json index 75b5e9b575..c8c0ae2b71 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_07/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_07/output.json @@ -1,159 +1,48 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "IntersectionTypeAnnotation", - "start": 9, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":9,"end":35,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":35}}, "types": [ { "type": "StringTypeAnnotation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} }, { "type": "FunctionTypeAnnotation", - "start": 18, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":18,"end":35,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":35}}, "params": [ { "type": "FunctionTypeParam", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":18,"end":27,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":27}}, "name": null, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}} } } ], "rest": null, "returnType": { "type": "BooleanTypeAnnotation", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_08/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_08/output.json index 02531eeb8d..e4f2e048e2 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_08/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_08/output.json @@ -1,125 +1,36 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "FunctionTypeAnnotation", - "start": 9, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":9,"end":27,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":27}}, "params": [ { "type": "FunctionTypeParam", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19}}, "name": null, "optional": false, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - } + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}} } } } @@ -127,18 +38,7 @@ "rest": null, "returnType": { "type": "BooleanTypeAnnotation", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_09/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_09/output.json index ad16baa608..14bf5968d9 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_09/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_09/output.json @@ -1,125 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "FunctionTypeAnnotation", - "start": 9, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":9,"end":28,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":28}}, "params": [ { "type": "FunctionTypeParam", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":9,"end":20,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":20}}, "name": null, "optional": false, "typeAnnotation": { "type": "ArrayTypeAnnotation", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "elementType": { "type": "NumberTypeAnnotation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } } } @@ -127,18 +38,7 @@ "rest": null, "returnType": { "type": "BooleanTypeAnnotation", - "start": 21, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":21,"end":28,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":28}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_10/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_10/output.json index f2854db5d7..33e95403e7 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_10/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_10/output.json @@ -1,160 +1,49 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "FunctionTypeAnnotation", - "start": 9, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":9,"end":38,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":38}}, "params": [ { "type": "FunctionTypeParam", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":27}}, "name": null, "optional": false, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":27}}, "params": [ { "type": "FunctionTypeParam", - "start": 10, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19}}, "name": null, "optional": false, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - } + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}} } } ], "rest": null, "returnType": { "type": "BooleanTypeAnnotation", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27}} }, "typeParameters": null } @@ -163,18 +52,7 @@ "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - } + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_11/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_11/output.json index 6a10b73751..67851e8ae8 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_11/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_11/output.json @@ -1,159 +1,48 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "FunctionTypeAnnotation", - "start": 9, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":9,"end":35,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":35}}, "params": [ { "type": "FunctionTypeParam", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "name": null, "optional": false, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } } ], "rest": null, "returnType": { "type": "UnionTypeAnnotation", - "start": 19, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":19,"end":35,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":35}}, "types": [ { "type": "BooleanTypeAnnotation", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - } + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}} }, { "type": "NumberTypeAnnotation", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":29,"end":35,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":35}} } ] }, diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_12/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_12/output.json index ac37720b46..c65fd54ac5 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_12/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_12/output.json @@ -1,178 +1,56 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "FunctionTypeAnnotation", - "start": 9, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":9,"end":36,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":36}}, "params": [ { "type": "FunctionTypeParam", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "name": null, "optional": false, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } } ], "rest": null, "returnType": { "type": "FunctionTypeAnnotation", - "start": 19, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":19,"end":36,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":36}}, "params": [ { "type": "FunctionTypeParam", - "start": 19, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":19,"end":29,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":29}}, "name": null, "optional": false, "typeAnnotation": { "type": "BooleanTypeAnnotation", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - } + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}} } } ], "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - } + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}} }, "typeParameters": null }, diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_13/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_13/output.json index ffad33b3ba..3208d4b4bd 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_13/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_13/output.json @@ -1,123 +1,34 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":6,"end":18,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":10,"end":18,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":18}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "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}}, "typeAnnotation": { "type": "ExistsTypeAnnotation", - "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}} } }, "id": null, @@ -126,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_14/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_14/output.json index 3b566aaa7f..eadc2d9853 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_14/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_14/output.json @@ -1,158 +1,47 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "T" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": null, "right": { "type": "GenericTypeAnnotation", - "start": 9, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":9,"end":34,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":34}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":14,"end":34,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":34}}, "params": [ { "type": "FunctionTypeAnnotation", - "start": 15, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":15,"end":33,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":33}}, "params": [ { "type": "FunctionTypeParam", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}}, "name": null, "optional": false, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} } } ], "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 33 - } - } + "start":27,"end":33,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":33}} }, "typeParameters": null } @@ -160,19 +49,7 @@ }, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "Array" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"Array"}, "name": "Array" } } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_15/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_15/output.json index fb3eb337bc..64a149197c 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_15/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-no-parens-types/good_15/output.json @@ -1,201 +1,57 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":4,"end":43,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":43}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":8,"end":43,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":43}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 10, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":10,"end":37,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":37}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 12, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":12,"end":37,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":37}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 17, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":17,"end":37,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":37}}, "params": [ { "type": "FunctionTypeAnnotation", - "start": 18, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":18,"end":36,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":36}}, "params": [ { "type": "FunctionTypeParam", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}}, "name": null, "optional": false, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}} } } ], "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - } + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}} }, "typeParameters": null } @@ -203,19 +59,7 @@ }, "id": { "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "Array" - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17},"identifierName":"Array"}, "name": "Array" } } @@ -226,18 +70,7 @@ "params": [], "body": { "type": "ArrayExpression", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":41,"end":43,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":43}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_01/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_01/output.json index ec0bc381be..00814ac016 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_01/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_01/output.json @@ -1,190 +1,56 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareFunction", - "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}}, "id": { "type": "Identifier", - "start": 17, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "foo" - }, + "start":17,"end":45,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":45},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TypeAnnotation", - "start": 20, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":20,"end":45,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":45}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 20, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":20,"end":45,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":45}}, "typeParameters": null, "params": [ { "type": "FunctionTypeParam", - "start": 21, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":21,"end":30,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":30}}, "name": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"x"}, "name": "x" }, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}} } }, { "type": "FunctionTypeParam", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}}, "name": null, "optional": false, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - } + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}} } } ], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 41, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 45 - } - } + "start":41,"end":45,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":45}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_02/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_02/output.json index d5ffb43368..73deb674b7 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_02/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_02/output.json @@ -1,31 +1,9 @@ { "type": "File", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 56 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":56}}, "program": { "type": "Program", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 56 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":56}}, "sourceType": "module", "interpreter": null, "body": [], @@ -34,34 +12,12 @@ { "type": "CommentLine", "value": " TODO: declare export syntax", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}} }, { "type": "CommentLine", "value": " declare export function foo(x: number, string): void;", - "start": 31, - "end": 87, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 56 - } - } + "start":31,"end":87,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":56}} } ] }, @@ -69,34 +25,12 @@ { "type": "CommentLine", "value": " TODO: declare export syntax", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}} }, { "type": "CommentLine", "value": " declare export function foo(x: number, string): void;", - "start": 31, - "end": 87, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 56 - } - } + "start":31,"end":87,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":56}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_03/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_03/output.json index bbd6090ffe..8dcd1b0be6 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_03/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_03/output.json @@ -1,129 +1,40 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "FunctionTypeAnnotation", - "start": 9, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":9,"end":25,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":25}}, "params": [ { "type": "FunctionTypeParam", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}}, "name": null, "optional": false, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - } + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}} } } ], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 21, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":21,"end":25,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":25}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_04/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_04/output.json index 733388df42..5dc10956fa 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_04/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_04/output.json @@ -1,129 +1,40 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "FunctionTypeAnnotation", - "start": 9, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":9,"end":26,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":26}}, "params": [ { "type": "FunctionTypeParam", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "name": null, "optional": false, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - } + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}} } } ], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 26 - } - } + "start":22,"end":26,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":26}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_05/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_05/output.json index 7c4cd7881b..0125e6307f 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_05/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_05/output.json @@ -1,158 +1,46 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "FunctionTypeAnnotation", - "start": 9, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":9,"end":32,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":32}}, "params": [ { "type": "FunctionTypeParam", - "start": 10, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":10,"end":23,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":23}}, "name": null, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 10, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":10,"end":23,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":23}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "params": [ { "type": "StringTypeAnnotation", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} } ] }, "id": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "Array" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"Array"}, "name": "Array" } } @@ -161,18 +49,7 @@ "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 28, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 32 - } - } + "start":28,"end":32,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":32}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_06/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_06/output.json index dbf419ea9c..c8e969c818 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_06/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_06/output.json @@ -1,158 +1,46 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "FunctionTypeAnnotation", - "start": 9, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33}}, "params": [ { "type": "FunctionTypeParam", - "start": 10, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":10,"end":24,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":24}}, "name": null, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 10, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":10,"end":23,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":23}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "params": [ { "type": "StringTypeAnnotation", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} } ] }, "id": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "Array" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"Array"}, "name": "Array" } } @@ -161,18 +49,7 @@ "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 33 - } - } + "start":29,"end":33,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":33}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_07/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_07/output.json index 1402c8ad8e..9441e11a5d 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_07/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_07/output.json @@ -1,177 +1,54 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "FunctionTypeAnnotation", - "start": 9, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":9,"end":36,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":36}}, "params": [ { "type": "FunctionTypeParam", - "start": 10, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19}}, "name": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" }, "optional": false, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}} } }, { "type": "FunctionTypeParam", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}}, "name": null, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } } ], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 36 - } - } + "start":32,"end":36,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":36}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_08/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_08/output.json index 16e7731de8..c39333b886 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_08/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_08/output.json @@ -1,176 +1,53 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "FunctionTypeAnnotation", - "start": 9, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":9,"end":35,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":35}}, "params": [], "rest": { "type": "FunctionTypeParam", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "name": null, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "params": [ { "type": "StringTypeAnnotation", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}} } ] }, "id": { "type": "Identifier", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "Array" - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18},"identifierName":"Array"}, "name": "Array" } } }, "returnType": { "type": "VoidTypeAnnotation", - "start": 31, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":31,"end":35,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":35}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_09/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_09/output.json index 6dd7211157..7e3230844e 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_09/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_09/output.json @@ -1,158 +1,46 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "FunctionTypeAnnotation", - "start": 9, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":9,"end":50,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":50}}, "params": [ { "type": "FunctionTypeParam", - "start": 10, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":10,"end":24,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":24}}, "name": null, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 10, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":10,"end":23,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":23}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "params": [ { "type": "StringTypeAnnotation", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} } ] }, "id": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "Array" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"Array"}, "name": "Array" } } @@ -160,99 +48,32 @@ ], "rest": { "type": "FunctionTypeParam", - "start": 28, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":28,"end":41,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":41}}, "name": null, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 28, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":28,"end":41,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":41}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 33, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":33,"end":41,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":41}}, "params": [ { "type": "StringTypeAnnotation", - "start": 34, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 40 - } - } + "start":34,"end":40,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":40}} } ] }, "id": { "type": "Identifier", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "Array" - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33},"identifierName":"Array"}, "name": "Array" } } }, "returnType": { "type": "VoidTypeAnnotation", - "start": 46, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 50 - } - } + "start":46,"end":50,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":50}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_10/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_10/output.json index 794fdff462..316359169e 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_10/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_10/output.json @@ -1,188 +1,54 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":4,"end":38,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":38}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":8,"end":38,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":38}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 11, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":11,"end":31,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":31}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 13, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":13,"end":31,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":31}}, "params": [ { "type": "FunctionTypeParam", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}}, "name": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" }, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} } } ], "rest": null, "returnType": { "type": "NumberLiteralTypeAnnotation", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":28,"end":31,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":31}}, "extra": { "rawValue": 123, "raw": "123" @@ -198,36 +64,13 @@ "params": [ { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" } ], "body": { "type": "NumericLiteral", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":35,"end":38,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":38}}, "extra": { "rawValue": 123, "raw": "123" diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_11/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_11/output.json index 015d69cae1..f437182808 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_11/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_11/output.json @@ -1,123 +1,34 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":8,"end":27,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":27}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}} } }, "id": null, @@ -126,18 +37,7 @@ "params": [], "body": { "type": "NumericLiteral", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27}}, "extra": { "rawValue": 123, "raw": "123" diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_12/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_12/output.json index 9047e8e46c..59525a928d 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_12/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_12/output.json @@ -1,153 +1,42 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":8,"end":36,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":36}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 10, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":10,"end":29,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":29}}, "typeAnnotation": { "type": "UnionTypeAnnotation", - "start": 12, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":12,"end":29,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":29}}, "types": [ { "type": "StringTypeAnnotation", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}} }, { "type": "NumberTypeAnnotation", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":22,"end":28,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":28}} } ] } @@ -158,18 +47,7 @@ "params": [], "body": { "type": "NumericLiteral", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":33,"end":36,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":36}}, "extra": { "rawValue": 123, "raw": "123" diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_13/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_13/output.json index aea51b1a9d..0aba1cc06f 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_13/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_13/output.json @@ -1,172 +1,50 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":4,"end":37,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":8,"end":37,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":37}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 11, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":11,"end":30,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":30}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "params": [ { "type": "FunctionTypeParam", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}}, "name": null, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}} } } ], "rest": null, "returnType": { "type": "NumberLiteralTypeAnnotation", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29}}, "extra": { "rawValue": 123, "raw": "123" @@ -182,36 +60,13 @@ "params": [ { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" } ], "body": { "type": "NumericLiteral", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":34,"end":37,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":37}}, "extra": { "rawValue": 123, "raw": "123" diff --git a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_14/output.json b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_14/output.json index 422a84f34f..3a3857adfc 100644 --- a/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_14/output.json +++ b/packages/babel-parser/test/fixtures/flow/anonymous-function-types/good_14/output.json @@ -1,138 +1,38 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":4,"end":25,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":8,"end":25,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":25}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20}}, "typeAnnotation": { "type": "UnionTypeAnnotation", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":13,"end":20,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":20}}, "types": [ { "type": "NumberLiteralTypeAnnotation", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 1, "raw": "1" @@ -141,18 +41,7 @@ }, { "type": "NumberLiteralTypeAnnotation", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 2, "raw": "2" @@ -168,36 +57,13 @@ "params": [ { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" } ], "body": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/flow/array-types/1/output.json b/packages/babel-parser/test/fixtures/flow/array-types/1/output.json index 06d26c8e36..fd6dd628c9 100644 --- a/packages/babel-parser/test/fixtures/flow/array-types/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/array-types/1/output.json @@ -1,121 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "a" - }, + "start":4,"end":15,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":15},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":5,"end":15,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":15}}, "typeAnnotation": { "type": "ArrayTypeAnnotation", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "elementType": { "type": "NumberTypeAnnotation", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/array-types/2/output.json b/packages/babel-parser/test/fixtures/flow/array-types/2/output.json index 9f50cb461a..9a4964e45f 100644 --- a/packages/babel-parser/test/fixtures/flow/array-types/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/array-types/2/output.json @@ -1,135 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 7, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":7,"end":16,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":16}}, "typeAnnotation": { "type": "ArrayTypeAnnotation", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "elementType": { "type": "NumberTypeAnnotation", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/array-types/3/output.json b/packages/babel-parser/test/fixtures/flow/array-types/3/output.json index 949dfb4123..ea167df54f 100644 --- a/packages/babel-parser/test/fixtures/flow/array-types/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/array-types/3/output.json @@ -1,135 +1,35 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":4,"end":18,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 4, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "a" - }, + "start":4,"end":18,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":18},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":5,"end":18,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":18}}, "typeAnnotation": { "type": "ArrayTypeAnnotation", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "elementType": { "type": "NullableTypeAnnotation", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/array-types/4/output.json b/packages/babel-parser/test/fixtures/flow/array-types/4/output.json index 51a834b881..7d395e9205 100644 --- a/packages/babel-parser/test/fixtures/flow/array-types/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/array-types/4/output.json @@ -1,137 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":4,"end":21,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "a" - }, + "start":4,"end":21,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":21},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":5,"end":21,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "params": [], "rest": null, "returnType": { "type": "ArrayTypeAnnotation", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21}}, "elementType": { "type": "NumberTypeAnnotation", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}} } }, "typeParameters": null diff --git a/packages/babel-parser/test/fixtures/flow/array-types/5/output.json b/packages/babel-parser/test/fixtures/flow/array-types/5/output.json index 896ad67541..f6fbb17357 100644 --- a/packages/babel-parser/test/fixtures/flow/array-types/5/output.json +++ b/packages/babel-parser/test/fixtures/flow/array-types/5/output.json @@ -1,137 +1,37 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":4,"end":23,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 4, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "a" - }, + "start":4,"end":23,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":23},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":5,"end":23,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "ArrayTypeAnnotation", - "start": 7, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":7,"end":23,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":23}}, "elementType": { "type": "FunctionTypeAnnotation", - "start": 8, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":8,"end":20,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":20}}, "params": [], "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/array-types/6/output.json b/packages/babel-parser/test/fixtures/flow/array-types/6/output.json index 67579952d9..30a87379e9 100644 --- a/packages/babel-parser/test/fixtures/flow/array-types/6/output.json +++ b/packages/babel-parser/test/fixtures/flow/array-types/6/output.json @@ -1,151 +1,39 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":4,"end":17,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":5,"end":17,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "ArrayTypeAnnotation", - "start": 7, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":7,"end":17,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":17}}, "elementType": { "type": "TypeofTypeAnnotation", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "argument": { "type": "GenericTypeAnnotation", - "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}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" } } diff --git a/packages/babel-parser/test/fixtures/flow/array-types/7/output.json b/packages/babel-parser/test/fixtures/flow/array-types/7/output.json index 7f4c72ed59..98aec3b80b 100644 --- a/packages/babel-parser/test/fixtures/flow/array-types/7/output.json +++ b/packages/babel-parser/test/fixtures/flow/array-types/7/output.json @@ -1,135 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":4,"end":17,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":5,"end":17,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "ArrayTypeAnnotation", - "start": 7, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":7,"end":17,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":17}}, "elementType": { "type": "ArrayTypeAnnotation", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "elementType": { "type": "NumberTypeAnnotation", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/array-types/8/output.json b/packages/babel-parser/test/fixtures/flow/array-types/8/output.json index a826331cb1..754d867e03 100644 --- a/packages/babel-parser/test/fixtures/flow/array-types/8/output.json +++ b/packages/babel-parser/test/fixtures/flow/array-types/8/output.json @@ -1,149 +1,38 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "a" - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":5,"end":19,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":19}}, "typeAnnotation": { "type": "ArrayTypeAnnotation", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "elementType": { "type": "ArrayTypeAnnotation", - "start": 7, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":7,"end":17,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":17}}, "elementType": { "type": "ArrayTypeAnnotation", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "elementType": { "type": "NumberTypeAnnotation", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/array-types/9/output.json b/packages/babel-parser/test/fixtures/flow/array-types/9/output.json index 3a8abb5ee6..f08c03454c 100644 --- a/packages/babel-parser/test/fixtures/flow/array-types/9/output.json +++ b/packages/babel-parser/test/fixtures/flow/array-types/9/output.json @@ -1,107 +1,29 @@ { "type": "File", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "a" - }, + "start":4,"end":13,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":13},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}} } } }, @@ -112,32 +34,10 @@ }, { "type": "ExpressionStatement", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":14,"end":16,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "expression": { "type": "ArrayExpression", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":14,"end":16,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/bounded-polymorphism/1/output.json b/packages/babel-parser/test/fixtures/flow/bounded-polymorphism/1/output.json index f1ad465d33..844c335657 100644 --- a/packages/babel-parser/test/fixtures/flow/bounded-polymorphism/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/bounded-polymorphism/1/output.json @@ -1,140 +1,39 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": { "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" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "params": [ { "type": "TypeParameter", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "Foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"Foo"}, "name": "Foo" } } @@ -145,18 +44,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/bounded-polymorphism/2/output.json b/packages/babel-parser/test/fixtures/flow/bounded-polymorphism/2/output.json index 94b3782bdf..e2d9cc365e 100644 --- a/packages/babel-parser/test/fixtures/flow/bounded-polymorphism/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/bounded-polymorphism/2/output.json @@ -1,140 +1,40 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "bar" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"bar"}, "name": "bar" }, "generator": false, "async": false, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}}, "params": [ { "type": "TypeParameter", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":13,"end":23,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":23}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":16,"end":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} } } } @@ -144,18 +44,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/call-properties/1/output.json b/packages/babel-parser/test/fixtures/flow/call-properties/1/output.json index 41dbc2be10..225c82bca9 100644 --- a/packages/babel-parser/test/fixtures/flow/call-properties/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/call-properties/1/output.json @@ -1,154 +1,43 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "a" - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":6,"end":22,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":22}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":22}}, "callProperties": [ { "type": "ObjectTypeCallProperty", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "static": false, "value": { "type": "FunctionTypeAnnotation", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/call-properties/2/output.json b/packages/babel-parser/test/fixtures/flow/call-properties/2/output.json index 9b2e1c34ab..7c3d10f344 100644 --- a/packages/babel-parser/test/fixtures/flow/call-properties/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/call-properties/2/output.json @@ -1,154 +1,43 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":4,"end":23,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 4, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "a" - }, + "start":4,"end":23,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":23},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":6,"end":23,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 8, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":8,"end":23,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":23}}, "callProperties": [ { "type": "ObjectTypeCallProperty", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "static": false, "value": { "type": "FunctionTypeAnnotation", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/call-properties/3/output.json b/packages/babel-parser/test/fixtures/flow/call-properties/3/output.json index edb622d15e..84334ba4a9 100644 --- a/packages/babel-parser/test/fixtures/flow/call-properties/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/call-properties/3/output.json @@ -1,233 +1,66 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":4,"end":54,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":54}}, "id": { "type": "Identifier", - "start": 4, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 54 - }, - "identifierName": "a" - }, + "start":4,"end":54,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":54},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":6,"end":54,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":54}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 8, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":8,"end":54,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":54}}, "callProperties": [ { "type": "ObjectTypeCallProperty", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "static": false, "value": { "type": "FunctionTypeAnnotation", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}} } } }, { "type": "ObjectTypeCallProperty", - "start": 33, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, "static": false, "value": { "type": "FunctionTypeAnnotation", - "start": 33, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":33,"end":52,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":52}}, "params": [ { "type": "FunctionTypeParam", - "start": 34, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":34,"end":43,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":43}}, "name": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"x"}, "name": "x" }, "optional": false, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - } + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43}} } } ], @@ -235,18 +68,7 @@ "typeParameters": null, "returnType": { "type": "StringTypeAnnotation", - "start": 46, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 52 - } - } + "start":46,"end":52,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":52}} } } } @@ -254,33 +76,10 @@ "properties": [ { "type": "ObjectTypeProperty", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31}}, "key": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "y" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"y"}, "name": "y" }, "static": false, @@ -289,18 +88,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":25,"end":31,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":31}} }, "variance": null, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/call-properties/4/output.json b/packages/babel-parser/test/fixtures/flow/call-properties/4/output.json index 718dab3195..3f664920aa 100644 --- a/packages/babel-parser/test/fixtures/flow/call-properties/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/call-properties/4/output.json @@ -1,200 +1,54 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":4,"end":30,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 4, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "a" - }, + "start":4,"end":30,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":30},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":6,"end":30,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":30}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 8, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":8,"end":30,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":30}}, "callProperties": [ { "type": "ObjectTypeCallProperty", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":27}}, "static": false, "value": { "type": "FunctionTypeAnnotation", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":27}}, "params": [ { "type": "FunctionTypeParam", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}}, "name": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" }, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "T" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"T"}, "name": "T" } } @@ -203,33 +57,11 @@ "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "params": [ { "type": "TypeParameter", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "name": "T", "variance": null } @@ -237,18 +69,7 @@ }, "returnType": { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/call-properties/5/output.json b/packages/babel-parser/test/fixtures/flow/call-properties/5/output.json index db839f06c2..891892e2f7 100644 --- a/packages/babel-parser/test/fixtures/flow/call-properties/5/output.json +++ b/packages/babel-parser/test/fixtures/flow/call-properties/5/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,65 +21,21 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 12, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":12,"end":27,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":27}}, "callProperties": [ { "type": "ObjectTypeCallProperty", - "start": 14, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":14,"end":24,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":24}}, "static": false, "value": { "type": "FunctionTypeAnnotation", - "start": 14, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":14,"end":24,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":24}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/class-private-property/1/output.json b/packages/babel-parser/test/fixtures/flow/class-private-property/1/output.json index a00beeae9d..7ec235864e 100644 --- a/packages/babel-parser/test/fixtures/flow/class-private-property/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-private-property/1/output.json @@ -1,254 +1,74 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":55,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":12,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":12,"end":18,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "prop1" - }, + "start":13,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":8},"identifierName":"prop1"}, "name": "prop1" } }, "variance": null, "typeAnnotation": { "type": "TypeAnnotation", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":18,"end":26,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":16}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - } + "start":20,"end":26,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}} } }, "value": null }, { "type": "ClassPrivateProperty", - "start": 30, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":30,"end":53,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":25}}, "static": false, "key": { "type": "PrivateName", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":30,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 31, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "prop2" - }, + "start":31,"end":36,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":8},"identifierName":"prop2"}, "name": "prop2" } }, "variance": null, "typeAnnotation": { "type": "TypeAnnotation", - "start": 36, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":36,"end":44,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":16}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 38, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 16 - } - } + "start":38,"end":44,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":16}} } }, "value": { "type": "Identifier", - "start": 47, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 24 - }, - "identifierName": "value" - }, + "start":47,"end":52,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":24},"identifierName":"value"}, "name": "value" } } diff --git a/packages/babel-parser/test/fixtures/flow/class-private-property/2/output.json b/packages/babel-parser/test/fixtures/flow/class-private-property/2/output.json index ab488ef216..6d1a176455 100644 --- a/packages/babel-parser/test/fixtures/flow/class-private-property/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-private-property/2/output.json @@ -1,237 +1,69 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":47,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":12,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":12,"end":18,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8}}, "id": { "type": "Identifier", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "prop1" - }, + "start":13,"end":18,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":8},"identifierName":"prop1"}, "name": "prop1" } }, "variance": null, "typeAnnotation": { "type": "TypeAnnotation", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":18,"end":26,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":16}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - } + "start":20,"end":26,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}} } }, "value": null }, { "type": "ClassPrivateProperty", - "start": 30, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":30,"end":45,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":17}}, "static": false, "key": { "type": "PrivateName", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":30,"end":36,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8}}, "id": { "type": "Identifier", - "start": 31, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "prop2" - }, + "start":31,"end":36,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":8},"identifierName":"prop2"}, "name": "prop2" } }, "variance": null, "typeAnnotation": { "type": "TypeAnnotation", - "start": 36, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":36,"end":44,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":16}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 38, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 16 - } - } + "start":38,"end":44,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":16}} } }, "value": null diff --git a/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field-initializer/output.json b/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field-initializer/output.json index d8b704a351..7b64fc1143 100644 --- a/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field-initializer/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field-initializer/output.json @@ -1,147 +1,46 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Initializers are not allowed in fields with the `declare` modifier. (2:17)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":30,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":12,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, "declare": true, "static": false, "key": { "type": "PrivateName", - "start": 20, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":20,"end":24,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "foo" - }, + "start":21,"end":24,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"foo"}, "name": "foo" } }, "variance": null, "value": { "type": "NumericLiteral", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field/output.json b/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field/output.json index 0b28665941..0bbd5e95ce 100644 --- a/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-private-property/declare-field/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":26,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":12,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "declare": true, "static": false, "key": { "type": "PrivateName", - "start": 20, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":20,"end":24,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "foo" - }, + "start":21,"end":24,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"foo"}, "name": "foo" } }, diff --git a/packages/babel-parser/test/fixtures/flow/class-private-property/declare-method/output.json b/packages/babel-parser/test/fixtures/flow/class-private-property/declare-method/output.json index 14ff0e5a49..ae0f5d34ba 100644 --- a/packages/babel-parser/test/fixtures/flow/class-private-property/declare-method/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-private-property/declare-method/output.json @@ -1,129 +1,39 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: The `declare` modifier can only appear on class fields. (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":31,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassPrivateMethod", - "start": 12, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":12,"end":29,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "declare": true, "static": false, "key": { "type": "PrivateName", - "start": 20, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":20,"end":24,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "foo" - }, + "start":21,"end":24,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"foo"}, "name": "foo" } }, @@ -134,18 +44,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":27,"end":29,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-after-decorators/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-after-decorators/output.json index 8750916dc0..db8d95413d 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-after-decorators/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-after-decorators/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":30,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":12,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, "decorators": [ { "type": "Decorator", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":12,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "expression": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "dec" - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"dec"}, "name": "dec" } } @@ -128,19 +38,7 @@ "static": false, "key": { "type": "Identifier", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "foo" - }, + "start":25,"end":28,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-constructor/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-constructor/output.json index af984299b9..4e384e15ae 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-constructor/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-constructor/output.json @@ -1,115 +1,36 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: The `declare` modifier can only appear on class fields. (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":38,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":12,"end":36,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":26}}, "declare": true, "static": false, "key": { "type": "Identifier", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 21 - }, - "identifierName": "constructor" - }, + "start":20,"end":31,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":21},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -120,18 +41,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":34,"end":36,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":26}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-computed/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-computed/output.json index 722c81c068..206e08e2cb 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-computed/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-computed/output.json @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":27,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":12,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "declare": true, "static": false, "computed": true, "key": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "foo" - }, + "start":21,"end":24,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"foo"}, "name": "foo" }, "variance": null, diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-initializer/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-initializer/output.json index 0de5fd4795..8786c334ee 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-initializer/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-initializer/output.json @@ -1,133 +1,43 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Initializers are not allowed in fields with the `declare` modifier. (2:16)" ], "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":29,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":12,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}}, "declare": true, "static": false, "key": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13},"identifierName":"foo"}, "name": "foo" }, "computed": false, "variance": null, "value": { "type": "NumericLiteral", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-named-static/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-named-static/output.json index bcba26999c..6b674fc50f 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-named-static/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-named-static/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":28,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "declare": true, "computed": false, "key": { "type": "Identifier", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "static" - }, + "start":20,"end":26,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16},"identifierName":"static"}, "name": "static" }, "static": false, diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-with-type/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-with-type/output.json index 03de79fdb3..596dd75186 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-with-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field-with-type/output.json @@ -1,144 +1,43 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":33,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":12,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "declare": true, "static": false, "key": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13},"identifierName":"foo"}, "name": "foo" }, "computed": false, "variance": null, "typeAnnotation": { "type": "TypeAnnotation", - "start": 23, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":23,"end":31,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":21}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 21 - } - } + "start":25,"end":31,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":21}} } }, "value": null diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field/output.json index ea95861352..3e9472582d 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-field/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-field/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":25,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "declare": true, "static": false, "key": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13},"identifierName":"foo"}, "name": "foo" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-method/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-method/output.json index 863648b54e..d8ea7350b5 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-method/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-method/output.json @@ -1,115 +1,36 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: The `declare` modifier can only appear on class fields. (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":30,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":12,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, "declare": true, "static": false, "key": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -120,18 +41,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":26,"end":28,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/declare-static-field/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/declare-static-field/output.json index d9c35eafd5..4df0de1251 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/declare-static-field/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/declare-static-field/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":32,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":12,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "declare": true, "static": true, "key": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "foo" - }, + "start":27,"end":30,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":20},"identifierName":"foo"}, "name": "foo" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare-with-type/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare-with-type/output.json index 183b79323c..60aed83690 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare-with-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare-with-type/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":29,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":12,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}}, "computed": false, "key": { "type": "Identifier", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "declare" - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9},"identifierName":"declare"}, "name": "declare" }, "static": false, "typeAnnotation": { "type": "TypeAnnotation", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":19,"end":27,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":17}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 17 - } - } + "start":21,"end":27,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":17}} } }, "value": null diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare/output.json index 87652a453f..70b00851f8 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/field-named-declare/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":21,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "computed": false, "key": { "type": "Identifier", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "declare" - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9},"identifierName":"declare"}, "name": "declare" }, "static": false, diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/getter-setter/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/getter-setter/output.json index 78d487b01a..f35d695d38 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/getter-setter/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/getter-setter/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 158, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":0,"end":158,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 158, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":0,"end":158,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 158, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":0,"end":158,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "B" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"B"}, "name": "B" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 158, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":16,"end":158,"loc":{"start":{"line":1,"column":16},"end":{"line":8,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 20, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":20,"end":35,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}}, "key": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "a" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"a"}, "name": "a" }, "static": false, @@ -117,68 +38,23 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 20, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":20,"end":35,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 17 - } - } + "start":29,"end":35,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":17}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 39, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":39,"end":61,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":24}}, "key": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "b" - }, + "start":43,"end":44,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7},"identifierName":"b"}, "name": "b" }, "static": false, @@ -187,65 +63,20 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 39, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":39,"end":61,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":24}}, "params": [ { "type": "FunctionTypeParam", - "start": 45, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":45,"end":54,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":17}}, "name": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "a" - }, + "start":45,"end":46,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9},"identifierName":"a"}, "name": "a" }, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 48, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 17 - } - } + "start":48,"end":54,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":17}} } } ], @@ -253,50 +84,17 @@ "typeParameters": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 57, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 24 - } - } + "start":57,"end":61,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":24}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 65, - "end": 82, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 19 - } - }, + "start":65,"end":82,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":19}}, "key": { "type": "StringLiteral", - "start": 69, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":69,"end":72,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":9}}, "extra": { "rawValue": "c", "raw": "\"c\"" @@ -309,67 +107,23 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 65, - "end": 82, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 19 - } - }, + "start":65,"end":82,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":19}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 76, - "end": 82, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 19 - } - } + "start":76,"end":82,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":19}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 86, - "end": 110, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 26 - } - }, + "start":86,"end":110,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":26}}, "key": { "type": "StringLiteral", - "start": 90, - "end": 93, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 9 - } - }, + "start":90,"end":93,"loc":{"start":{"line":5,"column":6},"end":{"line":5,"column":9}}, "extra": { "rawValue": "d", "raw": "\"d\"" @@ -382,65 +136,20 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 86, - "end": 110, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 26 - } - }, + "start":86,"end":110,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":26}}, "params": [ { "type": "FunctionTypeParam", - "start": 94, - "end": 103, - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 19 - } - }, + "start":94,"end":103,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":19}}, "name": { "type": "Identifier", - "start": 94, - "end": 95, - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 11 - }, - "identifierName": "a" - }, + "start":94,"end":95,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":11},"identifierName":"a"}, "name": "a" }, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 97, - "end": 103, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 19 - } - } + "start":97,"end":103,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":19}} } } ], @@ -448,50 +157,17 @@ "typeParameters": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 106, - "end": 110, - "loc": { - "start": { - "line": 5, - "column": 22 - }, - "end": { - "line": 5, - "column": 26 - } - } + "start":106,"end":110,"loc":{"start":{"line":5,"column":22},"end":{"line":5,"column":26}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 114, - "end": 129, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":114,"end":129,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":17}}, "key": { "type": "NumericLiteral", - "start": 118, - "end": 119, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 7 - } - }, + "start":118,"end":119,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -504,67 +180,23 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 114, - "end": 129, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":114,"end":129,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":17}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 123, - "end": 129, - "loc": { - "start": { - "line": 6, - "column": 11 - }, - "end": { - "line": 6, - "column": 17 - } - } + "start":123,"end":129,"loc":{"start":{"line":6,"column":11},"end":{"line":6,"column":17}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 133, - "end": 155, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 24 - } - }, + "start":133,"end":155,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":24}}, "key": { "type": "NumericLiteral", - "start": 137, - "end": 138, - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 7 - } - }, + "start":137,"end":138,"loc":{"start":{"line":7,"column":6},"end":{"line":7,"column":7}}, "extra": { "rawValue": 2, "raw": "2" @@ -577,65 +209,20 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 133, - "end": 155, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 24 - } - }, + "start":133,"end":155,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":24}}, "params": [ { "type": "FunctionTypeParam", - "start": 139, - "end": 148, - "loc": { - "start": { - "line": 7, - "column": 8 - }, - "end": { - "line": 7, - "column": 17 - } - }, + "start":139,"end":148,"loc":{"start":{"line":7,"column":8},"end":{"line":7,"column":17}}, "name": { "type": "Identifier", - "start": 139, - "end": 140, - "loc": { - "start": { - "line": 7, - "column": 8 - }, - "end": { - "line": 7, - "column": 9 - }, - "identifierName": "a" - }, + "start":139,"end":140,"loc":{"start":{"line":7,"column":8},"end":{"line":7,"column":9},"identifierName":"a"}, "name": "a" }, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 142, - "end": 148, - "loc": { - "start": { - "line": 7, - "column": 11 - }, - "end": { - "line": 7, - "column": 17 - } - } + "start":142,"end":148,"loc":{"start":{"line":7,"column":11},"end":{"line":7,"column":17}} } } ], @@ -643,18 +230,7 @@ "typeParameters": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 151, - "end": 155, - "loc": { - "start": { - "line": 7, - "column": 20 - }, - "end": { - "line": 7, - "column": 24 - } - } + "start":151,"end":155,"loc":{"start":{"line":7,"column":20},"end":{"line":7,"column":24}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/method-named-declare/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/method-named-declare/output.json index e11d3c6e16..3c3ef7f9c9 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/method-named-declare/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/method-named-declare/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":26,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":12,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "kind": "method", "computed": false, "key": { "type": "Identifier", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "declare" - }, + "start":12,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9},"identifierName":"declare"}, "name": "declare" }, "static": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/named-static/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/named-static/output.json index 81db157812..bef3b94e54 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/named-static/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/named-static/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":32,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":20,"end":29,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}}, "key": { "type": "Identifier", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "static" - }, + "start":20,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8},"identifierName":"static"}, "name": "static" }, "static": false, @@ -117,34 +38,11 @@ "method": false, "value": { "type": "GenericTypeAnnotation", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "T" - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"T"}, "name": "T" } }, diff --git a/packages/babel-parser/test/fixtures/flow/class-properties/static-field-named-declare/output.json b/packages/babel-parser/test/fixtures/flow/class-properties/static-field-named-declare/output.json index 5cbe8625f5..9b45276727 100644 --- a/packages/babel-parser/test/fixtures/flow/class-properties/static-field-named-declare/output.json +++ b/packages/babel-parser/test/fixtures/flow/class-properties/static-field-named-declare/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":28,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": true, "key": { "type": "Identifier", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "declare" - }, + "start":19,"end":26,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":16},"identifierName":"declare"}, "name": "declare" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json b/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json index 3d9ad56d93..e7dba971db 100644 --- a/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json +++ b/packages/babel-parser/test/fixtures/flow/classes/constructor-override-with-class-prop-plugin/output.json @@ -1,162 +1,50 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Classes may not have a field named 'constructor' (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":40,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 14, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":14,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":26}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, "variance": null, "typeAnnotation": { "type": "TypeAnnotation", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":25,"end":37,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":25}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 27, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":27,"end":37,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":25}}, "params": [], "rest": null, "returnType": { "type": "ThisTypeAnnotation", - "start": 33, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 25 - } - } + "start":33,"end":37,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":25}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/classes/constructor-with-class-prop-plugin/output.json b/packages/babel-parser/test/fixtures/flow/classes/constructor-with-class-prop-plugin/output.json index d3b588235d..145a6c321d 100644 --- a/packages/babel-parser/test/fixtures/flow/classes/constructor-with-class-prop-plugin/output.json +++ b/packages/babel-parser/test/fixtures/flow/classes/constructor-with-class-prop-plugin/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":8,"end":56,"loc":{"start":{"line":1,"column":8},"end":{"line":5,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":12,"end":54,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -117,95 +38,28 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 25, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":25,"end":33,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":23}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":27,"end":33,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":23}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "Object" - }, + "start":27,"end":33,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":23},"identifierName":"Object"}, "name": "Object" } } }, "body": { "type": "BlockStatement", - "start": 34, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":34,"end":54,"loc":{"start":{"line":2,"column":24},"end":{"line":4,"column":3}}, "body": [ { "type": "ReturnStatement", - "start": 40, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":40,"end":50,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":14}}, "argument": { "type": "ObjectExpression", - "start": 47, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":47,"end":49,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":13}}, "properties": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/classes/good_01/output.json b/packages/babel-parser/test/fixtures/flow/classes/good_01/output.json index 17b274597f..6a86583fe7 100644 --- a/packages/babel-parser/test/fixtures/flow/classes/good_01/output.json +++ b/packages/babel-parser/test/fixtures/flow/classes/good_01/output.json @@ -1,159 +1,47 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":8,"end":24,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":24}}, "body": [ { "type": "ClassProperty", - "start": 10, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":10,"end":22,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":22}}, "static": false, "key": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "field" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"field"}, "name": "field" }, "computed": false, "variance": null, "typeAnnotation": { "type": "TypeAnnotation", - "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}}, "typeAnnotation": { "type": "ExistsTypeAnnotation", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}} } }, "value": { "type": "NullLiteral", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}} } } ] diff --git a/packages/babel-parser/test/fixtures/flow/classes/implements-multiple/output.json b/packages/babel-parser/test/fixtures/flow/classes/implements-multiple/output.json index 850b27d807..a899ee01d1 100644 --- a/packages/babel-parser/test/fixtures/flow/classes/implements-multiple/output.json +++ b/packages/babel-parser/test/fixtures/flow/classes/implements-multiple/output.json @@ -1,129 +1,38 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "id": { "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" }, "superClass": null, "implements": [ { "type": "ClassImplements", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "B" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"B"}, "name": "B" }, "typeParameters": null }, { "type": "ClassImplements", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "C" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"C"}, "name": "C" }, "typeParameters": null @@ -131,18 +40,7 @@ ], "body": { "type": "ClassBody", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/classes/implements/output.json b/packages/babel-parser/test/fixtures/flow/classes/implements/output.json index 421fef65d7..9c4db17910 100644 --- a/packages/babel-parser/test/fixtures/flow/classes/implements/output.json +++ b/packages/babel-parser/test/fixtures/flow/classes/implements/output.json @@ -1,96 +1,28 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": { "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" }, "superClass": null, "implements": [ { "type": "ClassImplements", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "B" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"B"}, "name": "B" }, "typeParameters": null @@ -98,18 +30,7 @@ ], "body": { "type": "ClassBody", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/comment-disabled/01-type-include/output.json b/packages/babel-parser/test/fixtures/flow/comment-disabled/01-type-include/output.json index 42033b969a..89c1664778 100644 --- a/packages/babel-parser/test/fixtures/flow/comment-disabled/01-type-include/output.json +++ b/packages/babel-parser/test/fixtures/flow/comment-disabled/01-type-include/output.json @@ -1,113 +1,35 @@ { "type": "File", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "MyClass" - }, + "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13},"identifierName":"MyClass"}, "name": "MyClass" }, "superClass": null, "body": { "type": "ClassBody", - "start": 14, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":14,"end":68,"loc":{"start":{"line":1,"column":14},"end":{"line":4,"column":1}}, "body": [], "innerComments": [ { "type": "CommentBlock", "value": ":: prop: string; ", - "start": 18, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 23 - } - } + "start":18,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":23}} }, { "type": "CommentBlock", "value": " :: foo: number; ", - "start": 42, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 26 - } - } + "start":42,"end":66,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":26}} } ] } @@ -119,34 +41,12 @@ { "type": "CommentBlock", "value": ":: prop: string; ", - "start": 18, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 23 - } - } + "start":18,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":23}} }, { "type": "CommentBlock", "value": " :: foo: number; ", - "start": 42, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 26 - } - } + "start":42,"end":66,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":26}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/comment-disabled/02-type-include/output.json b/packages/babel-parser/test/fixtures/flow/comment-disabled/02-type-include/output.json index 36a3d22a48..42b8a0c60d 100644 --- a/packages/babel-parser/test/fixtures/flow/comment-disabled/02-type-include/output.json +++ b/packages/babel-parser/test/fixtures/flow/comment-disabled/02-type-include/output.json @@ -1,31 +1,9 @@ { "type": "File", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}}, "sourceType": "module", "interpreter": null, "body": [], @@ -34,18 +12,7 @@ { "type": "CommentBlock", "value": "::\ntype Foo = {\n foo: number,\n bar: boolean,\n baz: string\n};\n", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - } + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}} } ] }, @@ -53,18 +20,7 @@ { "type": "CommentBlock", "value": "::\ntype Foo = {\n foo: number,\n bar: boolean,\n baz: string\n};\n", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - } + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/comment-disabled/03-type-flow-include/output.json b/packages/babel-parser/test/fixtures/flow/comment-disabled/03-type-flow-include/output.json index 39c844aa9f..dbead3f16c 100644 --- a/packages/babel-parser/test/fixtures/flow/comment-disabled/03-type-flow-include/output.json +++ b/packages/babel-parser/test/fixtures/flow/comment-disabled/03-type-flow-include/output.json @@ -1,31 +1,9 @@ { "type": "File", - "start": 0, - "end": 79, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - }, + "start":0,"end":79,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 79, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - }, + "start":0,"end":79,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}}, "sourceType": "module", "interpreter": null, "body": [], @@ -34,18 +12,7 @@ { "type": "CommentBlock", "value": " flow-include\ntype Foo = {\n foo: number,\n bar: boolean,\n baz: string\n};\n", - "start": 0, - "end": 79, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - } + "start":0,"end":79,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}} } ] }, @@ -53,18 +20,7 @@ { "type": "CommentBlock", "value": " flow-include\ntype Foo = {\n foo: number,\n bar: boolean,\n baz: string\n};\n", - "start": 0, - "end": 79, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - } + "start":0,"end":79,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/comment-disabled/04-type-flow-include/output.json b/packages/babel-parser/test/fixtures/flow/comment-disabled/04-type-flow-include/output.json index 8c2727c7eb..b32b9fd88d 100644 --- a/packages/babel-parser/test/fixtures/flow/comment-disabled/04-type-flow-include/output.json +++ b/packages/babel-parser/test/fixtures/flow/comment-disabled/04-type-flow-include/output.json @@ -1,113 +1,35 @@ { "type": "File", - "start": 0, - "end": 90, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":90,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 90, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":90,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 90, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":90,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "MyClass" - }, + "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13},"identifierName":"MyClass"}, "name": "MyClass" }, "superClass": null, "body": { "type": "ClassBody", - "start": 14, - "end": 90, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":14,"end":90,"loc":{"start":{"line":1,"column":14},"end":{"line":4,"column":1}}, "body": [], "innerComments": [ { "type": "CommentBlock", "value": "flow-include prop: string; ", - "start": 18, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 33 - } - } + "start":18,"end":49,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":33}} }, { "type": "CommentBlock", "value": " flow-include foo: number; ", - "start": 52, - "end": 88, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 38 - } - } + "start":52,"end":88,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":38}} } ] } @@ -119,34 +41,12 @@ { "type": "CommentBlock", "value": "flow-include prop: string; ", - "start": 18, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 33 - } - } + "start":18,"end":49,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":33}} }, { "type": "CommentBlock", "value": " flow-include foo: number; ", - "start": 52, - "end": 88, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 38 - } - } + "start":52,"end":88,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":38}} } ] } \ No newline at end of file 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 c78f286ee3..1735a998c0 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "method" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"method"}, "name": "method" }, "generator": false, @@ -65,88 +20,32 @@ "params": [ { "type": "Identifier", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "param" - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21},"identifierName":"param"}, "name": "param", "trailingComments": [ { "type": "CommentBlock", "value": ": string ", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":22,"end":35,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":35}} } ] } ], "body": { "type": "BlockStatement", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":51,"end":54,"loc":{"start":{"line":1,"column":51},"end":{"line":2,"column":1}}, "body": [], "directives": [], "leadingComments": [ { "type": "CommentBlock", "value": ": string ", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":22,"end":35,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":35}} }, { "type": "CommentBlock", "value": ": number ", - "start": 37, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 50 - } - } + "start":37,"end":50,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":50}} } ] } @@ -158,34 +57,12 @@ { "type": "CommentBlock", "value": ": string ", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":22,"end":35,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":35}} }, { "type": "CommentBlock", "value": ": number ", - "start": 37, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 50 - } - } + "start":37,"end":50,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":50}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/comment/01-type-include/output.json b/packages/babel-parser/test/fixtures/flow/comment/01-type-include/output.json index b31ea80c63..825d11b984 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/01-type-include/output.json +++ b/packages/babel-parser/test/fixtures/flow/comment/01-type-include/output.json @@ -1,209 +1,63 @@ { "type": "File", - "start": 0, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":74,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":74,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":74,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "MyClass" - }, + "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13},"identifierName":"MyClass"}, "name": "MyClass" }, "superClass": null, "body": { "type": "ClassBody", - "start": 14, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":14,"end":74,"loc":{"start":{"line":1,"column":14},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 26, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":26,"end":39,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":23}}, "static": false, "key": { "type": "Identifier", - "start": 26, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "prop" - }, + "start":26,"end":30,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":14},"identifierName":"prop"}, "name": "prop" }, "computed": false, "variance": null, "typeAnnotation": { "type": "TypeAnnotation", - "start": 30, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":30,"end":38,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":22}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 22 - } - } + "start":32,"end":38,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":22}} } }, "value": null }, { "type": "ClassProperty", - "start": 55, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 26 - } - }, + "start":55,"end":69,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":26}}, "static": false, "key": { "type": "Identifier", - "start": 55, - "end": 60, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "prop2" - }, + "start":55,"end":60,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":17},"identifierName":"prop2"}, "name": "prop2" }, "computed": false, "variance": null, "typeAnnotation": { "type": "TypeAnnotation", - "start": 60, - "end": 68, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":60,"end":68,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":25}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 62, - "end": 68, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 25 - } - } + "start":62,"end":68,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":25}} } }, "value": null diff --git a/packages/babel-parser/test/fixtures/flow/comment/02-type-include/output.json b/packages/babel-parser/test/fixtures/flow/comment/02-type-include/output.json index 0eb104082d..b7c150fbef 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/02-type-include/output.json +++ b/packages/babel-parser/test/fixtures/flow/comment/02-type-include/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 5, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":5,"end":65,"loc":{"start":{"line":2,"column":0},"end":{"line":6,"column":2}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "Foo" - }, + "start":10,"end":13,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8},"identifierName":"Foo"}, "name": "Foo" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":16,"end":64,"loc":{"start":{"line":2,"column":11},"end":{"line":6,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":20,"end":31,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, "key": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -114,51 +35,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":25,"end":31,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":13}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 35, - "end": 47, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":35,"end":47,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":14}}, "key": { "type": "Identifier", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "bar" - }, + "start":35,"end":38,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":5},"identifierName":"bar"}, "name": "bar" }, "static": false, @@ -167,51 +54,17 @@ "method": false, "value": { "type": "BooleanTypeAnnotation", - "start": 40, - "end": 47, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 14 - } - } + "start":40,"end":47,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":14}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 51, - "end": 62, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":51,"end":62,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":13}}, "key": { "type": "Identifier", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 5 - }, - "identifierName": "baz" - }, + "start":51,"end":54,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":5},"identifierName":"baz"}, "name": "baz" }, "static": false, @@ -220,18 +73,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 56, - "end": 62, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 13 - } - } + "start":56,"end":62,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":13}} }, "variance": null, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/comment/03-type-flow-include/output.json b/packages/babel-parser/test/fixtures/flow/comment/03-type-flow-include/output.json index 567f48a615..0c7b19f035 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/03-type-flow-include/output.json +++ b/packages/babel-parser/test/fixtures/flow/comment/03-type-flow-include/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 79, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - }, + "start":0,"end":79,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 79, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - }, + "start":0,"end":79,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 16, - "end": 76, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":16,"end":76,"loc":{"start":{"line":2,"column":0},"end":{"line":6,"column":2}}, "id": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "Foo" - }, + "start":21,"end":24,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8},"identifierName":"Foo"}, "name": "Foo" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 27, - "end": 75, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":27,"end":75,"loc":{"start":{"line":2,"column":11},"end":{"line":6,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 31, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":31,"end":42,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, "key": { "type": "Identifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "foo" - }, + "start":31,"end":34,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -114,51 +35,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":36,"end":42,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":13}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 46, - "end": 58, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":46,"end":58,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":14}}, "key": { "type": "Identifier", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "bar" - }, + "start":46,"end":49,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":5},"identifierName":"bar"}, "name": "bar" }, "static": false, @@ -167,51 +54,17 @@ "method": false, "value": { "type": "BooleanTypeAnnotation", - "start": 51, - "end": 58, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 14 - } - } + "start":51,"end":58,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":14}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 62, - "end": 73, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":62,"end":73,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":13}}, "key": { "type": "Identifier", - "start": 62, - "end": 65, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 5 - }, - "identifierName": "baz" - }, + "start":62,"end":65,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":5},"identifierName":"baz"}, "name": "baz" }, "static": false, @@ -220,18 +73,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 67, - "end": 73, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 13 - } - } + "start":67,"end":73,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":13}} }, "variance": null, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/comment/04-type-flow-include/output.json b/packages/babel-parser/test/fixtures/flow/comment/04-type-flow-include/output.json index 908bfa823b..27ae356bb3 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/04-type-flow-include/output.json +++ b/packages/babel-parser/test/fixtures/flow/comment/04-type-flow-include/output.json @@ -1,209 +1,63 @@ { "type": "File", - "start": 0, - "end": 99, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":99,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 99, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":99,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 99, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":99,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "MyClass" - }, + "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13},"identifierName":"MyClass"}, "name": "MyClass" }, "superClass": null, "body": { "type": "ClassBody", - "start": 14, - "end": 99, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":14,"end":99,"loc":{"start":{"line":1,"column":14},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 39, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":39,"end":52,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":36}}, "static": false, "key": { "type": "Identifier", - "start": 39, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "prop" - }, + "start":39,"end":43,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":27},"identifierName":"prop"}, "name": "prop" }, "computed": false, "variance": null, "typeAnnotation": { "type": "TypeAnnotation", - "start": 43, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":43,"end":51,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":35}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 45, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 35 - } - } + "start":45,"end":51,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":35}} } }, "value": null }, { "type": "ClassProperty", - "start": 80, - "end": 94, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 38 - } - }, + "start":80,"end":94,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":38}}, "static": false, "key": { "type": "Identifier", - "start": 80, - "end": 85, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 29 - }, - "identifierName": "prop2" - }, + "start":80,"end":85,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":29},"identifierName":"prop2"}, "name": "prop2" }, "computed": false, "variance": null, "typeAnnotation": { "type": "TypeAnnotation", - "start": 85, - "end": 93, - "loc": { - "start": { - "line": 3, - "column": 29 - }, - "end": { - "line": 3, - "column": 37 - } - }, + "start":85,"end":93,"loc":{"start":{"line":3,"column":29},"end":{"line":3,"column":37}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 87, - "end": 93, - "loc": { - "start": { - "line": 3, - "column": 31 - }, - "end": { - "line": 3, - "column": 37 - } - } + "start":87,"end":93,"loc":{"start":{"line":3,"column":31},"end":{"line":3,"column":37}} } }, "value": null diff --git a/packages/babel-parser/test/fixtures/flow/comment/05-type-annotation/output.json b/packages/babel-parser/test/fixtures/flow/comment/05-type-annotation/output.json index e48859a099..e72e0dc362 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/05-type-annotation/output.json +++ b/packages/babel-parser/test/fixtures/flow/comment/05-type-annotation/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "method" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"method"}, "name": "method" }, "generator": false, @@ -65,48 +20,14 @@ "params": [ { "type": "Identifier", - "start": 16, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "param" - }, + "start":16,"end":32,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":32},"identifierName":"param"}, "name": "param", "typeAnnotation": { "type": "TypeAnnotation", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":24,"end":32,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":32}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - } + "start":26,"end":32,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":32}} } } } @@ -114,48 +35,15 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 39, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":39,"end":47,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":47}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 41, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 47 - } - } + "start":41,"end":47,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":47}} } }, "body": { "type": "BlockStatement", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":51,"end":54,"loc":{"start":{"line":1,"column":51},"end":{"line":2,"column":1}}, "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 bd82aabe61..6f4643e82a 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 @@ -1,34 +1,12 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unterminated flow-comment (1:13)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [], @@ -37,18 +15,7 @@ { "type": "CommentLine", "value": "asd */", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}} } ] }, @@ -56,18 +23,7 @@ { "type": "CommentLine", "value": "asd */", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/comment/spread/output.json b/packages/babel-parser/test/fixtures/flow/comment/spread/output.json index 1c226515e0..fb23d0c709 100644 --- a/packages/babel-parser/test/fixtures/flow/comment/spread/output.json +++ b/packages/babel-parser/test/fixtures/flow/comment/spread/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 9, - "end": 84, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":9,"end":84,"loc":{"start":{"line":2,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 18, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 37 - }, - "identifierName": "commentsAttachedToIdentifier" - }, + "start":18,"end":46,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":37},"identifierName":"commentsAttachedToIdentifier"}, "name": "commentsAttachedToIdentifier" }, "generator": false, @@ -65,160 +20,48 @@ "params": [], "body": { "type": "BlockStatement", - "start": 49, - "end": 84, - "loc": { - "start": { - "line": 2, - "column": 40 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":49,"end":84,"loc":{"start":{"line":2,"column":40},"end":{"line":4,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 53, - "end": 82, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 31 - } - }, + "start":53,"end":82,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":31}}, "declarations": [ { "type": "VariableDeclarator", - "start": 57, - "end": 81, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 30 - } - }, + "start":57,"end":81,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":30}}, "id": { "type": "Identifier", - "start": 57, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "x" - }, + "start":57,"end":58,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "ArrowFunctionExpression", - "start": 61, - "end": 81, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 30 - } - }, + "start":61,"end":81,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":30}}, "id": null, "generator": false, "async": false, "params": [ { "type": "RestElement", - "start": 62, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":62,"end":74,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":23}}, "argument": { "type": "Identifier", - "start": 65, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 18 - }, - "identifierName": "args" - }, + "start":65,"end":69,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":18},"identifierName":"args"}, "name": "args" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 69, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":69,"end":74,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":23}}, "typeAnnotation": { "type": "AnyTypeAnnotation", - "start": 71, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 23 - } - } + "start":71,"end":74,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":23}} } } } ], "body": { "type": "BlockStatement", - "start": 79, - "end": 81, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 30 - } - }, + "start":79,"end":81,"loc":{"start":{"line":3,"column":28},"end":{"line":3,"column":30}}, "body": [], "directives": [] } @@ -234,18 +77,7 @@ { "type": "CommentBlock", "value": " hi ", - "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}} } ] } @@ -256,18 +88,7 @@ { "type": "CommentBlock", "value": " hi ", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/declare-class/implements-multiple/output.json b/packages/babel-parser/test/fixtures/flow/declare-class/implements-multiple/output.json index 24f5486a6c..79c281f985 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-class/implements-multiple/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-class/implements-multiple/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -65,66 +20,20 @@ "implements": [ { "type": "InterfaceExtends", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "B" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"B"}, "name": "B" }, "typeParameters": null }, { "type": "InterfaceExtends", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "C" - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"C"}, "name": "C" }, "typeParameters": null @@ -133,18 +42,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/declare-class/implements-with-mixin/output.json b/packages/babel-parser/test/fixtures/flow/declare-class/implements-with-mixin/output.json index d89a06c3ae..80baf6d8b1 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-class/implements-with-mixin/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-class/implements-with-mixin/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -65,33 +20,10 @@ "implements": [ { "type": "InterfaceExtends", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "C" - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37},"identifierName":"C"}, "name": "C" }, "typeParameters": null @@ -100,33 +32,10 @@ "mixins": [ { "type": "InterfaceExtends", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "B" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"B"}, "name": "B" }, "typeParameters": null @@ -134,18 +43,7 @@ ], "body": { "type": "ObjectTypeAnnotation", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":38,"end":40,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":40}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/declare-class/implements/output.json b/packages/babel-parser/test/fixtures/flow/declare-class/implements/output.json index 1588d32238..83755258dc 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-class/implements/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-class/implements/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -65,33 +20,10 @@ "implements": [ { "type": "InterfaceExtends", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "B" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"B"}, "name": "B" }, "typeParameters": null @@ -100,18 +32,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "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}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/declare-class/mixins-multiple/output.json b/packages/babel-parser/test/fixtures/flow/declare-class/mixins-multiple/output.json index 8cc1f0efa1..917726c4bd 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-class/mixins-multiple/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-class/mixins-multiple/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,66 +21,20 @@ "mixins": [ { "type": "InterfaceExtends", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "B" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"B"}, "name": "B" }, "typeParameters": null }, { "type": "InterfaceExtends", - "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}}, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "C" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"C"}, "name": "C" }, "typeParameters": null @@ -133,18 +42,7 @@ ], "body": { "type": "ObjectTypeAnnotation", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/declare-class/mixins/output.json b/packages/babel-parser/test/fixtures/flow/declare-class/mixins/output.json index 6e866c706c..70d3ca7faf 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-class/mixins/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-class/mixins/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,33 +21,10 @@ "mixins": [ { "type": "InterfaceExtends", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "B" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"B"}, "name": "B" }, "typeParameters": null @@ -100,18 +32,7 @@ ], "body": { "type": "ObjectTypeAnnotation", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-class/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-class/output.json index 3f8a99853e..7e96f7035a 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-class/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-class/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 77 - } - }, + "start":0,"end":77,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":77}}, "program": { "type": "Program", - "start": 0, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 77 - } - }, + "start":0,"end":77,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":77}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 77 - } - }, + "start":0,"end":77,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":77}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -65,62 +21,17 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 77 - } - }, + "start":21,"end":77,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":77}}, "body": [ { "type": "DeclareExportDeclaration", - "start": 23, - "end": 75, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 75 - } - }, + "start":23,"end":75,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":75}}, "declaration": { "type": "DeclareClass", - "start": 38, - "end": 75, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 75 - } - }, + "start":38,"end":75,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":75}}, "id": { "type": "Identifier", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "Foo" - }, + "start":44,"end":47,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":47},"identifierName":"Foo"}, "name": "Foo" }, "typeParameters": null, @@ -129,49 +40,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 48, - "end": 75, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 75 - } - }, + "start":48,"end":75,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":75}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 50, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 72 - } - }, + "start":50,"end":72,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":72}}, "key": { "type": "Identifier", - "start": 50, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 54 - }, - "identifierName": "meth" - }, + "start":50,"end":54,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":54},"identifierName":"meth"}, "name": "meth" }, "static": false, @@ -180,65 +57,20 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 50, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 72 - } - }, + "start":50,"end":72,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":72}}, "params": [ { "type": "FunctionTypeParam", - "start": 55, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":55,"end":65,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":65}}, "name": { "type": "Identifier", - "start": 55, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 57 - }, - "identifierName": "p1" - }, + "start":55,"end":57,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":57},"identifierName":"p1"}, "name": "p1" }, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 59, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 59 - }, - "end": { - "line": 1, - "column": 65 - } - } + "start":59,"end":65,"loc":{"start":{"line":1,"column":59},"end":{"line":1,"column":65}} } } ], @@ -246,18 +78,7 @@ "typeParameters": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 68, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 68 - }, - "end": { - "line": 1, - "column": 72 - } - } + "start":68,"end":72,"loc":{"start":{"line":1,"column":68},"end":{"line":1,"column":72}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-default-arrow/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-default-arrow/output.json index ed758e8db4..f479dcf7f1 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-default-arrow/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-default-arrow/output.json @@ -1,127 +1,38 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareExportDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "declaration": { "type": "FunctionTypeAnnotation", - "start": 23, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":23,"end":43,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":43}}, "params": [ { "type": "FunctionTypeParam", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":24,"end":32,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":32}}, "name": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "a" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"a"}, "name": "a" }, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - } + "start":26,"end":32,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":32}} } } ], "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - } + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43}} }, "typeParameters": null }, diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-default-class/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-default-class/output.json index f6b7a9e995..add3d62cdb 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-default-class/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-default-class/output.json @@ -1,77 +1,21 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareExportDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "declaration": { "type": "DeclareClass", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":23,"end":33,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "A" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -80,18 +24,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "callProperties": [], "properties": [], "indexers": [], @@ -103,18 +36,7 @@ }, { "type": "EmptyStatement", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - } - } + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-default-function/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-default-function/output.json index 77bff1a2d7..670fd3f48b 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-default-function/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-default-function/output.json @@ -1,172 +1,49 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareExportDeclaration", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "declaration": { "type": "DeclareFunction", - "start": 23, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":23,"end":56,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":56}}, "id": { "type": "Identifier", - "start": 32, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 55 - }, - "identifierName": "bar" - }, + "start":32,"end":55,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":55},"identifierName":"bar"}, "name": "bar", "typeAnnotation": { "type": "TypeAnnotation", - "start": 35, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":35,"end":55,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":55}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 35, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":35,"end":55,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":55}}, "typeParameters": null, "params": [ { "type": "FunctionTypeParam", - "start": 36, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":36,"end":46,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":46}}, "name": { "type": "Identifier", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "p1" - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38},"identifierName":"p1"}, "name": "p1" }, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 40, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 46 - } - } + "start":40,"end":46,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":46}} } } ], "rest": null, "returnType": { "type": "StringTypeAnnotation", - "start": 49, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 55 - } - } + "start":49,"end":55,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":55}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-default-union/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-default-union/output.json index 6380a6ac4c..fae958e6a2 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-default-union/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-default-union/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "program": { "type": "Program", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -65,77 +21,22 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":21,"end":62,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":62}}, "body": [ { "type": "DeclareExportDeclaration", - "start": 23, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":23,"end":60,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":60}}, "declaration": { "type": "UnionTypeAnnotation", - "start": 46, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":46,"end":59,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":59}}, "types": [ { "type": "NumberTypeAnnotation", - "start": 46, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 52 - } - } + "start":46,"end":52,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":52}} }, { "type": "StringTypeAnnotation", - "start": 53, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 59 - } - } + "start":53,"end":59,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":59}} } ] }, diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-from/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-from/output.json index a5a2935367..cf7aed016f 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-from/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-from/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -65,105 +21,37 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":21,"end":56,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":56}}, "body": [ { "type": "DeclareExportDeclaration", - "start": 23, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 54 - } - }, - "declaration": null, + "start":23,"end":54,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":54}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40}}, "local": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "a" - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"a"}, "name": "a" }, "exported": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "a" - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"a"}, "name": "a" } } ], "source": { "type": "StringLiteral", - "start": 48, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":48,"end":53,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":53}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" }, "value": "bar" }, + "declaration": null, "default": false } ] diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-function/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-function/output.json index 05c38224f0..db29c7c10d 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-function/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-function/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 73 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":73}}, "program": { "type": "Program", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 73 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":73}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 73 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":73}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -65,157 +21,45 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 73 - } - }, + "start":21,"end":73,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":73}}, "body": [ { "type": "DeclareExportDeclaration", - "start": 23, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 71 - } - }, + "start":23,"end":71,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":71}}, "declaration": { "type": "DeclareFunction", - "start": 38, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 71 - } - }, + "start":38,"end":71,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":71}}, "id": { "type": "Identifier", - "start": 47, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 70 - }, - "identifierName": "bar" - }, + "start":47,"end":70,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":70},"identifierName":"bar"}, "name": "bar", "typeAnnotation": { "type": "TypeAnnotation", - "start": 50, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 70 - } - }, + "start":50,"end":70,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":70}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 50, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 70 - } - }, + "start":50,"end":70,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":70}}, "typeParameters": null, "params": [ { "type": "FunctionTypeParam", - "start": 51, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":51,"end":61,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":61}}, "name": { "type": "Identifier", - "start": 51, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 53 - }, - "identifierName": "p1" - }, + "start":51,"end":53,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":53},"identifierName":"p1"}, "name": "p1" }, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 55, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 61 - } - } + "start":55,"end":61,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":61}} } } ], "rest": null, "returnType": { "type": "StringTypeAnnotation", - "start": 64, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 64 - }, - "end": { - "line": 1, - "column": 70 - } - } + "start":64,"end":70,"loc":{"start":{"line":1,"column":64},"end":{"line":1,"column":70}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-interface-and-var/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-interface-and-var/output.json index 740f88c56b..760524238b 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-interface-and-var/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-interface-and-var/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 88, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 88 - } - }, + "start":0,"end":88,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":88}}, "program": { "type": "Program", - "start": 0, - "end": 88, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 88 - } - }, + "start":0,"end":88,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":88}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 88, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 88 - } - }, + "start":0,"end":88,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":88}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -65,64 +21,19 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 88, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 88 - } - }, + "start":21,"end":88,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":88}}, "body": [ { "type": "DeclareExportDeclaration", - "start": 23, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":23,"end":54,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":54}}, "specifiers": [], "source": null, "declaration": { "type": "InterfaceDeclaration", - "start": 38, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":38,"end":54,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":54}}, "id": { "type": "Identifier", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "bar" - }, + "start":48,"end":51,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":51},"identifierName":"bar"}, "name": "bar" }, "typeParameters": null, @@ -131,18 +42,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 52, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":52,"end":54,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":54}}, "callProperties": [], "properties": [], "indexers": [], @@ -154,76 +54,20 @@ }, { "type": "DeclareExportDeclaration", - "start": 55, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 86 - } - }, + "start":55,"end":86,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":86}}, "declaration": { "type": "DeclareVariable", - "start": 70, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 70 - }, - "end": { - "line": 1, - "column": 86 - } - }, + "start":70,"end":86,"loc":{"start":{"line":1,"column":70},"end":{"line":1,"column":86}}, "id": { "type": "Identifier", - "start": 74, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 74 - }, - "end": { - "line": 1, - "column": 85 - }, - "identifierName": "baz" - }, + "start":74,"end":85,"loc":{"start":{"line":1,"column":74},"end":{"line":1,"column":85},"identifierName":"baz"}, "name": "baz", "typeAnnotation": { "type": "TypeAnnotation", - "start": 77, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 77 - }, - "end": { - "line": 1, - "column": 85 - } - }, + "start":77,"end":85,"loc":{"start":{"line":1,"column":77},"end":{"line":1,"column":85}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 79, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 79 - }, - "end": { - "line": 1, - "column": 85 - } - } + "start":79,"end":85,"loc":{"start":{"line":1,"column":79},"end":{"line":1,"column":85}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-interface-commonjs/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-interface-commonjs/output.json index 2fb99dda68..d9726e70ef 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-interface-commonjs/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-interface-commonjs/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 88, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 88 - } - }, + "start":0,"end":88,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":88}}, "program": { "type": "Program", - "start": 0, - "end": 88, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 88 - } - }, + "start":0,"end":88,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":88}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 88, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 88 - } - }, + "start":0,"end":88,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":88}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -65,64 +21,19 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 88, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 88 - } - }, + "start":21,"end":88,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":88}}, "body": [ { "type": "DeclareExportDeclaration", - "start": 23, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":23,"end":54,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":54}}, "specifiers": [], "source": null, "declaration": { "type": "InterfaceDeclaration", - "start": 38, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":38,"end":54,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":54}}, "id": { "type": "Identifier", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "bar" - }, + "start":48,"end":51,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":51},"identifierName":"bar"}, "name": "bar" }, "typeParameters": null, @@ -131,18 +42,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 52, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":52,"end":54,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":54}}, "callProperties": [], "properties": [], "indexers": [], @@ -154,46 +54,13 @@ }, { "type": "DeclareModuleExports", - "start": 55, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 86 - } - }, + "start":55,"end":86,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":86}}, "typeAnnotation": { "type": "TypeAnnotation", - "start": 77, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 77 - }, - "end": { - "line": 1, - "column": 85 - } - }, + "start":77,"end":85,"loc":{"start":{"line":1,"column":77},"end":{"line":1,"column":85}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 79, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 79 - }, - "end": { - "line": 1, - "column": 85 - } - } + "start":79,"end":85,"loc":{"start":{"line":1,"column":79},"end":{"line":1,"column":85}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-interface/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-interface/output.json index a494879bac..7a59420775 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-interface/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -65,64 +21,19 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":21,"end":56,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":56}}, "body": [ { "type": "DeclareExportDeclaration", - "start": 23, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":23,"end":54,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":54}}, "specifiers": [], "source": null, "declaration": { "type": "InterfaceDeclaration", - "start": 38, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":38,"end":54,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":54}}, "id": { "type": "Identifier", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "bar" - }, + "start":48,"end":51,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":51},"identifierName":"bar"}, "name": "bar" }, "typeParameters": null, @@ -131,18 +42,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 52, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":52,"end":54,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":54}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-named-pattern/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-named-pattern/output.json index c3b63e8c23..83207c37db 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-named-pattern/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-named-pattern/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "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}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -65,80 +21,23 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":21,"end":45,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":45}}, "body": [ { "type": "DeclareExportDeclaration", - "start": 23, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":23,"end":43,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":43}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40}}, "local": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "a" - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"a"}, "name": "a" }, "exported": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "a" - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"a"}, "name": "a" } } @@ -153,48 +52,14 @@ }, { "type": "VariableDeclaration", - "start": 46, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":46,"end":52,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "declarations": [ { "type": "VariableDeclarator", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":50,"end":51,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}}, "id": { "type": "Identifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "a" - }, + "start":50,"end":51,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"a"}, "name": "a" }, "init": null diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-star-as/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-star-as/output.json index 8363587b4d..fbec921c64 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-star-as/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-star-as/output.json @@ -1,96 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareExportDeclaration", - "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}}, "specifiers": [ { "type": "ExportNamespaceSpecifier", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24}}, "exported": { "type": "Identifier", - "start": 20, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "test" - }, + "start":20,"end":24,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":24},"identifierName":"test"}, "name": "test" } } ], "source": { "type": "StringLiteral", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":30,"end":32,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":32}}, "extra": { "rawValue": "", "raw": "''" diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-star/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-star/output.json index 74efda6cff..367eb9f203 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-star/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-star/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -65,47 +21,14 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":21,"end":53,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":53}}, "body": [ { "type": "DeclareExportAllDeclaration", - "start": 23, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":23,"end":51,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":51}}, "source": { "type": "StringLiteral", - "start": 45, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":45,"end":50,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":50}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-type-and-var/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-type-and-var/output.json index df7282a5b0..3d09e16a99 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-type-and-var/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-type-and-var/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 90, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 90 - } - }, + "start":0,"end":90,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":90}}, "program": { "type": "Program", - "start": 0, - "end": 90, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 90 - } - }, + "start":0,"end":90,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":90}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 90, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 90 - } - }, + "start":0,"end":90,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":90}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -65,157 +21,45 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 90, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 90 - } - }, + "start":21,"end":90,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":90}}, "body": [ { "type": "DeclareExportDeclaration", - "start": 23, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":23,"end":56,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":56}}, "specifiers": [], "source": null, "declaration": { "type": "TypeAlias", - "start": 38, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":38,"end":56,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":56}}, "id": { "type": "Identifier", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "bar" - }, + "start":43,"end":46,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":46},"identifierName":"bar"}, "name": "bar" }, "typeParameters": null, "right": { "type": "NumberTypeAnnotation", - "start": 49, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 55 - } - } + "start":49,"end":55,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":55}} } }, "default": false }, { "type": "DeclareExportDeclaration", - "start": 57, - "end": 88, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 88 - } - }, + "start":57,"end":88,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":88}}, "declaration": { "type": "DeclareVariable", - "start": 72, - "end": 88, - "loc": { - "start": { - "line": 1, - "column": 72 - }, - "end": { - "line": 1, - "column": 88 - } - }, + "start":72,"end":88,"loc":{"start":{"line":1,"column":72},"end":{"line":1,"column":88}}, "id": { "type": "Identifier", - "start": 76, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 76 - }, - "end": { - "line": 1, - "column": 87 - }, - "identifierName": "baz" - }, + "start":76,"end":87,"loc":{"start":{"line":1,"column":76},"end":{"line":1,"column":87},"identifierName":"baz"}, "name": "baz", "typeAnnotation": { "type": "TypeAnnotation", - "start": 79, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 79 - }, - "end": { - "line": 1, - "column": 87 - } - }, + "start":79,"end":87,"loc":{"start":{"line":1,"column":79},"end":{"line":1,"column":87}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 81, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 81 - }, - "end": { - "line": 1, - "column": 87 - } - } + "start":81,"end":87,"loc":{"start":{"line":1,"column":81},"end":{"line":1,"column":87}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-type-commonjs/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-type-commonjs/output.json index eb8a0af738..6c04210e9a 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-type-commonjs/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-type-commonjs/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 90, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 90 - } - }, + "start":0,"end":90,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":90}}, "program": { "type": "Program", - "start": 0, - "end": 90, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 90 - } - }, + "start":0,"end":90,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":90}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 90, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 90 - } - }, + "start":0,"end":90,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":90}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -65,127 +21,38 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 90, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 90 - } - }, + "start":21,"end":90,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":90}}, "body": [ { "type": "DeclareExportDeclaration", - "start": 23, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":23,"end":56,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":56}}, "specifiers": [], "source": null, "declaration": { "type": "TypeAlias", - "start": 38, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":38,"end":56,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":56}}, "id": { "type": "Identifier", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "bar" - }, + "start":43,"end":46,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":46},"identifierName":"bar"}, "name": "bar" }, "typeParameters": null, "right": { "type": "NumberTypeAnnotation", - "start": 49, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 55 - } - } + "start":49,"end":55,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":55}} } }, "default": false }, { "type": "DeclareModuleExports", - "start": 57, - "end": 88, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 88 - } - }, + "start":57,"end":88,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":88}}, "typeAnnotation": { "type": "TypeAnnotation", - "start": 79, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 79 - }, - "end": { - "line": 1, - "column": 87 - } - }, + "start":79,"end":87,"loc":{"start":{"line":1,"column":79},"end":{"line":1,"column":87}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 81, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 81 - }, - "end": { - "line": 1, - "column": 87 - } - } + "start":81,"end":87,"loc":{"start":{"line":1,"column":81},"end":{"line":1,"column":87}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-type-star-from/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-type-star-from/output.json index fb3c7035c6..ea3b0a8201 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-type-star-from/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-type-star-from/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -65,48 +21,15 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":21,"end":58,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":58}}, "body": [ { "type": "DeclareExportAllDeclaration", - "start": 23, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":23,"end":56,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":56}}, "exportKind": "type", "source": { "type": "StringLiteral", - "start": 50, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":50,"end":55,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":55}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-type/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-type/output.json index f6916e1975..563b5a9fba 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-type/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":58}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -65,81 +21,25 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":21,"end":58,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":58}}, "body": [ { "type": "DeclareExportDeclaration", - "start": 23, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":23,"end":56,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":56}}, "specifiers": [], "source": null, "declaration": { "type": "TypeAlias", - "start": 38, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":38,"end":56,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":56}}, "id": { "type": "Identifier", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "bar" - }, + "start":43,"end":46,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":46},"identifierName":"bar"}, "name": "bar" }, "typeParameters": null, "right": { "type": "NumberTypeAnnotation", - "start": 49, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 55 - } - } + "start":49,"end":55,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":55}} } }, "default": false diff --git a/packages/babel-parser/test/fixtures/flow/declare-export/export-var/output.json b/packages/babel-parser/test/fixtures/flow/declare-export/export-var/output.json index ed757b4339..256231c0f4 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-export/export-var/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-export/export-var/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -65,91 +21,24 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":21,"end":54,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":54}}, "body": [ { "type": "DeclareExportDeclaration", - "start": 23, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":23,"end":52,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":52}}, "declaration": { "type": "DeclareVariable", - "start": 38, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":38,"end":52,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":52}}, "id": { "type": "Identifier", - "start": 42, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "a" - }, + "start":42,"end":51,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":51},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 43, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":43,"end":51,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":51}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 45, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 51 - } - } + "start":45,"end":51,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":51}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/1/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/1/output.json index f4f7fc14c0..a2a16a81e0 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/1/output.json @@ -1,79 +1,23 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "A" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"A"}, "name": "A" }, "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [] }, "kind": "CommonJS" diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/10/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/10/output.json index 84347d7d56..ffea09887f 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/10/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/10/output.json @@ -1,107 +1,29 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModuleExports", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "typeAnnotation": { "type": "TypeAnnotation", - "start": 22, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":22,"end":42,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":42}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 24, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":24,"end":42,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":42}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 26, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":26,"end":39,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":39}}, "key": { "type": "Identifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "foo" - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -110,35 +32,13 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 26, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":26,"end":39,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":39}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - } + "start":33,"end":39,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":39}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/2/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/2/output.json index d232518f39..530e73f24c 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/2/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":15,"end":25,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":25}}, "extra": { "rawValue": "./a/b.js", "raw": "\"./a/b.js\"" @@ -65,18 +21,7 @@ }, "body": { "type": "BlockStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "body": [] }, "kind": "CommonJS" diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/3/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/3/output.json index 3f8901ca6b..19be820441 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/3/output.json @@ -1,138 +1,37 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "A" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"A"}, "name": "A" }, "body": { "type": "BlockStatement", - "start": 17, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":17,"end":43,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":43}}, "body": [ { "type": "DeclareVariable", - "start": 19, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":19,"end":41,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":41}}, "id": { "type": "Identifier", - "start": 31, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "x" - }, + "start":31,"end":40,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":40},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 32, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":32,"end":40,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":40}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 34, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 40 - } - } + "start":34,"end":40,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":40}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/4/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/4/output.json index b720bcb8bb..4815b5f5dc 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/4/output.json @@ -1,155 +1,43 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "A" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"A"}, "name": "A" }, "body": { "type": "BlockStatement", - "start": 17, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":17,"end":52,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":52}}, "body": [ { "type": "DeclareFunction", - "start": 19, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":19,"end":50,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":50}}, "id": { "type": "Identifier", - "start": 36, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 49 - }, - "identifierName": "foo" - }, + "start":36,"end":49,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":49},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TypeAnnotation", - "start": 39, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":39,"end":49,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":49}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 39, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":39,"end":49,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":49}}, "typeParameters": null, "params": [], "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 43, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 49 - } - } + "start":43,"end":49,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":49}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/5/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/5/output.json index 4135f43e1d..20e0428453 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/5/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/5/output.json @@ -1,109 +1,30 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "A" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"A"}, "name": "A" }, "body": { "type": "BlockStatement", - "start": 17, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":17,"end":55,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":55}}, "body": [ { "type": "DeclareClass", - "start": 19, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":19,"end":53,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":53}}, "id": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "B" - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"B"}, "name": "B" }, "typeParameters": null, @@ -112,49 +33,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 35, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":35,"end":53,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":53}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 37, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":37,"end":50,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":50}}, "key": { "type": "Identifier", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "foo" - }, + "start":37,"end":40,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":40},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -163,35 +50,13 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 37, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":37,"end":50,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":50}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 44, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 50 - } - } + "start":44,"end":50,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":50}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/6/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/6/output.json index e2a2f288cb..dcc3dbe026 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/6/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/6/output.json @@ -1,153 +1,41 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "A" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"A"}, "name": "A" }, "body": { "type": "BlockStatement", - "start": 17, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":17,"end":63,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":63}}, "body": [ { "type": "DeclareModuleExports", - "start": 19, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":19,"end":61,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":61}}, "typeAnnotation": { "type": "TypeAnnotation", - "start": 41, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":41,"end":61,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":61}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 43, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":43,"end":61,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":61}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 45, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":45,"end":58,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":58}}, "key": { "type": "Identifier", - "start": 45, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "foo" - }, + "start":45,"end":48,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":48},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -156,35 +44,13 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 45, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":45,"end":58,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":58}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 52, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 58 - } - } + "start":52,"end":58,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":58}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/9/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/9/output.json index a732ac8a65..fcaeaf699b 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/9/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/9/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "A" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"A"}, "name": "A" }, "body": { "type": "BlockStatement", - "start": 17, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":17,"end":52,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":52}}, "body": [ { "type": "DeclareModuleExports", - "start": 19, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":19,"end":50,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":50}}, "typeAnnotation": { "type": "TypeAnnotation", - "start": 41, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":41,"end":49,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":49}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 43, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 49 - } - } + "start":43,"end":49,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":49}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/import/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/import/output.json index f7bb57172e..f559a7704e 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/import/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/import/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "extra": { "rawValue": "M", "raw": "\"M\"" @@ -65,63 +21,18 @@ }, "body": { "type": "BlockStatement", - "start": 19, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":19,"end":78,"loc":{"start":{"line":1,"column":19},"end":{"line":4,"column":1}}, "body": [ { "type": "ImportDeclaration", - "start": 23, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":23,"end":47,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":26}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":35,"end":36,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "local": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "T" - }, + "start":35,"end":36,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"T"}, "name": "T" } } @@ -129,18 +40,7 @@ "importKind": "type", "source": { "type": "StringLiteral", - "start": 42, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":42,"end":46,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":25}}, "extra": { "rawValue": "TM", "raw": "\"TM\"" @@ -150,48 +50,14 @@ }, { "type": "ImportDeclaration", - "start": 50, - "end": 76, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 28 - } - }, + "start":50,"end":76,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":28}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 64, - "end": 65, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":64,"end":65,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17}}, "local": { "type": "Identifier", - "start": 64, - "end": 65, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "U" - }, + "start":64,"end":65,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17},"identifierName":"U"}, "name": "U" } } @@ -199,18 +65,7 @@ "importKind": "typeof", "source": { "type": "StringLiteral", - "start": 71, - "end": 75, - "loc": { - "start": { - "line": 3, - "column": 23 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":71,"end":75,"loc":{"start":{"line":3,"column":23},"end":{"line":3,"column":27}}, "extra": { "rawValue": "UM", "raw": "\"UM\"" diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/output.json index 43cb8ee092..6b671f1ed6 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-commonjs-module/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 87 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":87}}, "errors": [ "SyntaxError: Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module (1:55)" ], "program": { "type": "Program", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 87 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":87}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 87 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":87}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -68,136 +24,36 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 87 - } - }, + "start":21,"end":87,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":87}}, "body": [ { "type": "DeclareModuleExports", - "start": 23, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":23,"end":54,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":54}}, "typeAnnotation": { "type": "TypeAnnotation", - "start": 45, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":45,"end":53,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":53}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 47, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 53 - } - } + "start":47,"end":53,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":53}} } } }, { "type": "DeclareExportDeclaration", - "start": 55, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 84 - } - }, + "start":55,"end":84,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":84}}, "declaration": { "type": "DeclareVariable", - "start": 70, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 70 - }, - "end": { - "line": 1, - "column": 84 - } - }, + "start":70,"end":84,"loc":{"start":{"line":1,"column":70},"end":{"line":1,"column":84}}, "id": { "type": "Identifier", - "start": 74, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 74 - }, - "end": { - "line": 1, - "column": 83 - }, - "identifierName": "a" - }, + "start":74,"end":83,"loc":{"start":{"line":1,"column":74},"end":{"line":1,"column":83},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 75, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 75 - }, - "end": { - "line": 1, - "column": 83 - } - }, + "start":75,"end":83,"loc":{"start":{"line":1,"column":75},"end":{"line":1,"column":83}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 77, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 77 - }, - "end": { - "line": 1, - "column": 83 - } - } + "start":77,"end":83,"loc":{"start":{"line":1,"column":77},"end":{"line":1,"column":83}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/output.json index 536157fab7..a1bf5fae4b 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-es-module/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 86 - } - }, + "start":0,"end":86,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":86}}, "errors": [ "SyntaxError: Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module (1:53)" ], "program": { "type": "Program", - "start": 0, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 86 - } - }, + "start":0,"end":86,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":86}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 86 - } - }, + "start":0,"end":86,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":86}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -68,91 +24,24 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 86 - } - }, + "start":21,"end":86,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":86}}, "body": [ { "type": "DeclareExportDeclaration", - "start": 23, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":23,"end":52,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":52}}, "declaration": { "type": "DeclareVariable", - "start": 38, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":38,"end":52,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":52}}, "id": { "type": "Identifier", - "start": 42, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "a" - }, + "start":42,"end":51,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":51},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 43, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":43,"end":51,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":51}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 45, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 51 - } - } + "start":45,"end":51,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":51}} } } } @@ -161,46 +50,13 @@ }, { "type": "DeclareModuleExports", - "start": 53, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 84 - } - }, + "start":53,"end":84,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":84}}, "typeAnnotation": { "type": "TypeAnnotation", - "start": 75, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 75 - }, - "end": { - "line": 1, - "column": 83 - } - }, + "start":75,"end":83,"loc":{"start":{"line":1,"column":75},"end":{"line":1,"column":83}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 77, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 77 - }, - "end": { - "line": 1, - "column": 83 - } - } + "start":77,"end":83,"loc":{"start":{"line":1,"column":77},"end":{"line":1,"column":83}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/output.json index 2d33b963c7..6155f8eda4 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-import/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "errors": [ "SyntaxError: Imports within a `declare module` body must always be `import type` or `import typeof` (1:21)" ], "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "extra": { "rawValue": "M", "raw": "\"M\"" @@ -68,63 +24,18 @@ }, "body": { "type": "BlockStatement", - "start": 19, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":19,"end":42,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":42}}, "body": [ { "type": "ImportDeclaration", - "start": 21, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":21,"end":40,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":40}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29}}, "local": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "T" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"T"}, "name": "T" } } @@ -132,18 +43,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 35, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":35,"end":39,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":39}}, "extra": { "rawValue": "TM", "raw": "\"TM\"" diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/output.json index 0a3fe70d86..bd3851fd4f 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-module-in-module/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "errors": [ "SyntaxError: `declare module` cannot be used inside another `declare module` (1:27)" ], "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "A" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"A"}, "name": "A" }, "body": { "type": "BlockStatement", - "start": 17, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":17,"end":40,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":40}}, "body": [ { "type": "DeclareModule", - "start": 19, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":19,"end":38,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":38}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "B" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"B"}, "name": "B" }, "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38}}, "body": [] }, "kind": "CommonJS" diff --git a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/output.json b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/output.json index 4339f6dbf5..b16aeb7c7e 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-module/invalid-multiple-commonjs/output.json @@ -1,65 +1,21 @@ { "type": "File", - "start": 0, - "end": 88, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 88 - } - }, + "start":0,"end":88,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":88}}, "errors": [ "SyntaxError: Duplicate `declare module.exports` statement (1:55)" ], "program": { "type": "Program", - "start": 0, - "end": 88, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 88 - } - }, + "start":0,"end":88,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":88}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 88, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 88 - } - }, + "start":0,"end":88,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":88}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -68,106 +24,29 @@ }, "body": { "type": "BlockStatement", - "start": 21, - "end": 88, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 88 - } - }, + "start":21,"end":88,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":88}}, "body": [ { "type": "DeclareModuleExports", - "start": 23, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":23,"end":54,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":54}}, "typeAnnotation": { "type": "TypeAnnotation", - "start": 45, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":45,"end":53,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":53}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 47, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 53 - } - } + "start":47,"end":53,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":53}} } } }, { "type": "DeclareModuleExports", - "start": 55, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 86 - } - }, + "start":55,"end":86,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":86}}, "typeAnnotation": { "type": "TypeAnnotation", - "start": 77, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 77 - }, - "end": { - "line": 1, - "column": 85 - } - }, + "start":77,"end":85,"loc":{"start":{"line":1,"column":77},"end":{"line":1,"column":85}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 79, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 79 - }, - "end": { - "line": 1, - "column": 85 - } - } + "start":79,"end":85,"loc":{"start":{"line":1,"column":79},"end":{"line":1,"column":85}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/1/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/1/output.json index 24275a8a05..4897431c82 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/1/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareVariable", - "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}}, "id": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "foo" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"foo"}, "name": "foo" } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/10/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/10/output.json index cf4fbe9e78..06a5d571ff 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/10/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/10/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "program": { "type": "Program", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":16,"end":59,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":59}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 18, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":18,"end":38,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":38}}, "key": { "type": "Identifier", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "foo" - }, + "start":25,"end":28,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":28},"identifierName":"foo"}, "name": "foo" }, "static": true, @@ -117,68 +38,23 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 18, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":18,"end":38,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":38}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - } + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 40, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":40,"end":57,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":57}}, "key": { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "x" - }, + "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48},"identifierName":"x"}, "name": "x" }, "static": true, @@ -187,18 +63,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 51, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 57 - } - } + "start":51,"end":57,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":57}} }, "variance": null, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/11/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/11/output.json index 4bcd18e227..bb35e56046 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/11/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/11/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,82 +21,26 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":16,"end":53,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":53}}, "callProperties": [], "properties": [], "indexers": [ { "type": "ObjectTypeIndexer", - "start": 18, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":18,"end":51,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":51}}, "static": true, "id": { "type": "Identifier", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "indexer" - }, + "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34},"identifierName":"indexer"}, "name": "indexer" }, "key": { "type": "NumberTypeAnnotation", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } - } + "start":36,"end":42,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":42}} }, "value": { "type": "StringTypeAnnotation", - "start": 45, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 51 - } - } + "start":45,"end":51,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":51}} }, "variance": null } diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/12/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/12/output.json index eadc63d41e..63f60d28b1 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/12/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/12/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "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}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,65 +21,21 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":16,"end":38,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":38}}, "callProperties": [ { "type": "ObjectTypeCallProperty", - "start": 18, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":18,"end":36,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":36}}, "static": true, "value": { "type": "FunctionTypeAnnotation", - "start": 25, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":25,"end":36,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":36}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - } + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/13/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/13/output.json index 873631284e..bb7c3a0dce 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/13/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/13/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,80 +21,23 @@ "mixins": [ { "type": "InterfaceExtends", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "B" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"B"}, "name": "B" }, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "T" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"T"}, "name": "T" } } @@ -148,33 +46,10 @@ }, { "type": "InterfaceExtends", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "C" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"C"}, "name": "C" }, "typeParameters": null @@ -182,18 +57,7 @@ ], "body": { "type": "ObjectTypeAnnotation", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/14/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/14/output.json index a7b76763db..4d6e56841a 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/14/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/14/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":38}}, "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":38}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareTypeAlias", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "A" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "StringTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} } }, { "type": "DeclareTypeAlias", - "start": 25, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":25,"end":63,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":38}}, "id": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "T" - }, + "start":38,"end":39,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"T"}, "name": "T" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":39,"end":42,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17}}, "params": [ { "type": "TypeParameter", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":40,"end":41,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16}}, "name": "U", "variance": null } @@ -144,98 +43,30 @@ }, "right": { "type": "ObjectTypeAnnotation", - "start": 45, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":45,"end":62,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":37}}, "callProperties": [], "properties": [], "indexers": [ { "type": "ObjectTypeIndexer", - "start": 47, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":47,"end":60,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":35}}, "static": false, "id": { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "k" - }, + "start":48,"end":49,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":24},"identifierName":"k"}, "name": "k" }, "key": { "type": "StringTypeAnnotation", - "start": 50, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 31 - } - } + "start":50,"end":56,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":31}} }, "value": { "type": "GenericTypeAnnotation", - "start": 59, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 34 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":59,"end":60,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":35}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 59, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 34 - }, - "end": { - "line": 2, - "column": 35 - }, - "identifierName": "U" - }, + "start":59,"end":60,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":35},"identifierName":"U"}, "name": "U" } }, diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/15/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/15/output.json index 619a44a76f..ed22d30c4c 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/15/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/15/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareInterface", - "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}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "I" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"I"}, "name": "I" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 20, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":20,"end":35,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":35}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 22, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":22,"end":33,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":33}}, "key": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -117,18 +38,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 33 - } - } + "start":27,"end":33,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":33}} }, "variance": null, "optional": false @@ -141,64 +51,19 @@ }, { "type": "DeclareInterface", - "start": 36, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":36,"end":70,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}}, "id": { "type": "Identifier", - "start": 54, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "I2" - }, + "start":54,"end":56,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20},"identifierName":"I2"}, "name": "I2" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 56, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":56,"end":59,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23}}, "params": [ { "type": "TypeParameter", - "start": 57, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":57,"end":58,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22}}, "name": "T", "variance": null } @@ -209,49 +74,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 60, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":60,"end":70,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":34}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 62, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":62,"end":68,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":32}}, "key": { "type": "Identifier", - "start": 62, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 29 - }, - "identifierName": "foo" - }, + "start":62,"end":65,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":29},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -260,34 +91,11 @@ "method": false, "value": { "type": "GenericTypeAnnotation", - "start": 67, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 31 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":67,"end":68,"loc":{"start":{"line":2,"column":31},"end":{"line":2,"column":32}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 67, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 31 - }, - "end": { - "line": 2, - "column": 32 - }, - "identifierName": "T" - }, + "start":67,"end":68,"loc":{"start":{"line":2,"column":31},"end":{"line":2,"column":32},"identifierName":"T"}, "name": "T" } }, diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/16/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/16/output.json index 211d7604e3..ce672f2280 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/16/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/16/output.json @@ -1,159 +1,45 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "extends": [ { "type": "InterfaceExtends", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29}}, "id": { "type": "QualifiedTypeIdentifier", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29}}, "qualification": { "type": "QualifiedTypeIdentifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27}}, "qualification": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "C" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"C"}, "name": "C" }, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "B" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"B"}, "name": "B" } }, "id": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "D" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"D"}, "name": "D" } }, @@ -164,18 +50,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":30,"end":33,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":33}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/17/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/17/output.json index 26cebcf0a0..d881d6276b 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/17/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/17/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "X" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"X"}, "name": "X" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":16,"end":62,"loc":{"start":{"line":1,"column":16},"end":{"line":5,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":19,"end":28,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":10}}, "key": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 2 - }, - "identifierName": "a" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":2},"identifierName":"a"}, "name": "a" }, "static": false, @@ -117,51 +38,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":22,"end":28,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":10}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 31, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":31,"end":47,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":17}}, "key": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "b" - }, + "start":38,"end":39,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9},"identifierName":"b"}, "name": "b" }, "static": true, @@ -170,51 +57,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 41, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 17 - } - } + "start":41,"end":47,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":17}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 50, - "end": 59, - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":50,"end":59,"loc":{"start":{"line":4,"column":1},"end":{"line":4,"column":10}}, "key": { "type": "Identifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 4, - "column": 2 - }, - "identifierName": "c" - }, + "start":50,"end":51,"loc":{"start":{"line":4,"column":1},"end":{"line":4,"column":2},"identifierName":"c"}, "name": "c" }, "static": false, @@ -223,18 +76,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 53, - "end": 59, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 10 - } - } + "start":53,"end":59,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":10}} }, "variance": null, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/18/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/18/output.json index ff402b5db4..faab69fb62 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/18/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/18/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "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}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,65 +21,21 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":16,"end":38,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":38}}, "callProperties": [ { "type": "ObjectTypeCallProperty", - "start": 18, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":18,"end":36,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":36}}, "static": true, "value": { "type": "FunctionTypeAnnotation", - "start": 25, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":25,"end":36,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":36}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - } + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}} } } } @@ -137,33 +48,10 @@ }, { "type": "DeclareClass", - "start": 39, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":39,"end":70,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}}, "id": { "type": "Identifier", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "B" - }, + "start":53,"end":54,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"B"}, "name": "B" }, "typeParameters": null, @@ -172,65 +60,21 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 55, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":55,"end":70,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":31}}, "callProperties": [ { "type": "ObjectTypeCallProperty", - "start": 57, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":57,"end":68,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":29}}, "static": false, "value": { "type": "FunctionTypeAnnotation", - "start": 57, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":57,"end":68,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":29}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 62, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 29 - } - } + "start":62,"end":68,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":29}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/19/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/19/output.json index 1fa1e6b11b..d6c3eb01f2 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/19/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/19/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareVariable", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "string" - }, + "start":12,"end":23,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":23},"identifierName":"string"}, "name": "string", "typeAnnotation": { "type": "TypeAnnotation", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "AnyTypeAnnotation", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/2/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/2/output.json index 16b1f7cb34..184ed4f2ab 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/2/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareVariable", - "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}}, "id": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "foo" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"foo"}, "name": "foo" } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/3/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/3/output.json index 83415ca915..64089206d0 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/3/output.json @@ -1,109 +1,31 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareFunction", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 17, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "foo" - }, + "start":17,"end":28,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":28},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TypeAnnotation", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "typeParameters": null, "params": [], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":24,"end":28,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":28}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/4/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/4/output.json index 5770e311a0..f377b44c81 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/4/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareFunction", - "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}}, "id": { "type": "Identifier", - "start": 17, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "foo" - }, + "start":17,"end":28,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":28},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TypeAnnotation", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "typeParameters": null, "params": [], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":24,"end":28,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":28}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/5/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/5/output.json index 812bc21835..033bfd0bfc 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/5/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/5/output.json @@ -1,121 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareFunction", - "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}}, "id": { "type": "Identifier", - "start": 17, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "foo" - }, + "start":17,"end":31,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":31},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TypeAnnotation", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23}}, "params": [ { "type": "TypeParameter", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}}, "name": "T", "variance": null } @@ -125,18 +36,7 @@ "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/6/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/6/output.json index b0f9b7b494..7a8d401120 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/6/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/6/output.json @@ -1,206 +1,60 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareFunction", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 17, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "foo" - }, + "start":17,"end":48,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":48},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TypeAnnotation", - "start": 20, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":20,"end":48,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":48}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 20, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":20,"end":48,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":48}}, "typeParameters": null, "params": [ { "type": "FunctionTypeParam", - "start": 21, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":21,"end":30,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":30}}, "name": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"x"}, "name": "x" }, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}} } }, { "type": "FunctionTypeParam", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":32,"end":41,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":41}}, "name": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "y" - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"y"}, "name": "y" }, "optional": false, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - } - } + "start":35,"end":41,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":41}} } } ], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 44, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 48 - } - } + "start":44,"end":48,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":48}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/7/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/7/output.json index 6ad6e00493..e5ae7dd2d3 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/7/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/7/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 74 - } - }, + "start":0,"end":74,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":74}}, "program": { "type": "Program", - "start": 0, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 74 - } - }, + "start":0,"end":74,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":74}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 74 - } - }, + "start":0,"end":74,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":74}}, "id": { "type": "Identifier", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "IViewFactory" - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26},"identifierName":"IViewFactory"}, "name": "IViewFactory" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 27, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 74 - } - }, + "start":27,"end":74,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":74}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 29, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 71 - } - }, + "start":29,"end":71,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":71}}, "key": { "type": "Identifier", - "start": 29, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "didAnimate" - }, + "start":29,"end":39,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":39},"identifierName":"didAnimate"}, "name": "didAnimate" }, "static": false, @@ -117,131 +38,40 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 29, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 71 - } - }, + "start":29,"end":71,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":71}}, "params": [ { "type": "FunctionTypeParam", - "start": 40, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":40,"end":51,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":51}}, "name": { "type": "Identifier", - "start": 40, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "view" - }, + "start":40,"end":44,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":44},"identifierName":"view"}, "name": "view" }, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 45, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":45,"end":51,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":51}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 45, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "Object" - }, + "start":45,"end":51,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":51},"identifierName":"Object"}, "name": "Object" } } }, { "type": "FunctionTypeParam", - "start": 53, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":53,"end":64,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":64}}, "name": { "type": "Identifier", - "start": 53, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 57 - }, - "identifierName": "prop" - }, + "start":53,"end":57,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":57},"identifierName":"prop"}, "name": "prop" }, "optional": false, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 58, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 58 - }, - "end": { - "line": 1, - "column": 64 - } - } + "start":58,"end":64,"loc":{"start":{"line":1,"column":58},"end":{"line":1,"column":64}} } } ], @@ -249,18 +79,7 @@ "typeParameters": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 67, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 67 - }, - "end": { - "line": 1, - "column": 71 - } - } + "start":67,"end":71,"loc":{"start":{"line":1,"column":67},"end":{"line":1,"column":71}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/8/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/8/output.json index 2c952054da..0f97774031 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/8/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/8/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,18 +21,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/9/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/9/output.json index 0191d716d9..450867f07e 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/9/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/9/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "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}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "params": [ { "type": "TypeParameter", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "name": "T", "variance": null } @@ -97,80 +30,23 @@ "extends": [ { "type": "InterfaceExtends", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "B" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"B"}, "name": "B" }, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":28,"end":31,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":31}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "T" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"T"}, "name": "T" } } @@ -182,49 +58,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 32, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":32,"end":45,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":45}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 34, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":34,"end":43,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":43}}, "key": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"x"}, "name": "x" }, "static": false, @@ -233,18 +75,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - } + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43}} }, "variance": null, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/declare-statements/symbol/output.json b/packages/babel-parser/test/fixtures/flow/declare-statements/symbol/output.json index 15a3bbe3f5..7ce565e0d0 100644 --- a/packages/babel-parser/test/fixtures/flow/declare-statements/symbol/output.json +++ b/packages/babel-parser/test/fixtures/flow/declare-statements/symbol/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareVariable", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 12, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "x" - }, + "start":12,"end":21,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":21},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "SymbolTypeAnnotation", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/def-site-variance/1/output.json b/packages/babel-parser/test/fixtures/flow/def-site-variance/1/output.json index 938196ebcd..54c76604b5 100644 --- a/packages/babel-parser/test/fixtures/flow/def-site-variance/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/def-site-variance/1/output.json @@ -1,141 +1,41 @@ { "type": "File", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "typeParameters": { "type": "TypeParameterDeclaration", - "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}}, "params": [ { "type": "TypeParameter", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "name": "T", "variance": { "type": "Variance", - "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}}, "kind": "plus" } }, { "type": "TypeParameter", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "name": "U", "variance": { "type": "Variance", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "kind": "minus" } } @@ -144,130 +44,41 @@ "superClass": null, "body": { "type": "ClassBody", - "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}}, "body": [] } }, { "type": "FunctionDeclaration", - "start": 18, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":18,"end":40,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "f" - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, "async": false, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":28,"end":35,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":17}}, "params": [ { "type": "TypeParameter", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "name": "T", "variance": { "type": "Variance", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":29,"end":30,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12}}, "kind": "plus" } }, { "type": "TypeParameter", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":32,"end":34,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "name": "U", "variance": { "type": "Variance", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":32,"end":33,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "kind": "minus" } } @@ -276,129 +87,40 @@ "params": [], "body": { "type": "BlockStatement", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":38,"end":40,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":22}}, "body": [], "directives": [] } }, { "type": "TypeAlias", - "start": 41, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":41,"end":59,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":18}}, "id": { "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "T" - }, + "start":46,"end":47,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 47, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":47,"end":54,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":13}}, "params": [ { "type": "TypeParameter", - "start": 48, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":48,"end":50,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":9}}, "name": "T", "variance": { "type": "Variance", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":48,"end":49,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, "kind": "plus" } }, { "type": "TypeParameter", - "start": 51, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":51,"end":53,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":12}}, "name": "U", "variance": { "type": "Variance", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":51,"end":52,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11}}, "kind": "minus" } } @@ -406,18 +128,7 @@ }, "right": { "type": "ObjectTypeAnnotation", - "start": 57, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":57,"end":59,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":18}}, "callProperties": [], "properties": [], "indexers": [], 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 b3c3ca8679..02b9962885 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 @@ -1,174 +1,50 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumBooleanBody", - "start": 7, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":7,"end":46,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, "explicitType": true, "members": [ { "type": "EnumBooleanMember", - "start": 22, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":22,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10}}, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "A" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"A"}, "name": "A" }, "init": { "type": "BooleanLiteral", - "start": 26, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":26,"end":30,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":10}}, "value": true } }, { "type": "EnumBooleanMember", - "start": 34, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":34,"end":43,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "B" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"B"}, "name": "B" }, "init": { "type": "BooleanLiteral", - "start": 38, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":38,"end":43,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":11}}, "value": 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 13f9c5e69b..1cde4241aa 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 @@ -1,174 +1,50 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumBooleanBody", - "start": 7, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":7,"end":35,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, "explicitType": false, "members": [ { "type": "EnumBooleanMember", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":11,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "A" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"A"}, "name": "A" }, "init": { "type": "BooleanLiteral", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":15,"end":19,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":10}}, "value": true } }, { "type": "EnumBooleanMember", - "start": 23, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":23,"end":32,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "B" - }, + "start":23,"end":24,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"B"}, "name": "B" }, "init": { "type": "BooleanLiteral", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":27,"end":32,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":11}}, "value": false } } 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 20ba8ebd29..9cd2d5701c 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 @@ -1,82 +1,26 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Boolean enum members need to be initialized. Use either `A = true,` or `A = false,` in enum `E`. (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumBooleanBody", - "start": 7, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":7,"end":26,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, "explicitType": true, "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 689d03caa3..ef24cd6ca0 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 @@ -1,129 +1,39 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Boolean enum members need to be initialized. Use either `A = true,` or `A = false,` in enum `E`. (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumBooleanBody", - "start": 7, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":7,"end":27,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, "explicitType": false, "members": [ { "type": "EnumBooleanMember", - "start": 16, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":16,"end":24,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":10}}, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"B"}, "name": "B" }, "init": { "type": "BooleanLiteral", - "start": 20, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":20,"end":24,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":10}}, "value": true } } 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 0d9e8720f8..5ebbed1e95 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 @@ -1,145 +1,43 @@ { "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Enum member names need to be unique, but the name `A` has already been used before in enum `E`. (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumStringBody", - "start": 7, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":7,"end":20,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, "explicitType": false, "members": [ { "type": "EnumDefaultedMember", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "A" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"A"}, "name": "A" } }, { "type": "EnumDefaultedMember", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":16,"end":17,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3}}, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "A" - }, + "start":16,"end":17,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"A"}, "name": "A" } } 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 c01edfa2f3..df6b983d91 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 @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumStringBody", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "explicitType": 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 00a5c58dd9..758f952645 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 @@ -1,79 +1,23 @@ { "type": "File", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "type" - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9},"identifierName":"type"}, "name": "type" }, "body": { "type": "EnumStringBody", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":2,"column":1}}, "explicitType": 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 a62f9a9beb..f5ddd9661e 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 @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "exportKind": "value", "declaration": { "type": "EnumDeclaration", - "start": 7, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":7,"end":16,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "A" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"A"}, "name": "A" }, "body": { "type": "EnumStringBody", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "explicitType": false, "members": [] } @@ -98,63 +31,18 @@ }, { "type": "ExportDefaultDeclaration", - "start": 18, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":18,"end":42,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":24}}, "declaration": { "type": "EnumDeclaration", - "start": 33, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":33,"end":42,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":24}}, "id": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 21 - }, - "identifierName": "B" - }, + "start":38,"end":39,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":21},"identifierName":"B"}, "name": "B" }, "body": { "type": "EnumStringBody", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":40,"end":42,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":24}}, "explicitType": 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 e572b98f4d..e63c726b3b 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 @@ -1,82 +1,26 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: Enum `E` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers. (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumStringBody", - "start": 7, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":7,"end":29,"loc":{"start":{"line":1,"column":7},"end":{"line":5,"column":1}}, "explicitType": 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 fc89707351..8f536f7019 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 @@ -1,82 +1,26 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Enum `E` has inconsistent member initializers. Either use no initializers, or consistently use literals (either booleans, numbers, or strings) for all member initializers. (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumStringBody", - "start": 7, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":7,"end":31,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, "explicitType": 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 c8665a0f24..bdd2f9ac8f 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 @@ -1,82 +1,26 @@ { "type": "File", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "errors": [ "SyntaxError: Enum type `xxx` is not valid. Use one of `boolean`, `number`, `string`, or `symbol` in enum `E`. (1:14)" ], "program": { "type": "Program", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumStringBody", - "start": 7, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":7,"end":17,"loc":{"start":{"line":1,"column":7},"end":{"line":2,"column":1}}, "explicitType": 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 8ee139f5c4..0c9f36244f 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 @@ -1,82 +1,26 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Enum `E` has type `string`, so the initializer of `A` needs to be a string literal. (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumStringBody", - "start": 7, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":7,"end":32,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, "explicitType": true, "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 8c2e7e69ab..cc53bdf917 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 @@ -1,82 +1,26 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Symbol enum members cannot be initialized. Use `A,` in enum `E`. (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumSymbolBody", - "start": 7, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":7,"end":29,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, "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 ac17cf909b..2e86e933c0 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 @@ -1,82 +1,26 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Enum `E` has type `boolean`, so the initializer of `A` needs to be a boolean literal. (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumBooleanBody", - "start": 7, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":7,"end":30,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, "explicitType": true, "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 5dbb244787..2d654faa00 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 @@ -1,82 +1,26 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Enum `E` has type `string`, so the initializer of `A` needs to be a string literal. (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumStringBody", - "start": 7, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":7,"end":29,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, "explicitType": true, "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 73b86a84e3..0d7f98f68e 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 @@ -1,82 +1,26 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Enum `E` has type `boolean`, so the initializer of `A` needs to be a boolean literal. (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumBooleanBody", - "start": 7, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":7,"end":33,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, "explicitType": true, "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 15e121566e..b55c6b5b9d 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 @@ -1,82 +1,26 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Enum `E` has type `number`, so the initializer of `A` needs to be a number literal. (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumNumberBody", - "start": 7, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":7,"end":32,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, "explicitType": true, "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 9c80943ab3..9fe35c2208 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 @@ -1,146 +1,44 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `foo`, consider using `Foo`, in enum `E`. (2:2)", "SyntaxError: Enum member names cannot start with lowercase 'a' through 'z'. Instead of using `bar`, consider using `Bar`, in enum `E`. (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumStringBody", - "start": 7, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, "explicitType": false, "members": [ { "type": "EnumDefaultedMember", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":11,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5}}, "id": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "foo" - }, + "start":11,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"foo"}, "name": "foo" } }, { "type": "EnumDefaultedMember", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":18,"end":21,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5}}, "id": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "bar" - }, + "start":18,"end":21,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5},"identifierName":"bar"}, "name": "bar" } } 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 fd6f4450b1..2d409165d9 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 @@ -1,110 +1,31 @@ { "type": "File", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumStringBody", - "start": 7, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, "explicitType": false, "members": [ { "type": "EnumDefaultedMember", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "A" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"A"}, "name": "A" } } 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 e03f6e9712..7422817d74 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 @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumNumberBody", - "start": 7, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":7,"end":38,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, "explicitType": true, "members": [ { "type": "EnumNumberMember", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":21,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "A" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"A"}, "name": "A" }, "init": { "type": "NumericLiteral", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -130,49 +40,15 @@ }, { "type": "EnumNumberMember", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":30,"end":35,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":7}}, "id": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "B" - }, + "start":30,"end":31,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"B"}, "name": "B" }, "init": { "type": "NumericLiteral", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7}}, "extra": { "rawValue": 2, "raw": "2" 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 9a2f18345c..56cc5c9ace 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 @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumNumberBody", - "start": 7, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":7,"end":28,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, "explicitType": false, "members": [ { "type": "EnumNumberMember", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":11,"end":16,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "A" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"A"}, "name": "A" }, "init": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -130,49 +40,15 @@ }, { "type": "EnumNumberMember", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":20,"end":25,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":7}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "B" - }, + "start":20,"end":21,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"B"}, "name": "B" }, "init": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":24,"end":25,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7}}, "extra": { "rawValue": 2, "raw": "2" 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 399366269e..da174b55f3 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 @@ -1,82 +1,26 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Number enum members need to be initialized, e.g. `A = 1` in enum `E`. (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumNumberBody", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, "explicitType": true, "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 f2277d9ffc..baf3a7cb99 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 @@ -1,129 +1,39 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Number enum members need to be initialized, e.g. `A = 1` in enum `E`. (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumNumberBody", - "start": 7, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, "explicitType": false, "members": [ { "type": "EnumNumberMember", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":16,"end":21,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":7}}, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"B"}, "name": "B" }, "init": { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":20,"end":21,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json index 57e3c5d82d..2eb913529f 100644 --- a/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json +++ b/packages/babel-parser/test/fixtures/flow/enum-declaration/reserved-word-enum-name/output.json @@ -1,82 +1,26 @@ { "type": "File", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "errors": [ "SyntaxError: Unexpected keyword 'class' (1:5)" ], "program": { "type": "Program", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "class" - }, + "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10},"identifierName":"class"}, "name": "class" }, "body": { "type": "EnumStringBody", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":2,"column":1}}, "explicitType": false, "members": [] } 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 4efdf8e460..00c64b6bad 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 @@ -1,142 +1,40 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumStringBody", - "start": 7, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":7,"end":30,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, "explicitType": true, "members": [ { "type": "EnumDefaultedMember", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "A" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"A"}, "name": "A" } }, { "type": "EnumDefaultedMember", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":26,"end":27,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3}}, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "B" - }, + "start":26,"end":27,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"B"}, "name": "B" } } 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 2e9c91c109..b2d881c84b 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 @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumStringBody", - "start": 7, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":7,"end":42,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, "explicitType": true, "members": [ { "type": "EnumStringMember", - "start": 21, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":21,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "A" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"A"}, "name": "A" }, "init": { "type": "StringLiteral", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":25,"end":28,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9}}, "extra": { "rawValue": "a", "raw": "\"a\"" @@ -130,49 +40,15 @@ }, { "type": "EnumStringMember", - "start": 32, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":32,"end":39,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "id": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "B" - }, + "start":32,"end":33,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"B"}, "name": "B" }, "init": { "type": "StringLiteral", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":36,"end":39,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9}}, "extra": { "rawValue": "b", "raw": "\"b\"" 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 28842c5fd4..ca27f1e722 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 @@ -1,142 +1,40 @@ { "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumStringBody", - "start": 7, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":7,"end":20,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, "explicitType": false, "members": [ { "type": "EnumDefaultedMember", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "A" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"A"}, "name": "A" } }, { "type": "EnumDefaultedMember", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":16,"end":17,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3}}, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"B"}, "name": "B" } } 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 1680f3f2cc..d6f642c684 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 @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumStringBody", - "start": 7, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":7,"end":32,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, "explicitType": false, "members": [ { "type": "EnumStringMember", - "start": 11, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":11,"end":18,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "A" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"A"}, "name": "A" }, "init": { "type": "StringLiteral", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9}}, "extra": { "rawValue": "a", "raw": "\"a\"" @@ -130,49 +40,15 @@ }, { "type": "EnumStringMember", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":22,"end":29,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "B" - }, + "start":22,"end":23,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"B"}, "name": "B" }, "init": { "type": "StringLiteral", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":26,"end":29,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9}}, "extra": { "rawValue": "b", "raw": "\"b\"" 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 b5a5dc4951..b2f08dfac8 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 @@ -1,145 +1,43 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: String enum members need to consistently either all use initializers, or use no initializers, in enum `E`. (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumStringBody", - "start": 7, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":7,"end":41,"loc":{"start":{"line":1,"column":7},"end":{"line":5,"column":1}}, "explicitType": true, "members": [ { "type": "EnumDefaultedMember", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":32,"end":33,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3}}, "id": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "B" - }, + "start":32,"end":33,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"B"}, "name": "B" } }, { "type": "EnumDefaultedMember", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":37,"end":38,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":3}}, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - }, - "identifierName": "C" - }, + "start":37,"end":38,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":3},"identifierName":"C"}, "name": "C" } } 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 19e00f8d51..01371ce1c5 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 @@ -1,129 +1,39 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: String enum members need to consistently either all use initializers, or use no initializers, in enum `E`. (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumStringBody", - "start": 7, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":7,"end":47,"loc":{"start":{"line":1,"column":7},"end":{"line":5,"column":1}}, "explicitType": true, "members": [ { "type": "EnumStringMember", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":26,"end":33,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "B" - }, + "start":26,"end":27,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"B"}, "name": "B" }, "init": { "type": "StringLiteral", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":30,"end":33,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9}}, "extra": { "rawValue": "b", "raw": "\"b\"" @@ -133,49 +43,15 @@ }, { "type": "EnumStringMember", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":37,"end":44,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":9}}, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - }, - "identifierName": "C" - }, + "start":37,"end":38,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":3},"identifierName":"C"}, "name": "C" }, "init": { "type": "StringLiteral", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":41,"end":44,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":9}}, "extra": { "rawValue": "c", "raw": "\"c\"" 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 b93b653940..4497d3a6d3 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 @@ -1,141 +1,39 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "EnumDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "body": { "type": "EnumSymbolBody", - "start": 7, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":7,"end":30,"loc":{"start":{"line":1,"column":7},"end":{"line":4,"column":1}}, "members": [ { "type": "EnumDefaultedMember", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "A" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"A"}, "name": "A" } }, { "type": "EnumDefaultedMember", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":26,"end":27,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3}}, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "B" - }, + "start":26,"end":27,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"B"}, "name": "B" } } 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 f896b9fffb..79791869df 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "errors": [ "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 8, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "A" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -69,18 +24,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 24, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":24,"end":34,"loc":{"start":{"line":2,"column":16},"end":{"line":4,"column":1}}, "callProperties": [], "properties": [], "indexers": [], @@ -91,18 +35,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -113,18 +46,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file 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 6a0edc43c3..5f245815fb 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (4:2)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 8, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":8,"end":49,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "B" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"B"}, "name": "B" }, "typeParameters": null, @@ -69,49 +24,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 24, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":24,"end":49,"loc":{"start":{"line":2,"column":16},"end":{"line":5,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 28, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":28,"end":39,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, "key": { "type": "Identifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "foo" - }, + "start":28,"end":31,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -120,18 +41,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":33,"end":39,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":13}} }, "variance": null, "optional": false @@ -145,18 +55,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -167,18 +66,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file 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 7fa5b4a0b0..6933be9552 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 @@ -1,67 +1,22 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (3:2)", "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 8, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":8,"end":49,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "C" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"C"}, "name": "C" }, "typeParameters": null, @@ -70,49 +25,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 24, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":24,"end":49,"loc":{"start":{"line":2,"column":16},"end":{"line":5,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 35, - "end": 46, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":35,"end":46,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":13}}, "key": { "type": "Identifier", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "foo" - }, + "start":35,"end":38,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":5},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -121,18 +42,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 40, - "end": 46, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 13 - } - } + "start":40,"end":46,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":13}} }, "variance": null, "optional": false @@ -146,18 +56,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -168,18 +67,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file 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 224a056643..6c4b0246e4 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 @@ -1,67 +1,22 @@ { "type": "File", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (4:2)", "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (4:2)" ], "program": { "type": "Program", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 8, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":8,"end":64,"loc":{"start":{"line":2,"column":0},"end":{"line":6,"column":1}}, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "D" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"D"}, "name": "D" }, "typeParameters": null, @@ -70,49 +25,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 24, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":24,"end":64,"loc":{"start":{"line":2,"column":16},"end":{"line":6,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 28, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":28,"end":39,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, "key": { "type": "Identifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "foo" - }, + "start":28,"end":31,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -121,51 +42,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":33,"end":39,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":13}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 50, - "end": 61, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":50,"end":61,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":13}}, "key": { "type": "Identifier", - "start": 50, - "end": 53, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 5 - }, - "identifierName": "bar" - }, + "start":50,"end":53,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":5},"identifierName":"bar"}, "name": "bar" }, "static": false, @@ -174,18 +61,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 55, - "end": 61, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 13 - } - } + "start":55,"end":61,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":13}} }, "variance": null, "optional": false @@ -199,18 +75,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -221,18 +86,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file 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 0f4fe47c8e..6cbdf063a8 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 @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (4:2)" ], "program": { "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 8, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":8,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "F" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"F"}, "name": "F" }, "typeParameters": null, @@ -69,49 +24,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 20, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":20,"end":45,"loc":{"start":{"line":2,"column":12},"end":{"line":5,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":24,"end":35,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, "key": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "foo" - }, + "start":24,"end":27,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -120,18 +41,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":29,"end":35,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":13}} }, "variance": null, "optional": false @@ -145,18 +55,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -167,18 +66,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file 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 685bd5b4d1..ef17a8522e 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 @@ -1,67 +1,22 @@ { "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "errors": [ "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (3:2)", "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (3:2)" ], "program": { "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 8, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":8,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "G" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"G"}, "name": "G" }, "typeParameters": null, @@ -70,49 +25,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 20, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":20,"end":45,"loc":{"start":{"line":2,"column":12},"end":{"line":5,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 31, - "end": 42, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":31,"end":42,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":13}}, "key": { "type": "Identifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "foo" - }, + "start":31,"end":34,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":5},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -121,18 +42,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 13 - } - } + "start":36,"end":42,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":13}} }, "variance": null, "optional": false @@ -146,18 +56,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -168,18 +67,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file 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 37b8534943..c8b0234032 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 @@ -1,67 +1,22 @@ { "type": "File", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "errors": [ "SyntaxError: Explicit inexact syntax cannot appear in class or interface definitions (4:2)", "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (4:2)" ], "program": { "type": "Program", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 8, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":8,"end":60,"loc":{"start":{"line":2,"column":0},"end":{"line":6,"column":1}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "H" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"H"}, "name": "H" }, "typeParameters": null, @@ -70,49 +25,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 20, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":20,"end":60,"loc":{"start":{"line":2,"column":12},"end":{"line":6,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":24,"end":35,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13}}, "key": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "foo" - }, + "start":24,"end":27,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":5},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -121,51 +42,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":29,"end":35,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":13}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 46, - "end": 57, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":46,"end":57,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":13}}, "key": { "type": "Identifier", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 5 - }, - "identifierName": "bar" - }, + "start":46,"end":49,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":5},"identifierName":"bar"}, "name": "bar" }, "static": false, @@ -174,18 +61,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 51, - "end": 57, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 13 - } - } + "start":51,"end":57,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":13}} }, "variance": null, "optional": false @@ -199,18 +75,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -221,18 +86,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file 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 98ff5ceeea..94a0689470 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 @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":31}}, "errors": [ "SyntaxError: Explicit inexact syntax cannot appear inside an explicit exact object type (2:25)" ], "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 8, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":8,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 17, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":17,"end":39,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":31}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":20,"end":31,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":23}}, "key": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -117,18 +38,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 23 - } - } + "start":25,"end":31,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":23}} }, "variance": null, "optional": false @@ -143,18 +53,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -165,18 +64,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file 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 24b9575138..36abf35d45 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 @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":28}}, "errors": [ "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (2:10)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 8, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":8,"end":36,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 17, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":17,"end":35,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":27}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 23, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":23,"end":34,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":26}}, "key": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "foo" - }, + "start":23,"end":26,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -117,18 +38,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 26 - } - } + "start":28,"end":34,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":26}} }, "variance": null, "optional": false @@ -143,18 +53,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -165,18 +64,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object/output.json index 7e32ace815..79a5402f0a 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object/output.json @@ -1,80 +1,24 @@ { "type": "File", - "start": 0, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 33 - } - }, + "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 33 - } - }, + "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 8, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":8,"end":23,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":17,"end":22,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":14}}, "callProperties": [], "properties": [], "indexers": [], @@ -86,98 +30,30 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] }, { "type": "TypeAlias", - "start": 24, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 26 - } - }, + "start":24,"end":50,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":26}}, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "U" - }, + "start":29,"end":30,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":6},"identifierName":"U"}, "name": "U" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 33, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":33,"end":49,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":25}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 34, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":34,"end":43,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":19}}, "key": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"x"}, "name": "x" }, "static": false, @@ -186,18 +62,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 19 - } - } + "start":37,"end":43,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":19}} }, "variance": null, "optional": false @@ -211,81 +76,24 @@ }, { "type": "TypeAlias", - "start": 51, - "end": 84, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 33 - } - }, + "start":51,"end":84,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":33}}, "id": { "type": "Identifier", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 6 - }, - "identifierName": "V" - }, + "start":56,"end":57,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":6},"identifierName":"V"}, "name": "V" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 60, - "end": 83, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 32 - } - }, + "start":60,"end":83,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":32}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 61, - "end": 70, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 19 - } - }, + "start":61,"end":70,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":19}}, "key": { "type": "Identifier", - "start": 61, - "end": 62, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 11 - }, - "identifierName": "x" - }, + "start":61,"end":62,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":11},"identifierName":"x"}, "name": "x" }, "static": false, @@ -294,114 +102,35 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 64, - "end": 70, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 19 - } - } + "start":64,"end":70,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":19}} }, "variance": null, "optional": false }, { "type": "ObjectTypeSpreadProperty", - "start": 72, - "end": 76, - "loc": { - "start": { - "line": 4, - "column": 21 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":72,"end":76,"loc":{"start":{"line":4,"column":21},"end":{"line":4,"column":25}}, "argument": { "type": "GenericTypeAnnotation", - "start": 75, - "end": 76, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":75,"end":76,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":25}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 75, - "end": 76, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 25 - }, - "identifierName": "V" - }, + "start":75,"end":76,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":25},"identifierName":"V"}, "name": "V" } } }, { "type": "ObjectTypeSpreadProperty", - "start": 78, - "end": 82, - "loc": { - "start": { - "line": 4, - "column": 27 - }, - "end": { - "line": 4, - "column": 31 - } - }, + "start":78,"end":82,"loc":{"start":{"line":4,"column":27},"end":{"line":4,"column":31}}, "argument": { "type": "GenericTypeAnnotation", - "start": 81, - "end": 82, - "loc": { - "start": { - "line": 4, - "column": 30 - }, - "end": { - "line": 4, - "column": 31 - } - }, + "start":81,"end":82,"loc":{"start":{"line":4,"column":30},"end":{"line":4,"column":31}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 81, - "end": 82, - "loc": { - "start": { - "line": 4, - "column": 30 - }, - "end": { - "line": 4, - "column": 31 - }, - "identifierName": "U" - }, + "start":81,"end":82,"loc":{"start":{"line":4,"column":30},"end":{"line":4,"column":31},"identifierName":"U"}, "name": "U" } } @@ -420,18 +149,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file 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 8efbd4b84f..16a8edbd4b 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 @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":37}}, "errors": [ "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (2:21)" ], "program": { "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":37}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 8, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":8,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":37}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 17, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":17,"end":44,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":36}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":18,"end":27,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":19}}, "key": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" }, "static": false, @@ -117,51 +38,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 19 - } - } + "start":21,"end":27,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":19}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 34, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":34,"end":43,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":35}}, "key": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "y" - }, + "start":34,"end":35,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":27},"identifierName":"y"}, "name": "y" }, "static": false, @@ -170,18 +57,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 35 - } - } + "start":37,"end":43,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":35}} }, "variance": null, "optional": false @@ -196,18 +72,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -218,18 +83,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file 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 fe5b3ee400..ff2e24bc5d 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 @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":31}}, "errors": [ "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (2:21)" ], "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 8, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":8,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "U" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"U"}, "name": "U" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 17, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":17,"end":38,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":30}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":18,"end":27,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":19}}, "key": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" }, "static": false, @@ -117,18 +38,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 19 - } - } + "start":21,"end":27,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":19}} }, "variance": null, "optional": false @@ -143,18 +53,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -165,18 +64,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file 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 0bedbf8f82..40f82000ed 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 @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":32}}, "errors": [ "SyntaxError: Explicit inexact syntax must appear at the end of an inexact object (2:21)" ], "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":32}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 8, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":8,"end":40,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":32}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "V" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"V"}, "name": "V" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 17, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":17,"end":39,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":31}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":18,"end":27,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":19}}, "key": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" }, "static": false, @@ -117,66 +38,21 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 19 - } - } + "start":21,"end":27,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":19}} }, "variance": null, "optional": false }, { "type": "ObjectTypeSpreadProperty", - "start": 34, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":34,"end":38,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":30}}, "argument": { "type": "GenericTypeAnnotation", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":37,"end":38,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":30}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 30 - }, - "identifierName": "X" - }, + "start":37,"end":38,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":30},"identifierName":"X"}, "name": "X" } } @@ -191,18 +67,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -213,18 +78,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_trailing_comma/output.json b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_trailing_comma/output.json index 3c39bdc107..8e6299b639 100644 --- a/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_trailing_comma/output.json +++ b/packages/babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_trailing_comma/output.json @@ -1,80 +1,24 @@ { "type": "File", - "start": 0, - "end": 113, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 2 - } - }, + "start":0,"end":113,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 113, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 2 - } - }, + "start":0,"end":113,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 8, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":8,"end":26,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 17, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":17,"end":25,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":17}}, "callProperties": [], "properties": [], "indexers": [], @@ -86,67 +30,22 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] }, { "type": "TypeAlias", - "start": 27, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":27,"end":45,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":18}}, "id": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "U" - }, + "start":32,"end":33,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":6},"identifierName":"U"}, "name": "U" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 36, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":36,"end":44,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":17}}, "callProperties": [], "properties": [], "indexers": [], @@ -157,81 +56,24 @@ }, { "type": "TypeAlias", - "start": 46, - "end": 79, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 7, - "column": 2 - } - }, + "start":46,"end":79,"loc":{"start":{"line":4,"column":0},"end":{"line":7,"column":2}}, "id": { "type": "Identifier", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 6 - }, - "identifierName": "V" - }, + "start":51,"end":52,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":6},"identifierName":"V"}, "name": "V" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 55, - "end": 78, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":55,"end":78,"loc":{"start":{"line":4,"column":9},"end":{"line":7,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 59, - "end": 68, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":59,"end":68,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":11}}, "key": { "type": "Identifier", - "start": 59, - "end": 60, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - }, - "identifierName": "x" - }, + "start":59,"end":60,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":3},"identifierName":"x"}, "name": "x" }, "static": false, @@ -240,18 +82,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 62, - "end": 68, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 11 - } - } + "start":62,"end":68,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":11}} }, "variance": null, "optional": false @@ -265,81 +96,24 @@ }, { "type": "TypeAlias", - "start": 80, - "end": 113, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 11, - "column": 2 - } - }, + "start":80,"end":113,"loc":{"start":{"line":8,"column":0},"end":{"line":11,"column":2}}, "id": { "type": "Identifier", - "start": 85, - "end": 86, - "loc": { - "start": { - "line": 8, - "column": 5 - }, - "end": { - "line": 8, - "column": 6 - }, - "identifierName": "W" - }, + "start":85,"end":86,"loc":{"start":{"line":8,"column":5},"end":{"line":8,"column":6},"identifierName":"W"}, "name": "W" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 89, - "end": 112, - "loc": { - "start": { - "line": 8, - "column": 9 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":89,"end":112,"loc":{"start":{"line":8,"column":9},"end":{"line":11,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 93, - "end": 102, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 11 - } - }, + "start":93,"end":102,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":11}}, "key": { "type": "Identifier", - "start": 93, - "end": 94, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 3 - }, - "identifierName": "x" - }, + "start":93,"end":94,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":3},"identifierName":"x"}, "name": "x" }, "static": false, @@ -348,18 +122,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 96, - "end": 102, - "loc": { - "start": { - "line": 9, - "column": 5 - }, - "end": { - "line": 9, - "column": 11 - } - } + "start":96,"end":102,"loc":{"start":{"line":9,"column":5},"end":{"line":9,"column":11}} }, "variance": null, "optional": false @@ -378,18 +141,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/basic/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/basic/output.json index 9e75058274..2d4ff81db4 100644 --- a/packages/babel-parser/test/fixtures/flow/interface-types/basic/output.json +++ b/packages/babel-parser/test/fixtures/flow/interface-types/basic/output.json @@ -1,126 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "T" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": null, "right": { "type": "InterfaceTypeAnnotation", - "start": 9, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":9,"end":32,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":32}}, "extends": [], "body": { "type": "ObjectTypeAnnotation", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 21, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":21,"end":30,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":30}}, "key": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "p" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"p"}, "name": "p" }, "static": false, @@ -129,18 +39,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}} }, "variance": null, "optional": false 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 70c296fe6e..ab97f0f061 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 @@ -1,132 +1,41 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":30}}, "errors": [ "SyntaxError: Unexpected reserved type bool (2:23)" ], "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 9, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":9,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "I" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, "name": "I" }, "typeParameters": null, "extends": [ { "type": "InterfaceExtends", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":29,"end":30,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":21}}, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 21 - }, - "identifierName": "X" - }, + "start":29,"end":30,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":21},"identifierName":"X"}, "name": "X" }, "typeParameters": null }, { "type": "InterfaceExtends", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":32,"end":36,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":27}}, "id": { "type": "Identifier", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "bool" - }, + "start":32,"end":36,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":27},"identifierName":"bool"}, "name": "bool" }, "typeParameters": null @@ -136,18 +45,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":37,"end":39,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":30}}, "callProperties": [], "properties": [], "indexers": [], @@ -158,18 +56,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -180,18 +67,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file 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 40dc56861a..53fdc1eadb 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 @@ -1,163 +1,49 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":32}}, "errors": [ "SyntaxError: Unexpected reserved type bool (2:23)" ], "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":32}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 9, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":9,"end":41,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":32}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "I" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, "name": "I" }, "typeParameters": null, "extends": [ { "type": "InterfaceExtends", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":29,"end":30,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":21}}, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 21 - }, - "identifierName": "X" - }, + "start":29,"end":30,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":21},"identifierName":"X"}, "name": "X" }, "typeParameters": null }, { "type": "InterfaceExtends", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":32,"end":38,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":29}}, "id": { "type": "QualifiedTypeIdentifier", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":32,"end":38,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":29}}, "qualification": { "type": "Identifier", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "bool" - }, + "start":32,"end":36,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":27},"identifierName":"bool"}, "name": "bool" }, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 29 - }, - "identifierName": "m" - }, + "start":37,"end":38,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":29},"identifierName":"m"}, "name": "m" } }, @@ -168,18 +54,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":39,"end":41,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":32}}, "callProperties": [], "properties": [], "indexers": [], @@ -190,18 +65,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -212,18 +76,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple/output.json index 8ca1c30e33..9202873a9e 100644 --- a/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple/output.json +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends-multiple/output.json @@ -1,143 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "T" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": null, "right": { "type": "InterfaceTypeAnnotation", - "start": 9, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":9,"end":45,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":45}}, "extends": [ { "type": "InterfaceExtends", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "X" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"X"}, "name": "X" }, "typeParameters": null }, { "type": "InterfaceExtends", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "Y" - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"Y"}, "name": "Y" }, "typeParameters": null @@ -145,49 +43,15 @@ ], "body": { "type": "ObjectTypeAnnotation", - "start": 32, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":32,"end":45,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":45}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 34, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":34,"end":43,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":43}}, "key": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "p" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"p"}, "name": "p" }, "static": false, @@ -196,18 +60,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - } + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43}} }, "variance": null, "optional": false 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 4506002f7e..a9b966d7db 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 @@ -1,99 +1,31 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "errors": [ "SyntaxError: Unexpected reserved type bool (2:20)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 9, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":9,"end":36,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "I" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, "name": "I" }, "typeParameters": null, "extends": [ { "type": "InterfaceExtends", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":29,"end":33,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":24}}, "id": { "type": "Identifier", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "bool" - }, + "start":29,"end":33,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":24},"identifierName":"bool"}, "name": "bool" }, "typeParameters": null @@ -103,18 +35,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":34,"end":36,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":27}}, "callProperties": [], "properties": [], "indexers": [], @@ -125,18 +46,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -147,18 +57,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file 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 159c921ca3..9c8eea94c7 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 @@ -1,130 +1,39 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":29}}, "errors": [ "SyntaxError: Unexpected reserved type bool (2:20)" ], "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":29}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 9, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":9,"end":38,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":29}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "I" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, "name": "I" }, "typeParameters": null, "extends": [ { "type": "InterfaceExtends", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":29,"end":35,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":26}}, "id": { "type": "QualifiedTypeIdentifier", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":29,"end":35,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":26}}, "qualification": { "type": "Identifier", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "bool" - }, + "start":29,"end":33,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":24},"identifierName":"bool"}, "name": "bool" }, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 26 - }, - "identifierName": "m" - }, + "start":34,"end":35,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":26},"identifierName":"m"}, "name": "m" } }, @@ -135,18 +44,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":36,"end":38,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":29}}, "callProperties": [], "properties": [], "indexers": [], @@ -157,18 +55,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -179,18 +66,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/extends/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/extends/output.json index 2d6da1e733..9447b24353 100644 --- a/packages/babel-parser/test/fixtures/flow/interface-types/extends/output.json +++ b/packages/babel-parser/test/fixtures/flow/interface-types/extends/output.json @@ -1,110 +1,31 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "T" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": null, "right": { "type": "InterfaceTypeAnnotation", - "start": 9, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":9,"end":42,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":42}}, "extends": [ { "type": "InterfaceExtends", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "X" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"X"}, "name": "X" }, "typeParameters": null @@ -112,49 +33,15 @@ ], "body": { "type": "ObjectTypeAnnotation", - "start": 29, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":29,"end":42,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":42}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 31, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":31,"end":40,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":40}}, "key": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "p" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"p"}, "name": "p" }, "static": false, @@ -163,18 +50,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 34, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 40 - } - } + "start":34,"end":40,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":40}} }, "variance": null, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/interface-types/identifier-named-static-method/output.json b/packages/babel-parser/test/fixtures/flow/interface-types/identifier-named-static-method/output.json index 73f418d338..db1accdec4 100644 --- a/packages/babel-parser/test/fixtures/flow/interface-types/identifier-named-static-method/output.json +++ b/packages/babel-parser/test/fixtures/flow/interface-types/identifier-named-static-method/output.json @@ -1,126 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "T" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": null, "right": { "type": "InterfaceTypeAnnotation", - "start": 9, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":9,"end":39,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":39}}, "extends": [], "body": { "type": "ObjectTypeAnnotation", - "start": 19, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":19,"end":39,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":39}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 21, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":21,"end":37,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":37}}, "key": { "type": "Identifier", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "static" - }, + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27},"identifierName":"static"}, "name": "static" }, "static": false, @@ -129,35 +39,13 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 21, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":21,"end":37,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":37}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":31,"end":37,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":37}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/1/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/1/output.json index cbfe467e67..7244ddd95f 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/1/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,18 +21,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "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}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/10/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/10/output.json index 32bec330e5..08a97862a7 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/10/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/10/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "IFoo" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"IFoo"}, "name": "IFoo" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 15, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":15,"end":51,"loc":{"start":{"line":1,"column":15},"end":{"line":4,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 19, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":19,"end":29,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "key": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "x" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"x"}, "name": "x" }, "static": false, @@ -117,51 +38,17 @@ "method": false, "value": { "type": "BooleanTypeAnnotation", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 12 - } - } + "start":22,"end":29,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":12}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 33, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":33,"end":48,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":17}}, "key": { "type": "Identifier", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "static" - }, + "start":33,"end":39,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8},"identifierName":"static"}, "name": "static" }, "static": false, @@ -170,35 +57,13 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 33, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":33,"end":48,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":17}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 44, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 17 - } - } + "start":44,"end":48,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":17}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/2/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/2/output.json index 5911bf1d90..ddf8f7342c 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/2/output.json @@ -1,96 +1,28 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "extends": [ { "type": "InterfaceExtends", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "B" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"B"}, "name": "B" }, "typeParameters": null @@ -100,18 +32,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "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}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/3/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/3/output.json index d10815eca7..99659e265c 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/3/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "params": [ { "type": "TypeParameter", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "name": "T", "variance": null } @@ -97,80 +30,23 @@ "extends": [ { "type": "InterfaceExtends", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "B" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"B"}, "name": "B" }, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "T" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"T"}, "name": "T" } } @@ -179,80 +55,23 @@ }, { "type": "InterfaceExtends", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":29,"end":33,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "C" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"C"}, "name": "C" }, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":30,"end":33,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":33}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "T" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"T"}, "name": "T" } } @@ -264,18 +83,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/4/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/4/output.json index 88174f7dee..a4261a11c1 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/4/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 12, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":12,"end":34,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":34}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 14, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":14,"end":31,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":31}}, "key": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -117,34 +38,12 @@ "method": false, "value": { "type": "FunctionTypeAnnotation", - "start": 19, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":19,"end":31,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":31}}, "params": [], "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":25,"end":31,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":31}} }, "typeParameters": null }, diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/5/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/5/output.json index 4235a52169..18afb96e0c 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/5/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/5/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":65}}, "program": { "type": "Program", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":65}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":65}}, "id": { "type": "Identifier", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "Dictionary" - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20},"identifierName":"Dictionary"}, "name": "Dictionary" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 21, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":21,"end":65,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":65}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 48, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":48,"end":62,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":62}}, "key": { "type": "Identifier", - "start": 48, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 54 - }, - "identifierName": "length" - }, + "start":48,"end":54,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":54},"identifierName":"length"}, "name": "length" }, "static": false, @@ -117,18 +38,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 56, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 56 - }, - "end": { - "line": 1, - "column": 62 - } - } + "start":56,"end":62,"loc":{"start":{"line":1,"column":56},"end":{"line":1,"column":62}} }, "variance": null, "optional": false @@ -137,65 +47,20 @@ "indexers": [ { "type": "ObjectTypeIndexer", - "start": 23, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":23,"end":46,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":46}}, "static": false, "id": { "type": "Identifier", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "index" - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29},"identifierName":"index"}, "name": "index" }, "key": { "type": "StringTypeAnnotation", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":31,"end":37,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":37}} }, "value": { "type": "StringTypeAnnotation", - "start": 40, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 46 - } - } + "start":40,"end":46,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":46}} }, "variance": null } diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/6/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/6/output.json index 26a8ee78e4..82bcfd3310 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/6/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/6/output.json @@ -1,96 +1,28 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": { "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" }, "superClass": null, "implements": [ { "type": "ClassImplements", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "Bar" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"Bar"}, "name": "Bar" }, "typeParameters": null @@ -98,18 +30,7 @@ ], "body": { "type": "ClassBody", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/7/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/7/output.json index 4b1d879b8e..87bc4f8cdc 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/7/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/7/output.json @@ -1,176 +1,51 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "Bar" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"Bar"}, "name": "Bar" }, "implements": [ { "type": "ClassImplements", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":33,"end":36,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "Bat" - }, + "start":33,"end":36,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":36},"identifierName":"Bat"}, "name": "Bat" }, "typeParameters": null }, { "type": "ClassImplements", - "start": 38, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":38,"end":49,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 38, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "Man" - }, + "start":38,"end":41,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":41},"identifierName":"Man"}, "name": "Man" }, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 41, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":41,"end":49,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":49}}, "params": [ { "type": "NumberTypeAnnotation", - "start": 42, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 48 - } - } + "start":42,"end":48,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":48}} } ] } @@ -178,18 +53,7 @@ ], "body": { "type": "ClassBody", - "start": 50, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":50,"end":52,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":52}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/8/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/8/output.json index 5d31c9ca0f..8d8283101c 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/8/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/8/output.json @@ -1,127 +1,36 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "id": { "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" }, "superClass": { "type": "ClassExpression", - "start": 18, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":18,"end":45,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":45}}, "id": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "Bar" - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27},"identifierName":"Bar"}, "name": "Bar" }, "superClass": null, "implements": [ { "type": "ClassImplements", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":39,"end":42,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":42}}, "id": { "type": "Identifier", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "Bat" - }, + "start":39,"end":42,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":42},"identifierName":"Bat"}, "name": "Bat" }, "typeParameters": null @@ -129,35 +38,13 @@ ], "body": { "type": "ClassBody", - "start": 43, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":43,"end":45,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":45}}, "body": [] } }, "body": { "type": "ClassBody", - "start": 46, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":46,"end":48,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":48}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/9/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/9/output.json index 12bb8f6bf3..38872f0d8d 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/9/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/9/output.json @@ -1,127 +1,36 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "id": { "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" }, "superClass": { "type": "ClassExpression", - "start": 18, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":18,"end":45,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":45}}, "id": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "Bar" - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27},"identifierName":"Bar"}, "name": "Bar" }, "superClass": null, "implements": [ { "type": "ClassImplements", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":39,"end":42,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":42}}, "id": { "type": "Identifier", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "Bat" - }, + "start":39,"end":42,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":42},"identifierName":"Bat"}, "name": "Bat" }, "typeParameters": null @@ -129,51 +38,17 @@ ], "body": { "type": "ClassBody", - "start": 43, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":43,"end":45,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":45}}, "body": [] } }, "implements": [ { "type": "ClassImplements", - "start": 57, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":57,"end":60,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":60}}, "id": { "type": "Identifier", - "start": 57, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 60 - }, - "identifierName": "Man" - }, + "start":57,"end":60,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":60},"identifierName":"Man"}, "name": "Man" }, "typeParameters": null @@ -181,18 +56,7 @@ ], "body": { "type": "ClassBody", - "start": 61, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 61 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":61,"end":63,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":63}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/output.json index b4b12c31dc..0cb78e7903 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-type-invalid/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: Cannot overwrite reserved type string (1:10)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "string" - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16},"identifierName":"string"}, "name": "string" }, "typeParameters": null, @@ -69,18 +24,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-value/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-value/output.json index af9714b904..a0dc37180e 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-value/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/id-reserved-value/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "switch" - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16},"identifierName":"switch"}, "name": "switch" }, "typeParameters": null, @@ -66,18 +21,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/identifier-named-static-method/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/identifier-named-static-method/output.json index 3ec979ff2b..b083454821 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/identifier-named-static-method/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/identifier-named-static-method/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 12, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":12,"end":32,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":32}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 14, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":14,"end":30,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":30}}, "key": { "type": "Identifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "static" - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20},"identifierName":"static"}, "name": "static" }, "static": false, @@ -117,35 +38,13 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 14, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":14,"end":30,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":30}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/identifier-named-static-optional/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/identifier-named-static-optional/output.json index f51323cb52..34520e7750 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/identifier-named-static-optional/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/identifier-named-static-optional/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "B" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"B"}, "name": "B" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":12,"end":31,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":31}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "key": { "type": "Identifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "static" - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20},"identifierName":"static"}, "name": "static" }, "static": false, @@ -117,18 +38,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - } - } + "start":23,"end":29,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":29}} }, "variance": null, "optional": true diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-exports/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-exports/output.json index 15c57d3707..51705ae6b8 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-exports/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-exports/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "Foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"Foo"}, "name": "Foo" }, "typeParameters": null, @@ -66,18 +21,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16}}, "callProperties": [], "properties": [], "indexers": [], @@ -87,65 +31,19 @@ }, { "type": "ExportNamedDeclaration", - "start": 18, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":18,"end":37,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":19}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":32,"end":35,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":17}}, "local": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "Foo" - }, + "start":32,"end":35,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":17},"identifierName":"Foo"}, "name": "Foo" }, "exported": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "Foo" - }, + "start":32,"end":35,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":17},"identifierName":"Foo"}, "name": "Foo" } } diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/output.json index 7d3d5d2295..ae3f5125cf 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid-2/output.json @@ -1,132 +1,41 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected reserved type string (1:26)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "implements": [ { "type": "ClassImplements", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "Bar" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"Bar"}, "name": "Bar" }, "typeParameters": null }, { "type": "ClassImplements", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":26,"end":32,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":32}}, "id": { "type": "Identifier", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "string" - }, + "start":26,"end":32,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":32},"identifierName":"string"}, "name": "string" }, "typeParameters": null @@ -134,18 +43,7 @@ ], "body": { "type": "ClassBody", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/output.json index c297168879..663e4c8f9d 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-type-invalid/output.json @@ -1,99 +1,31 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ "SyntaxError: Unexpected reserved type string (1:21)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "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" }, "superClass": null, "implements": [ { "type": "ClassImplements", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "string" - }, + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27},"identifierName":"string"}, "name": "string" }, "typeParameters": null @@ -101,18 +33,7 @@ ], "body": { "type": "ClassBody", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-value/output.json b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-value/output.json index 6bd4005485..3e01b65c97 100644 --- a/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-value/output.json +++ b/packages/babel-parser/test/fixtures/flow/interfaces-module-and-script/implements-reserved-value/output.json @@ -1,96 +1,28 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "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" }, "superClass": null, "implements": [ { "type": "ClassImplements", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "switch" - }, + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27},"identifierName":"switch"}, "name": "switch" }, "typeParameters": null @@ -98,18 +30,7 @@ ], "body": { "type": "ClassBody", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/internal-slot/declare-class-static/output.json b/packages/babel-parser/test/fixtures/flow/internal-slot/declare-class-static/output.json index 386e435779..f6fc2b7c24 100644 --- a/packages/babel-parser/test/fixtures/flow/internal-slot/declare-class-static/output.json +++ b/packages/babel-parser/test/fixtures/flow/internal-slot/declare-class-static/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "C" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"C"}, "name": "C" }, "typeParameters": null, @@ -66,85 +21,28 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":16,"end":37,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":37}}, "callProperties": [], "properties": [], "indexers": [], "internalSlots": [ { "type": "ObjectTypeInternalSlot", - "start": 18, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":18,"end":35,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":35}}, "static": true, "id": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "foo" - }, + "start":27,"end":30,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":30},"identifierName":"foo"}, "name": "foo" }, "method": false, "value": { "type": "GenericTypeAnnotation", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "T" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/flow/internal-slot/declare-class/output.json b/packages/babel-parser/test/fixtures/flow/internal-slot/declare-class/output.json index 40d36101bb..074c06515c 100644 --- a/packages/babel-parser/test/fixtures/flow/internal-slot/declare-class/output.json +++ b/packages/babel-parser/test/fixtures/flow/internal-slot/declare-class/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "C" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"C"}, "name": "C" }, "typeParameters": null, @@ -66,85 +21,28 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":16,"end":30,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":30}}, "callProperties": [], "properties": [], "indexers": [], "internalSlots": [ { "type": "ObjectTypeInternalSlot", - "start": 18, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":18,"end":28,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":28}}, "static": false, "id": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23},"identifierName":"foo"}, "name": "foo" }, "method": false, "value": { "type": "GenericTypeAnnotation", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "T" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/flow/internal-slot/interface-method/output.json b/packages/babel-parser/test/fixtures/flow/internal-slot/interface-method/output.json index 1c91e47a42..285585f5d6 100644 --- a/packages/babel-parser/test/fixtures/flow/internal-slot/interface-method/output.json +++ b/packages/babel-parser/test/fixtures/flow/internal-slot/interface-method/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "T" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"T"}, "name": "T" }, "typeParameters": null, @@ -66,103 +21,35 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":12,"end":28,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":28}}, "callProperties": [], "properties": [], "indexers": [], "internalSlots": [ { "type": "ObjectTypeInternalSlot", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "static": false, "id": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "foo" - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19},"identifierName":"foo"}, "name": "foo" }, "method": true, "optional": false, "value": { "type": "FunctionTypeAnnotation", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":14,"end":26,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":26}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "GenericTypeAnnotation", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "X" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"X"}, "name": "X" } } diff --git a/packages/babel-parser/test/fixtures/flow/internal-slot/interface/output.json b/packages/babel-parser/test/fixtures/flow/internal-slot/interface/output.json index b2e2b31165..9419f28566 100644 --- a/packages/babel-parser/test/fixtures/flow/internal-slot/interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/internal-slot/interface/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "T" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"T"}, "name": "T" }, "typeParameters": null, @@ -66,85 +21,28 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":12,"end":26,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}, "callProperties": [], "properties": [], "indexers": [], "internalSlots": [ { "type": "ObjectTypeInternalSlot", - "start": 14, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":14,"end":24,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":24}}, "static": false, "id": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "foo" - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19},"identifierName":"foo"}, "name": "foo" }, "method": false, "value": { "type": "GenericTypeAnnotation", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "X" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"X"}, "name": "X" } } diff --git a/packages/babel-parser/test/fixtures/flow/internal-slot/object-method/output.json b/packages/babel-parser/test/fixtures/flow/internal-slot/object-method/output.json index b42f9eacce..16491604be 100644 --- a/packages/babel-parser/test/fixtures/flow/internal-slot/object-method/output.json +++ b/packages/babel-parser/test/fixtures/flow/internal-slot/object-method/output.json @@ -1,165 +1,52 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "T" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":9,"end":25,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":25}}, "callProperties": [], "properties": [], "indexers": [], "internalSlots": [ { "type": "ObjectTypeInternalSlot", - "start": 11, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":11,"end":23,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":23}}, "static": false, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "method": true, "optional": false, "value": { "type": "FunctionTypeAnnotation", - "start": 11, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":11,"end":23,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":23}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "GenericTypeAnnotation", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "X" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"X"}, "name": "X" } } diff --git a/packages/babel-parser/test/fixtures/flow/internal-slot/object-optional/output.json b/packages/babel-parser/test/fixtures/flow/internal-slot/object-optional/output.json index 605db54c85..5e81c4e110 100644 --- a/packages/babel-parser/test/fixtures/flow/internal-slot/object-optional/output.json +++ b/packages/babel-parser/test/fixtures/flow/internal-slot/object-optional/output.json @@ -1,148 +1,46 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "T" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}}, "callProperties": [], "properties": [], "indexers": [], "internalSlots": [ { "type": "ObjectTypeInternalSlot", - "start": 11, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":11,"end":22,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":22}}, "static": false, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "method": false, "optional": true, "value": { "type": "GenericTypeAnnotation", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "X" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"X"}, "name": "X" } } diff --git a/packages/babel-parser/test/fixtures/flow/internal-slot/object/output.json b/packages/babel-parser/test/fixtures/flow/internal-slot/object/output.json index 6ff31113bc..24c9d1877d 100644 --- a/packages/babel-parser/test/fixtures/flow/internal-slot/object/output.json +++ b/packages/babel-parser/test/fixtures/flow/internal-slot/object/output.json @@ -1,147 +1,45 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "T" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "callProperties": [], "properties": [], "indexers": [], "internalSlots": [ { "type": "ObjectTypeInternalSlot", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21}}, "static": false, "id": { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "foo" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"foo"}, "name": "foo" }, "method": false, "value": { "type": "GenericTypeAnnotation", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "X" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"X"}, "name": "X" } } diff --git a/packages/babel-parser/test/fixtures/flow/iterator/01/output.json b/packages/babel-parser/test/fixtures/flow/iterator/01/output.json index 60270d94f8..9cf79269df 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/01/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/01/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":51,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 20, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":20,"end":48,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":30}}, "key": { "type": "Identifier", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "@@iterator" - }, + "start":20,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12},"identifierName":"@@iterator"}, "name": "@@iterator" }, "static": false, @@ -117,80 +38,24 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 20, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":20,"end":48,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":30}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "GenericTypeAnnotation", - "start": 34, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":34,"end":48,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":30}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 42, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":42,"end":48,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":30}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 43, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":43,"end":47,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":29}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 43, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 29 - }, - "identifierName": "File" - }, + "start":43,"end":47,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":29},"identifierName":"File"}, "name": "File" } } @@ -198,19 +63,7 @@ }, "id": { "type": "Identifier", - "start": 34, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "Iterator" - }, + "start":34,"end":42,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":24},"identifierName":"Iterator"}, "name": "Iterator" } } diff --git a/packages/babel-parser/test/fixtures/flow/iterator/02/output.json b/packages/babel-parser/test/fixtures/flow/iterator/02/output.json index b2c7bca4a7..91a02b2c73 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/02/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/02/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":56,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 20, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":20,"end":53,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":35}}, "key": { "type": "Identifier", - "start": 20, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "@@asyncIterator" - }, + "start":20,"end":35,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17},"identifierName":"@@asyncIterator"}, "name": "@@asyncIterator" }, "static": false, @@ -117,80 +38,24 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 20, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":20,"end":53,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":35}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "GenericTypeAnnotation", - "start": 39, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":39,"end":53,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":35}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 47, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":47,"end":53,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":35}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 48, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":48,"end":52,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":34}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 48, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 34 - }, - "identifierName": "File" - }, + "start":48,"end":52,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":34},"identifierName":"File"}, "name": "File" } } @@ -198,19 +63,7 @@ }, "id": { "type": "Identifier", - "start": 39, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 29 - }, - "identifierName": "Iterator" - }, + "start":39,"end":47,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":29},"identifierName":"Iterator"}, "name": "Iterator" } } diff --git a/packages/babel-parser/test/fixtures/flow/iterator/03/output.json b/packages/babel-parser/test/fixtures/flow/iterator/03/output.json index cac2417339..e056c32eb0 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/03/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/03/output.json @@ -1,81 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid identifier @@asyncIterator (1:19)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "@@asyncIterator" - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19},"identifierName":"@@asyncIterator"}, "name": "@@asyncIterator" }, "init": null diff --git a/packages/babel-parser/test/fixtures/flow/iterator/04/output.json b/packages/babel-parser/test/fixtures/flow/iterator/04/output.json index e86fe7ccc7..106b8002e3 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/04/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/04/output.json @@ -1,81 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid identifier @@iterator (1:14)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "@@iterator" - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14},"identifierName":"@@iterator"}, "name": "@@iterator" }, "init": null diff --git a/packages/babel-parser/test/fixtures/flow/iterator/05/output.json b/packages/babel-parser/test/fixtures/flow/iterator/05/output.json index a5e29cf34d..ca6b8b096c 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/05/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/05/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Invalid identifier @@asyncIterator (2:17)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "T" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"T"}, "name": "T" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":33,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":12,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "@@asyncIterator" - }, + "start":12,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17},"identifierName":"@@asyncIterator"}, "name": "@@asyncIterator" }, "computed": false, @@ -119,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/iterator/06/output.json b/packages/babel-parser/test/fixtures/flow/iterator/06/output.json index 08e5603a22..fad3d45978 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/06/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/06/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Invalid identifier @@iterator (2:12)" ], "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "T" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"T"}, "name": "T" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":28,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "@@iterator" - }, + "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12},"identifierName":"@@iterator"}, "name": "@@iterator" }, "computed": false, @@ -119,18 +40,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/iterator/07/output.json b/packages/babel-parser/test/fixtures/flow/iterator/07/output.json index 60d6128213..265adf68c1 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/07/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/07/output.json @@ -1,83 +1,27 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: Invalid identifier @@iterator (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 5, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "@@iterator" - }, + "start":5,"end":15,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":15},"identifierName":"@@iterator"}, "name": "@@iterator" }, "typeParameters": null, "right": { "type": "NumberTypeAnnotation", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}} } } ], diff --git a/packages/babel-parser/test/fixtures/flow/iterator/08/output.json b/packages/babel-parser/test/fixtures/flow/iterator/08/output.json index 3994f46fa0..278c95feaf 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/08/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/08/output.json @@ -1,83 +1,27 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Invalid identifier @@asyncIterator (1:20)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "@@asyncIterator" - }, + "start":5,"end":20,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":20},"identifierName":"@@asyncIterator"}, "name": "@@asyncIterator" }, "typeParameters": null, "right": { "type": "NumberTypeAnnotation", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - } - } + "start":23,"end":29,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":29}} } } ], diff --git a/packages/babel-parser/test/fixtures/flow/iterator/09/output.json b/packages/babel-parser/test/fixtures/flow/iterator/09/output.json index 95c09f5b7c..0717722547 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/09/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/09/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Invalid identifier @@iterator (2:12)" ], "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":4,"end":29,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "ObjectExpression", - "start": 8, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":29,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 12, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":12,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17}}, "method": true, "key": { "type": "Identifier", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "@@iterator" - }, + "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12},"identifierName":"@@iterator"}, "name": "@@iterator" }, "computed": false, @@ -133,18 +43,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":25,"end":27,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":17}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/iterator/10/output.json b/packages/babel-parser/test/fixtures/flow/iterator/10/output.json index 9e58c564eb..836c3af1af 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/10/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/10/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Invalid identifier @@asyncIterator (2:17)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":4,"end":34,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "ObjectExpression", - "start": 8, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":34,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 12, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":12,"end":32,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":22}}, "method": true, "key": { "type": "Identifier", - "start": 12, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "@@asyncIterator" - }, + "start":12,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17},"identifierName":"@@asyncIterator"}, "name": "@@asyncIterator" }, "computed": false, @@ -133,18 +43,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":30,"end":32,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/iterator/11/output.json b/packages/babel-parser/test/fixtures/flow/iterator/11/output.json index b43086a422..a97fb3437b 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/11/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/11/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Invalid identifier @@random (2:10)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "ObjectExpression", - "start": 8, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":27,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 12, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":12,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "method": true, "key": { "type": "Identifier", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "@@random" - }, + "start":12,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10},"identifierName":"@@random"}, "name": "@@random" }, "computed": false, @@ -133,18 +43,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "body": [], "directives": [] } 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 865bb50328..c8866d6974 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/12/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/12/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":67,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":67,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":67,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -66,63 +21,18 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 14, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":14,"end":44,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":44}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":16,"end":44,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":44}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 18, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":18,"end":42,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":42}}, "key": { "type": "Identifier", - "start": 18, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "@@iterator" - }, + "start":18,"end":28,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":28},"identifierName":"@@iterator"}, "name": "@@iterator" }, "static": false, @@ -131,34 +41,12 @@ "method": false, "value": { "type": "FunctionTypeAnnotation", - "start": 30, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":30,"end":42,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":42}}, "params": [], "rest": null, "returnType": { "type": "StringTypeAnnotation", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } - } + "start":36,"end":42,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":42}} }, "typeParameters": null }, @@ -174,61 +62,17 @@ }, "body": { "type": "BlockStatement", - "start": 45, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":45,"end":67,"loc":{"start":{"line":1,"column":45},"end":{"line":3,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 49, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":49,"end":65,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, "argument": { "type": "TypeCastExpression", - "start": 57, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":57,"end":63,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}}, "expression": { "type": "NumericLiteral", - "start": 57, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":57,"end":58,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, "extra": { "rawValue": 0, "raw": "0" @@ -237,32 +81,10 @@ }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 58, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":58,"end":63,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":16}}, "typeAnnotation": { "type": "AnyTypeAnnotation", - "start": 60, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - } - } + "start":60,"end":63,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16}} } }, "extra": { 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 a21fcad31e..3d995d3398 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/13/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/13/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":72,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":72,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":72,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -66,63 +21,18 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 14, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":14,"end":49,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":49}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":16,"end":49,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":49}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 18, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":18,"end":47,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":47}}, "key": { "type": "Identifier", - "start": 18, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "@@asyncIterator" - }, + "start":18,"end":33,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":33},"identifierName":"@@asyncIterator"}, "name": "@@asyncIterator" }, "static": false, @@ -131,34 +41,12 @@ "method": false, "value": { "type": "FunctionTypeAnnotation", - "start": 35, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":35,"end":47,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":47}}, "params": [], "rest": null, "returnType": { "type": "StringTypeAnnotation", - "start": 41, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 47 - } - } + "start":41,"end":47,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":47}} }, "typeParameters": null }, @@ -174,61 +62,17 @@ }, "body": { "type": "BlockStatement", - "start": 50, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":50,"end":72,"loc":{"start":{"line":1,"column":50},"end":{"line":3,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 54, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":54,"end":70,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, "argument": { "type": "TypeCastExpression", - "start": 62, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":62,"end":68,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}}, "expression": { "type": "NumericLiteral", - "start": 62, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":62,"end":63,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, "extra": { "rawValue": 0, "raw": "0" @@ -237,32 +81,10 @@ }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 63, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":63,"end":68,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":16}}, "typeAnnotation": { "type": "AnyTypeAnnotation", - "start": 65, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - } - } + "start":65,"end":68,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16}} } }, "extra": { diff --git a/packages/babel-parser/test/fixtures/flow/iterator/14/output.json b/packages/babel-parser/test/fixtures/flow/iterator/14/output.json index 399c914de9..3e8644cc75 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/14/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/14/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 12, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":47,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 16, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":16,"end":44,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":30}}, "key": { "type": "Identifier", - "start": 16, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "@@iterator" - }, + "start":16,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12},"identifierName":"@@iterator"}, "name": "@@iterator" }, "static": false, @@ -117,80 +38,24 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 16, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":16,"end":44,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":30}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "GenericTypeAnnotation", - "start": 30, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":30,"end":44,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":30}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 38, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":38,"end":44,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":30}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 39, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":39,"end":43,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":29}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 39, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 29 - }, - "identifierName": "File" - }, + "start":39,"end":43,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":29},"identifierName":"File"}, "name": "File" } } @@ -198,19 +63,7 @@ }, "id": { "type": "Identifier", - "start": 30, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "Iterator" - }, + "start":30,"end":38,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":24},"identifierName":"Iterator"}, "name": "Iterator" } } diff --git a/packages/babel-parser/test/fixtures/flow/iterator/15/output.json b/packages/babel-parser/test/fixtures/flow/iterator/15/output.json index 8c08078cbf..d88ede13e9 100644 --- a/packages/babel-parser/test/fixtures/flow/iterator/15/output.json +++ b/packages/babel-parser/test/fixtures/flow/iterator/15/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 12, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":52,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 16, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":16,"end":49,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":35}}, "key": { "type": "Identifier", - "start": 16, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "@@asyncIterator" - }, + "start":16,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":17},"identifierName":"@@asyncIterator"}, "name": "@@asyncIterator" }, "static": false, @@ -117,80 +38,24 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 16, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":16,"end":49,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":35}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "GenericTypeAnnotation", - "start": 35, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":35,"end":49,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":35}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 43, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":43,"end":49,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":35}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 44, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":44,"end":48,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":34}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 44, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 34 - }, - "identifierName": "File" - }, + "start":44,"end":48,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":34},"identifierName":"File"}, "name": "File" } } @@ -198,19 +63,7 @@ }, "id": { "type": "Identifier", - "start": 35, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 29 - }, - "identifierName": "Iterator" - }, + "start":35,"end":43,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":29},"identifierName":"Iterator"}, "name": "Iterator" } } diff --git a/packages/babel-parser/test/fixtures/flow/literal-types/boolean-false/output.json b/packages/babel-parser/test/fixtures/flow/literal-types/boolean-false/output.json index 9972b5f4e9..8fc6841593 100644 --- a/packages/babel-parser/test/fixtures/flow/literal-types/boolean-false/output.json +++ b/packages/babel-parser/test/fixtures/flow/literal-types/boolean-false/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":4,"end":13,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TypeAnnotation", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "typeAnnotation": { "type": "BooleanLiteralTypeAnnotation", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "value": true } } diff --git a/packages/babel-parser/test/fixtures/flow/literal-types/boolean-true/output.json b/packages/babel-parser/test/fixtures/flow/literal-types/boolean-true/output.json index c3b9f6ab65..d3dd80a28b 100644 --- a/packages/babel-parser/test/fixtures/flow/literal-types/boolean-true/output.json +++ b/packages/babel-parser/test/fixtures/flow/literal-types/boolean-true/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "foo" - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TypeAnnotation", - "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}}, "typeAnnotation": { "type": "BooleanLiteralTypeAnnotation", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "value": false } } diff --git a/packages/babel-parser/test/fixtures/flow/literal-types/null/output.json b/packages/babel-parser/test/fixtures/flow/literal-types/null/output.json index 18c3177d98..7b1f26870f 100644 --- a/packages/babel-parser/test/fixtures/flow/literal-types/null/output.json +++ b/packages/babel-parser/test/fixtures/flow/literal-types/null/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":4,"end":13,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TypeAnnotation", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "typeAnnotation": { "type": "NullLiteralTypeAnnotation", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}} } } }, diff --git a/packages/babel-parser/test/fixtures/flow/literal-types/number-binary/output.json b/packages/babel-parser/test/fixtures/flow/literal-types/number-binary/output.json index 54d5951f2c..0952751d26 100644 --- a/packages/babel-parser/test/fixtures/flow/literal-types/number-binary/output.json +++ b/packages/babel-parser/test/fixtures/flow/literal-types/number-binary/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}}, "typeAnnotation": { "type": "NumberLiteralTypeAnnotation", - "start": 7, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":7,"end":16,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":16}}, "extra": { "rawValue": 123, "raw": "0b1111011" diff --git a/packages/babel-parser/test/fixtures/flow/literal-types/number-float/output.json b/packages/babel-parser/test/fixtures/flow/literal-types/number-float/output.json index 90d8c8d415..fcca496a2e 100644 --- a/packages/babel-parser/test/fixtures/flow/literal-types/number-float/output.json +++ b/packages/babel-parser/test/fixtures/flow/literal-types/number-float/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":4,"end":12,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "typeAnnotation": { "type": "NumberLiteralTypeAnnotation", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "extra": { "rawValue": 123, "raw": "123.0" diff --git a/packages/babel-parser/test/fixtures/flow/literal-types/number-integer/output.json b/packages/babel-parser/test/fixtures/flow/literal-types/number-integer/output.json index bec74d7a65..61a2ae35c0 100644 --- a/packages/babel-parser/test/fixtures/flow/literal-types/number-integer/output.json +++ b/packages/babel-parser/test/fixtures/flow/literal-types/number-integer/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "id": { "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "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}}, "typeAnnotation": { "type": "NumberLiteralTypeAnnotation", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "extra": { "rawValue": 123, "raw": "123" diff --git a/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-binary/output.json b/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-binary/output.json index dd2d8e797e..13e89cebca 100644 --- a/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-binary/output.json +++ b/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-binary/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":4,"end":17,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":5,"end":17,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "NumberLiteralTypeAnnotation", - "start": 7, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":7,"end":17,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":17}}, "extra": { "rawValue": -123, "raw": "-0b1111011" diff --git a/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-float/output.json b/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-float/output.json index c1a0d31863..4f9187fff6 100644 --- a/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-float/output.json +++ b/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-float/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "a" - }, + "start":4,"end":13,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":13},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}}, "typeAnnotation": { "type": "NumberLiteralTypeAnnotation", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "extra": { "rawValue": -123, "raw": "-123.0" diff --git a/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-octal-2/output.json b/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-octal-2/output.json index 03caa38abe..407e4d9d5c 100644 --- a/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-octal-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-octal-2/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "a" - }, + "start":4,"end":13,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":13},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}}, "typeAnnotation": { "type": "NumberLiteralTypeAnnotation", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "extra": { "rawValue": -123, "raw": "-0o173" diff --git a/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-octal/output.json b/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-octal/output.json index c6fe67bfcc..5e08c9a72d 100644 --- a/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-octal/output.json +++ b/packages/babel-parser/test/fixtures/flow/literal-types/number-negative-octal/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":4,"end":12,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "typeAnnotation": { "type": "NumberLiteralTypeAnnotation", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "extra": { "rawValue": -123, "raw": "-0x7B" diff --git a/packages/babel-parser/test/fixtures/flow/literal-types/number-octal-2/output.json b/packages/babel-parser/test/fixtures/flow/literal-types/number-octal-2/output.json index faf2c05216..9d855b1d14 100644 --- a/packages/babel-parser/test/fixtures/flow/literal-types/number-octal-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/literal-types/number-octal-2/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":4,"end":12,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "typeAnnotation": { "type": "NumberLiteralTypeAnnotation", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "extra": { "rawValue": 123, "raw": "0o173" diff --git a/packages/babel-parser/test/fixtures/flow/literal-types/number-octal/output.json b/packages/babel-parser/test/fixtures/flow/literal-types/number-octal/output.json index 38de36ddd6..d9d0b11bc0 100644 --- a/packages/babel-parser/test/fixtures/flow/literal-types/number-octal/output.json +++ b/packages/babel-parser/test/fixtures/flow/literal-types/number-octal/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "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}}, "typeAnnotation": { "type": "NumberLiteralTypeAnnotation", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "extra": { "rawValue": 123, "raw": "0x7B" diff --git a/packages/babel-parser/test/fixtures/flow/literal-types/string-double/output.json b/packages/babel-parser/test/fixtures/flow/literal-types/string-double/output.json index 645105d39e..facfb1a52d 100644 --- a/packages/babel-parser/test/fixtures/flow/literal-types/string-double/output.json +++ b/packages/babel-parser/test/fixtures/flow/literal-types/string-double/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "program": { "type": "Program", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "id": { "type": "Identifier", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "createElement" - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22},"identifierName":"createElement"}, "name": "createElement" }, "generator": false, @@ -65,48 +20,14 @@ "params": [ { "type": "Identifier", - "start": 23, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "tagName" - }, + "start":23,"end":37,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":37},"identifierName":"tagName"}, "name": "tagName", "typeAnnotation": { "type": "TypeAnnotation", - "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}}, "typeAnnotation": { "type": "StringLiteralTypeAnnotation", - "start": 32, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":32,"end":37,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":37}}, "extra": { "rawValue": "div", "raw": "\"div\"" @@ -119,66 +40,21 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 38, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":38,"end":54,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":54}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 40, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":40,"end":54,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":54}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 40, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 54 - }, - "identifierName": "HTMLDivElement" - }, + "start":40,"end":54,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":54},"identifierName":"HTMLDivElement"}, "name": "HTMLDivElement" } } }, "body": { "type": "BlockStatement", - "start": 55, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":55,"end":57,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":57}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/literal-types/string-single/output.json b/packages/babel-parser/test/fixtures/flow/literal-types/string-single/output.json index ef8262a78a..870564be73 100644 --- a/packages/babel-parser/test/fixtures/flow/literal-types/string-single/output.json +++ b/packages/babel-parser/test/fixtures/flow/literal-types/string-single/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "program": { "type": "Program", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "id": { "type": "Identifier", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "createElement" - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22},"identifierName":"createElement"}, "name": "createElement" }, "generator": false, @@ -65,48 +20,14 @@ "params": [ { "type": "Identifier", - "start": 23, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "tagName" - }, + "start":23,"end":37,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":37},"identifierName":"tagName"}, "name": "tagName", "typeAnnotation": { "type": "TypeAnnotation", - "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}}, "typeAnnotation": { "type": "StringLiteralTypeAnnotation", - "start": 32, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":32,"end":37,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":37}}, "extra": { "rawValue": "div", "raw": "'div'" @@ -119,66 +40,21 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 38, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":38,"end":54,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":54}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 40, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":40,"end":54,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":54}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 40, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 54 - }, - "identifierName": "HTMLDivElement" - }, + "start":40,"end":54,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":54},"identifierName":"HTMLDivElement"}, "name": "HTMLDivElement" } } }, "body": { "type": "BlockStatement", - "start": 55, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":55,"end":57,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":57}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/output.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/output.json index c350f1ed19..246523ff73 100644 --- a/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/output.json +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/class/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "errors": [ "SyntaxError: Identifier 'C1' has already been declared (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "C1" - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16},"identifierName":"C1"}, "name": "C1" }, "typeParameters": null, @@ -69,18 +24,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "callProperties": [], "properties": [], "indexers": [], @@ -90,50 +34,16 @@ }, { "type": "ClassDeclaration", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":20,"end":31,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "C1" - }, + "start":26,"end":28,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":8},"identifierName":"C1"}, "name": "C1" }, "superClass": null, "body": { "type": "ClassBody", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-class/output.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-class/output.json index 149ca744eb..d7d0372373 100644 --- a/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-class/output.json +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-class/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 82, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":82,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 82, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":82,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "C1" - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16},"identifierName":"C1"}, "name": "C1" }, "typeParameters": null, @@ -66,18 +21,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "callProperties": [], "properties": [], "indexers": [], @@ -87,33 +31,10 @@ }, { "type": "DeclareClass", - "start": 19, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":19,"end":37,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "C1" - }, + "start":33,"end":35,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16},"identifierName":"C1"}, "name": "C1" }, "typeParameters": null, @@ -122,18 +43,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":35,"end":37,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "callProperties": [], "properties": [], "indexers": [], @@ -143,79 +53,22 @@ }, { "type": "DeclareModule", - "start": 39, - "end": 82, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":39,"end":82,"loc":{"start":{"line":4,"column":0},"end":{"line":6,"column":1}}, "id": { "type": "Identifier", - "start": 54, - "end": 56, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 17 - }, - "identifierName": "M1" - }, + "start":54,"end":56,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":17},"identifierName":"M1"}, "name": "M1" }, "body": { "type": "BlockStatement", - "start": 57, - "end": 82, - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":57,"end":82,"loc":{"start":{"line":4,"column":18},"end":{"line":6,"column":1}}, "body": [ { "type": "DeclareClass", - "start": 61, - "end": 80, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 21 - } - }, + "start":61,"end":80,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":21}}, "id": { "type": "Identifier", - "start": 75, - "end": 77, - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 5, - "column": 18 - }, - "identifierName": "C1" - }, + "start":75,"end":77,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":18},"identifierName":"C1"}, "name": "C1" }, "typeParameters": null, @@ -224,18 +77,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 78, - "end": 80, - "loc": { - "start": { - "line": 5, - "column": 19 - }, - "end": { - "line": 5, - "column": 21 - } - }, + "start":78,"end":80,"loc":{"start":{"line":5,"column":19},"end":{"line":5,"column":21}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-function/output.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-function/output.json index ad507ae140..f9915cba13 100644 --- a/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-function/output.json +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-function/output.json @@ -1,109 +1,31 @@ { "type": "File", - "start": 0, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":0,"end":72,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":16}}, "program": { "type": "Program", - "start": 0, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":0,"end":72,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":16}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareFunction", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 17, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "F1" - }, + "start":17,"end":27,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":27},"identifierName":"F1"}, "name": "F1", "typeAnnotation": { "type": "TypeAnnotation", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "typeParameters": null, "params": [], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27}} } } } @@ -112,79 +34,23 @@ }, { "type": "DeclareFunction", - "start": 28, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":28,"end":55,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}}, "id": { "type": "Identifier", - "start": 45, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "F1" - }, + "start":45,"end":55,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":27},"identifierName":"F1"}, "name": "F1", "typeAnnotation": { "type": "TypeAnnotation", - "start": 47, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":47,"end":55,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":27}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 47, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":47,"end":55,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":27}}, "typeParameters": null, "params": [], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 51, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 27 - } - } + "start":51,"end":55,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":27}} } } } @@ -193,33 +59,10 @@ }, { "type": "FunctionDeclaration", - "start": 56, - "end": 72, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":56,"end":72,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":16}}, "id": { "type": "Identifier", - "start": 65, - "end": 67, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "F1" - }, + "start":65,"end":67,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11},"identifierName":"F1"}, "name": "F1" }, "generator": false, @@ -227,18 +70,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 70, - "end": 72, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":70,"end":72,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-var/output.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-var/output.json index b96badb7fe..9909154d6b 100644 --- a/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-var/output.json +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/declare-var/output.json @@ -1,142 +1,40 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":7}}, "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":7}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareVariable", - "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}}, "id": { "type": "Identifier", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "V1" - }, + "start":12,"end":14,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":14},"identifierName":"V1"}, "name": "V1" } }, { "type": "DeclareVariable", - "start": 16, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":16,"end":31,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "V1" - }, + "start":28,"end":30,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14},"identifierName":"V1"}, "name": "V1" } }, { "type": "VariableDeclaration", - "start": 32, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":32,"end":39,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":7}}, "declarations": [ { "type": "VariableDeclarator", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":36,"end":38,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":6}}, "id": { "type": "Identifier", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "V1" - }, + "start":36,"end":38,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":6},"identifierName":"V1"}, "name": "V1" }, "init": null diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/output.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/output.json index 823ca9be9e..edb012f084 100644 --- a/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/interface/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "errors": [ "SyntaxError: Identifier 'I' has already been declared (2:10)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "typeParameters": null, @@ -69,18 +24,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "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}}, "callProperties": [], "properties": [], "indexers": [], @@ -90,48 +34,14 @@ }, { "type": "EmptyStatement", - "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}} }, { "type": "InterfaceDeclaration", - "start": 16, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":16,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "I" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, "name": "I" }, "typeParameters": null, @@ -140,18 +50,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":28,"end":30,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "callProperties": [], "properties": [], "indexers": [], @@ -161,18 +60,7 @@ }, { "type": "EmptyStatement", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":30,"end":31,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/output.json b/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/output.json index 080077918f..a17be34d17 100644 --- a/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/output.json +++ b/packages/babel-parser/test/fixtures/flow/multiple-declarations/type/output.json @@ -1,131 +1,41 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "errors": [ "SyntaxError: Identifier 'T1' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "T1" - }, + "start":5,"end":7,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":7},"identifierName":"T1"}, "name": "T1" }, "typeParameters": null, "right": { "type": "StringTypeAnnotation", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - } + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}} } }, { "type": "TypeAlias", - "start": 18, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":18,"end":35,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "id": { "type": "Identifier", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "T1" - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":7},"identifierName":"T1"}, "name": "T1" }, "typeParameters": null, "right": { "type": "NumberTypeAnnotation", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - } + "start":28,"end":34,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}} } } ], diff --git a/packages/babel-parser/test/fixtures/flow/object-types/complex-param-types/output.json b/packages/babel-parser/test/fixtures/flow/object-types/complex-param-types/output.json index c6357989dc..948d1edb1a 100644 --- a/packages/babel-parser/test/fixtures/flow/object-types/complex-param-types/output.json +++ b/packages/babel-parser/test/fixtures/flow/object-types/complex-param-types/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "o" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"o"}, "name": "o" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 11, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":11,"end":29,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":29}}, "key": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "m" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"m"}, "name": "m" }, "static": false, @@ -114,97 +35,30 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 11, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":11,"end":29,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":29}}, "params": [ { "type": "FunctionTypeParam", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":13,"end":22,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":22}}, "name": null, "optional": false, "typeAnnotation": { "type": "UnionTypeAnnotation", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":13,"end":22,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":22}}, "types": [ { "type": "GenericTypeAnnotation", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "int" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"int"}, "name": "int" } }, { "type": "BooleanTypeAnnotation", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}} } ] } @@ -214,18 +68,7 @@ "typeParameters": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 25, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 29 - } - } + "start":25,"end":29,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":29}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/output.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/output.json index efdc883212..e100d1aafc 100644 --- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/output.json +++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count-rest/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: getter must not have any formal parameters (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":9,"end":37,"loc":{"start":{"line":1,"column":9},"end":{"line":3,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 13, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":13,"end":34,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":23}}, "key": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "a" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"a"}, "name": "a" }, "static": false, @@ -117,65 +38,20 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 13, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":13,"end":34,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":23}}, "params": [], "rest": { "type": "FunctionTypeParam", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14}}, "name": null, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "foo" - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"foo"}, "name": "foo" } } @@ -183,18 +59,7 @@ "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 23 - } - } + "start":28,"end":34,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":23}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/output.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/output.json index 66bd6ed1ba..0c62673bf1 100644 --- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/output.json +++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-getter-param-count/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: getter must not have any formal parameters (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":9,"end":41,"loc":{"start":{"line":1,"column":9},"end":{"line":3,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 13, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":13,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":27}}, "key": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "a" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"a"}, "name": "a" }, "static": false, @@ -117,65 +38,20 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 13, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":13,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":27}}, "params": [ { "type": "FunctionTypeParam", - "start": 19, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":19,"end":29,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":18}}, "name": { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "foo" - }, + "start":19,"end":22,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11},"identifierName":"foo"}, "name": "foo" }, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 18 - } - } + "start":23,"end":29,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":18}} } } ], @@ -183,18 +59,7 @@ "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 27 - } - } + "start":32,"end":38,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":27}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/output.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/output.json index b79f9a52c8..345f3c0c34 100644 --- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/output.json +++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-count/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: setter must have exactly one formal parameter (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":9,"end":29,"loc":{"start":{"line":1,"column":9},"end":{"line":3,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":13,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "key": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "a" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"a"}, "name": "a" }, "static": false, @@ -117,35 +38,13 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":13,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":22,"end":26,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":15}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/output.json b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/output.json index 5171dbc8a4..07259bb336 100644 --- a/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/object-types/invalid-setter-param-type/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: setter function argument must not be a rest parameter (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":3,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 13, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":13,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "key": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "a" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"a"}, "name": "a" }, "static": false, @@ -117,65 +38,20 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 13, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":13,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "params": [], "rest": { "type": "FunctionTypeParam", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12}}, "name": null, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "w" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"w"}, "name": "w" } } @@ -183,18 +59,7 @@ "typeParameters": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 26, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 19 - } - } + "start":26,"end":30,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":19}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_collision/output.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_collision/output.json index aed10df3ad..c13650cb21 100644 --- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_collision/output.json +++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_collision/output.json @@ -1,146 +1,44 @@ { "type": "File", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":37}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "OpaqueType", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "opaque" - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18},"identifierName":"opaque"}, "name": "opaque" }, "typeParameters": null, "supertype": null, "impltype": { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } }, { "type": "OpaqueType", - "start": 29, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":29,"end":66,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":37}}, "id": { "type": "Identifier", - "start": 41, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "not_transparent" - }, + "start":41,"end":56,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":27},"identifierName":"not_transparent"}, "name": "not_transparent" }, "typeParameters": null, "supertype": null, "impltype": { "type": "GenericTypeAnnotation", - "start": 59, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":59,"end":65,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":36}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 59, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 36 - }, - "identifierName": "opaque" - }, + "start":59,"end":65,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":36},"identifierName":"opaque"}, "name": "opaque" } } diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_export_neither/output.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_export_neither/output.json index dada3aedd5..d835a33ba9 100644 --- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_export_neither/output.json +++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_export_neither/output.json @@ -1,77 +1,21 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareExportDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "declaration": { "type": "DeclareOpaqueType", - "start": 15, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":15,"end":30,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "Foo" - }, + "start":27,"end":30,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":30},"identifierName":"Foo"}, "name": "Foo" }, "typeParameters": null, diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_export_st_no_t/output.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_export_st_no_t/output.json index 13bbbb3a70..b70605d402 100644 --- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_export_st_no_t/output.json +++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_export_st_no_t/output.json @@ -1,110 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareExportDeclaration", - "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}}, "declaration": { "type": "DeclareOpaqueType", - "start": 15, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":15,"end":35,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":35}}, "id": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "Foo" - }, + "start":27,"end":30,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":30},"identifierName":"Foo"}, "name": "Foo" }, "typeParameters": null, "supertype": { "type": "GenericTypeAnnotation", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":32,"end":35,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":35}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "Bar" - }, + "start":32,"end":35,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":35},"identifierName":"Bar"}, "name": "Bar" } }, diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_neither/output.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_neither/output.json index 06b17c32b8..feb7eb5112 100644 --- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_neither/output.json +++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_neither/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareOpaqueType", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "Foo" - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23},"identifierName":"Foo"}, "name": "Foo" }, "typeParameters": null, diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_st_no_t/output.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_st_no_t/output.json index a0ebd094b3..d872213e11 100644 --- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_st_no_t/output.json +++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_declare_st_no_t/output.json @@ -1,96 +1,28 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareOpaqueType", - "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}}, "id": { "type": "Identifier", - "start": 20, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "Test" - }, + "start":20,"end":24,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":24},"identifierName":"Test"}, "name": "Test" }, "typeParameters": null, "supertype": { "type": "GenericTypeAnnotation", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "Foo" - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29},"identifierName":"Foo"}, "name": "Foo" } }, diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_in_exp/output.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_in_exp/output.json index 33d9448431..1ab4044f4f 100644 --- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_in_exp/output.json +++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_in_exp/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "opaque" - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10},"identifierName":"opaque"}, "name": "opaque" }, "init": { "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": 0, "raw": "0" @@ -101,64 +34,19 @@ }, { "type": "ExpressionStatement", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":16,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "expression": { "type": "AssignmentExpression", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":16,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "operator": "+=", "left": { "type": "Identifier", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "opaque" - }, + "start":16,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6},"identifierName":"opaque"}, "name": "opaque" }, "right": { "type": "NumericLiteral", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, "extra": { "rawValue": 4, "raw": "4" diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_in_func/output.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_in_func/output.json index d85d635754..c7317240ce 100644 --- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_in_func/output.json +++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_in_func/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "opaque" - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"opaque"}, "name": "opaque" }, "arguments": [ { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_subtype/output.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_subtype/output.json index 5809df40e8..6dd552b578 100644 --- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_subtype/output.json +++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_subtype/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "OpaqueType", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "id": { "type": "Identifier", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "Counter" - }, + "start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19},"identifierName":"Counter"}, "name": "Counter" }, "typeParameters": null, "supertype": { "type": "GenericTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "T" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"T"}, "name": "T" } } @@ -127,81 +37,24 @@ }, "id": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "Box" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"Box"}, "name": "Box" } }, "impltype": { "type": "GenericTypeAnnotation", - "start": 30, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":30,"end":42,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":42}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":39,"end":42,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":42}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "T" - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"T"}, "name": "T" } } @@ -209,19 +62,7 @@ }, "id": { "type": "Identifier", - "start": 30, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "Container" - }, + "start":30,"end":39,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":39},"identifierName":"Container"}, "name": "Container" } } diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_subtype_export/output.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_subtype_export/output.json index 7acf8d1b53..0a7faddccd 100644 --- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_subtype_export/output.json +++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_subtype_export/output.json @@ -1,142 +1,41 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "specifiers": [], "source": null, "exportKind": "type", "declaration": { "type": "OpaqueType", - "start": 7, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":7,"end":50,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":50}}, "id": { "type": "Identifier", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "Counter" - }, + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26},"identifierName":"Counter"}, "name": "Counter" }, "typeParameters": null, "supertype": { "type": "GenericTypeAnnotation", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":28,"end":34,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":34}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":31,"end":34,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":34}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "T" - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"T"}, "name": "T" } } @@ -144,81 +43,24 @@ }, "id": { "type": "Identifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "Box" - }, + "start":28,"end":31,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":31},"identifierName":"Box"}, "name": "Box" } }, "impltype": { "type": "GenericTypeAnnotation", - "start": 37, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":37,"end":49,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":49}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":46,"end":49,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":49}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "S" - }, + "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48},"identifierName":"S"}, "name": "S" } } @@ -226,19 +68,7 @@ }, "id": { "type": "Identifier", - "start": 37, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "Container" - }, + "start":37,"end":46,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":46},"identifierName":"Container"}, "name": "Container" } } diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_type/output.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_type/output.json index 0d65316821..bbd8adb7db 100644 --- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_type/output.json +++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_type/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "OpaqueType", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "ID" - }, + "start":12,"end":14,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":14},"identifierName":"ID"}, "name": "ID" }, "typeParameters": null, "supertype": null, "impltype": { "type": "NumberTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} } } ], diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_type_export/output.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_type_export/output.json index 76989f9491..f8c51c247f 100644 --- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_type_export/output.json +++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/opaque_type_export/output.json @@ -1,98 +1,31 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "specifiers": [], "source": null, "exportKind": "type", "declaration": { "type": "OpaqueType", - "start": 7, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":7,"end":31,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "ID" - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21},"identifierName":"ID"}, "name": "ID" }, "typeParameters": null, "supertype": null, "impltype": { "type": "NumberTypeAnnotation", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/output.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/output.json index bc568d5767..200ac258b0 100644 --- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/output.json +++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-type-invalid/output.json @@ -1,84 +1,28 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "errors": [ "SyntaxError: Cannot overwrite reserved type string (1:12)" ], "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "OpaqueType", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "string" - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18},"identifierName":"string"}, "name": "string" }, "typeParameters": null, "supertype": null, "impltype": { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } } ], diff --git a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-value/output.json b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-value/output.json index f3bbc0ec7a..b9a5bb32a0 100644 --- a/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-value/output.json +++ b/packages/babel-parser/test/fixtures/flow/opaque-type-alias/reserved-value/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "OpaqueType", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "switch" - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18},"identifierName":"switch"}, "name": "switch" }, "typeParameters": null, "supertype": null, "impltype": { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } } ], diff --git a/packages/babel-parser/test/fixtures/flow/optional-type/1/output.json b/packages/babel-parser/test/fixtures/flow/optional-type/1/output.json index 75f31bbbe6..29b561209b 100644 --- a/packages/babel-parser/test/fixtures/flow/optional-type/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/optional-type/1/output.json @@ -1,131 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":6,"end":20,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "f" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"f"}, "name": "f" }, "init": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x", "optional": true } ], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/optional-type/3/output.json b/packages/babel-parser/test/fixtures/flow/optional-type/3/output.json index 38e2cb2fb8..c3e3ff8064 100644 --- a/packages/babel-parser/test/fixtures/flow/optional-type/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/optional-type/3/output.json @@ -1,191 +1,55 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":6,"end":36,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "f" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"f"}, "name": "f" }, "init": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":10,"end":36,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":36}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x", "optional": true }, { "type": "AssignmentPattern", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":15,"end":29,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":29}}, "left": { "type": "Identifier", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "y" - }, + "start":15,"end":24,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":24},"identifierName":"y"}, "name": "y", "optional": true, "typeAnnotation": { "type": "TypeAnnotation", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "Object" - }, + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24},"identifierName":"Object"}, "name": "Object" } } @@ -193,36 +57,14 @@ }, "right": { "type": "ObjectExpression", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "properties": [] } } ], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/optional-type/4/output.json b/packages/babel-parser/test/fixtures/flow/optional-type/4/output.json index 61dd297789..4884848edf 100644 --- a/packages/babel-parser/test/fixtures/flow/optional-type/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/optional-type/4/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":6,"end":23,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "f" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"f"}, "name": "f" }, "init": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":10,"end":23,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":23}}, "id": null, "generator": false, "async": false, "params": [ { "type": "RestElement", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "argument": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" }, "optional": true @@ -129,18 +39,7 @@ ], "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/optional-type/6/output.json b/packages/babel-parser/test/fixtures/flow/optional-type/6/output.json index 3ef0fdc07d..8472638da8 100644 --- a/packages/babel-parser/test/fixtures/flow/optional-type/6/output.json +++ b/packages/babel-parser/test/fixtures/flow/optional-type/6/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: A binding pattern parameter cannot be optional in an implementation signature. (1:11)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -68,52 +23,19 @@ "params": [ { "type": "ArrayPattern", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "elements": [], "optional": true }, { "type": "ObjectPattern", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "properties": [] } ], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/pragma/1/output.json b/packages/babel-parser/test/fixtures/flow/pragma/1/output.json index f74bc34124..a362179a8d 100644 --- a/packages/babel-parser/test/fixtures/flow/pragma/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/pragma/1/output.json @@ -1,128 +1,37 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 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" }, "operator": "<", "right": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" } }, "operator": ">", "right": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "y" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"y"}, "name": "y", "extra": { "parenthesized": true, @@ -134,115 +43,35 @@ { "type": "CommentLine", "value": " @flow", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - } + "start":11,"end":19,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}} } ] }, { "type": "ExpressionStatement", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":20,"end":30,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":10}}, "expression": { "type": "BinaryExpression", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":20,"end":29,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":9}}, "left": { "type": "BinaryExpression", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":20,"end":25,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":5}}, "left": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3},"identifierName":"foo"}, "name": "foo" }, "operator": "<", "right": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"x"}, "name": "x" } }, "operator": ">", "right": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "y" - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"y"}, "name": "y", "extra": { "parenthesized": true, @@ -254,18 +83,7 @@ { "type": "CommentLine", "value": " @flow", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - } + "start":11,"end":19,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}} } ] } @@ -276,18 +94,7 @@ { "type": "CommentLine", "value": " @flow", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - } + "start":11,"end":19,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}} } ] } \ No newline at end of file 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 d97623a0a1..657920883e 100644 --- a/packages/babel-parser/test/fixtures/flow/pragma/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/pragma/2/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":23,"end":33,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":10}}, "expression": { "type": "CallExpression", - "start": 23, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":23,"end":32,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":9}}, "callee": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "foo" - }, + "start":23,"end":26,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3},"identifierName":"foo"}, "name": "foo" }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":26,"end":29,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":6}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "x" - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"x"}, "name": "x" } } @@ -127,19 +37,7 @@ "arguments": [ { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "y" - }, + "start":30,"end":31,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"y"}, "name": "y" } ] @@ -148,18 +46,7 @@ { "type": "CommentLine", "value": " @flow", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - } + "start":14,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}} } ] } @@ -167,32 +54,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "'use strict'", @@ -203,18 +68,7 @@ { "type": "CommentLine", "value": " @flow", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - } + "start":14,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}} } ] } @@ -224,18 +78,7 @@ { "type": "CommentLine", "value": " @flow", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - } + "start":14,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/pragma/3/output.json b/packages/babel-parser/test/fixtures/flow/pragma/3/output.json index 5baf19ddf2..0e1467763e 100644 --- a/packages/babel-parser/test/fixtures/flow/pragma/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/pragma/3/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 30, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":30,"end":40,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":10}}, "expression": { "type": "CallExpression", - "start": 30, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":30,"end":39,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":9}}, "callee": { "type": "Identifier", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "foo" - }, + "start":30,"end":33,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3},"identifierName":"foo"}, "name": "foo" }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":33,"end":36,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":6}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"x"}, "name": "x" } } @@ -127,19 +37,7 @@ "arguments": [ { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "y" - }, + "start":37,"end":38,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"y"}, "name": "y" } ] @@ -148,34 +46,12 @@ { "type": "CommentLine", "value": " arbitrary comment", - "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}} }, { "type": "CommentLine", "value": " @flow", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - } + "start":21,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}} } ] } @@ -186,34 +62,12 @@ { "type": "CommentLine", "value": " arbitrary comment", - "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}} }, { "type": "CommentLine", "value": " @flow", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - } + "start":21,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}} } ] } \ No newline at end of file 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 46325d1919..e391f94cd9 100644 --- a/packages/babel-parser/test/fixtures/flow/pragma/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/pragma/4/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 44, - "end": 54, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":44,"end":54,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":10}}, "expression": { "type": "CallExpression", - "start": 44, - "end": 53, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":44,"end":53,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":9}}, "callee": { "type": "Identifier", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - }, - "identifierName": "foo" - }, + "start":44,"end":47,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":3},"identifierName":"foo"}, "name": "foo" }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 4, - "column": 3 - }, - "end": { - "line": 4, - "column": 6 - } - }, + "start":47,"end":50,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":6}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":48,"end":49,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":5}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "x" - }, + "start":48,"end":49,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":5},"identifierName":"x"}, "name": "x" } } @@ -127,19 +37,7 @@ "arguments": [ { "type": "Identifier", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 8 - }, - "identifierName": "y" - }, + "start":51,"end":52,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":8},"identifierName":"y"}, "name": "y" } ] @@ -148,34 +46,12 @@ { "type": "CommentLine", "value": " arbitrary comment", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - } + "start":14,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":20}} }, { "type": "CommentLine", "value": " @flow", - "start": 35, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - } + "start":35,"end":43,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":8}} } ] } @@ -183,32 +59,10 @@ "directives": [ { "type": "Directive", - "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}}, "value": { "type": "DirectiveLiteral", - "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}}, "value": "use strict", "extra": { "raw": "'use strict'", @@ -219,34 +73,12 @@ { "type": "CommentLine", "value": " arbitrary comment", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - } + "start":14,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":20}} }, { "type": "CommentLine", "value": " @flow", - "start": 35, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - } + "start":35,"end":43,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":8}} } ] } @@ -256,34 +88,12 @@ { "type": "CommentLine", "value": " arbitrary comment", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - } + "start":14,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":20}} }, { "type": "CommentLine", "value": " @flow", - "start": 35, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 8 - } - } + "start":35,"end":43,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":8}} } ] } \ No newline at end of file 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 c59fb12c86..9bbad04360 100644 --- a/packages/babel-parser/test/fixtures/flow/pragma/5/output.json +++ b/packages/babel-parser/test/fixtures/flow/pragma/5/output.json @@ -1,139 +1,38 @@ { "type": "File", - "start": 0, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":0,"end":74,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":0,"end":74,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":10}}, "sourceType": "module", "interpreter": { "type": "InterpreterDirective", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "value": "/usr/bin/env node" }, "body": [ { "type": "ExpressionStatement", - "start": 64, - "end": 74, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":64,"end":74,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":10}}, "expression": { "type": "CallExpression", - "start": 64, - "end": 73, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 9 - } - }, + "start":64,"end":73,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":9}}, "callee": { "type": "Identifier", - "start": 64, - "end": 67, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 3 - }, - "identifierName": "foo" - }, + "start":64,"end":67,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":3},"identifierName":"foo"}, "name": "foo" }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 67, - "end": 70, - "loc": { - "start": { - "line": 5, - "column": 3 - }, - "end": { - "line": 5, - "column": 6 - } - }, + "start":67,"end":70,"loc":{"start":{"line":5,"column":3},"end":{"line":5,"column":6}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 68, - "end": 69, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":68,"end":69,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":5}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 68, - "end": 69, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - }, - "identifierName": "x" - }, + "start":68,"end":69,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":5},"identifierName":"x"}, "name": "x" } } @@ -142,19 +41,7 @@ "arguments": [ { "type": "Identifier", - "start": 71, - "end": 72, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 8 - }, - "identifierName": "y" - }, + "start":71,"end":72,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":8},"identifierName":"y"}, "name": "y" } ] @@ -163,34 +50,12 @@ { "type": "CommentLine", "value": " arbitrary comment", - "start": 34, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 20 - } - } + "start":34,"end":54,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":20}} }, { "type": "CommentLine", "value": " @flow", - "start": 55, - "end": 63, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 8 - } - } + "start":55,"end":63,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":8}} } ] } @@ -198,32 +63,10 @@ "directives": [ { "type": "Directive", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":20,"end":33,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "value": { "type": "DirectiveLiteral", - "start": 20, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":20,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "value": "use strict", "extra": { "raw": "'use strict'", @@ -234,34 +77,12 @@ { "type": "CommentLine", "value": " arbitrary comment", - "start": 34, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 20 - } - } + "start":34,"end":54,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":20}} }, { "type": "CommentLine", "value": " @flow", - "start": 55, - "end": 63, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 8 - } - } + "start":55,"end":63,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":8}} } ] } @@ -271,34 +92,12 @@ { "type": "CommentLine", "value": " arbitrary comment", - "start": 34, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 20 - } - } + "start":34,"end":54,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":20}} }, { "type": "CommentLine", "value": " @flow", - "start": 55, - "end": 63, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 8 - } - } + "start":55,"end":63,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":8}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/predicates/1/output.json b/packages/babel-parser/test/fixtures/flow/predicates/1/output.json index 64f82d5d02..bd9ce62767 100644 --- a/packages/babel-parser/test/fixtures/flow/predicates/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/predicates/1/output.json @@ -1,222 +1,65 @@ { "type": "File", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":60}}, "program": { "type": "Program", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":60}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareFunction", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":60}}, "id": { "type": "Identifier", - "start": 17, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 59 - }, - "identifierName": "foo" - }, + "start":17,"end":59,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":59},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TypeAnnotation", - "start": 20, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":20,"end":59,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":59}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 20, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":20,"end":59,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":59}}, "typeParameters": null, "params": [ { "type": "FunctionTypeParam", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "name": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"x"}, "name": "x" }, "optional": false, "typeAnnotation": { "type": "MixedTypeAnnotation", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - } + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29}} } } ], "rest": null, "returnType": { "type": "BooleanTypeAnnotation", - "start": 32, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 39 - } - } + "start":32,"end":39,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":39}} } } } }, "predicate": { "type": "DeclaredPredicate", - "start": 40, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":40,"end":59,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":59}}, "value": { "type": "BinaryExpression", - "start": 48, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":48,"end":58,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":58}}, "left": { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 49 - }, - "identifierName": "x" - }, + "start":48,"end":49,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":49},"identifierName":"x"}, "name": "x" }, "operator": "!==", "right": { "type": "NullLiteral", - "start": 54, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 58 - } - } + "start":54,"end":58,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":58}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/predicates/2/output.json b/packages/babel-parser/test/fixtures/flow/predicates/2/output.json index 7e19b6bc6f..de15b42998 100644 --- a/packages/babel-parser/test/fixtures/flow/predicates/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/predicates/2/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":4,"end":52,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":52}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":8,"end":52,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":52}}, "predicate": { "type": "InferredPredicate", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27}} }, "returnType": null, "id": null, @@ -111,115 +33,36 @@ "params": [ { "type": "Identifier", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "x" - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "MixedTypeAnnotation", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17}} } } } ], "body": { "type": "BinaryExpression", - "start": 31, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":31,"end":52,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":52}}, "left": { "type": "UnaryExpression", - "start": 31, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":31,"end":39,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":39}}, "operator": "typeof", "prefix": true, "argument": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "x" - }, + "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39},"identifierName":"x"}, "name": "x" } }, "operator": "===", "right": { "type": "StringLiteral", - "start": 44, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":44,"end":52,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":52}}, "extra": { "rawValue": "string", "raw": "\"string\"" diff --git a/packages/babel-parser/test/fixtures/flow/predicates/3/output.json b/packages/babel-parser/test/fixtures/flow/predicates/3/output.json index e8ead5713f..4f88107d4f 100644 --- a/packages/babel-parser/test/fixtures/flow/predicates/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/predicates/3/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 66 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":66}}, "program": { "type": "Program", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 66 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":66}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":65}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,160 +20,48 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "x" - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 14, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":14,"end":21,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "MixedTypeAnnotation", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}} } } } ], "predicate": { "type": "InferredPredicate", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}} }, "returnType": null, "body": { "type": "BlockStatement", - "start": 32, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":32,"end":65,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":65}}, "body": [ { "type": "ReturnStatement", - "start": 34, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":34,"end":63,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":63}}, "argument": { "type": "BinaryExpression", - "start": 41, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":41,"end":62,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":62}}, "left": { "type": "UnaryExpression", - "start": 41, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":41,"end":49,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":49}}, "operator": "typeof", "prefix": true, "argument": { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 49 - }, - "identifierName": "x" - }, + "start":48,"end":49,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":49},"identifierName":"x"}, "name": "x" } }, "operator": "===", "right": { "type": "StringLiteral", - "start": 54, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":54,"end":62,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":62}}, "extra": { "rawValue": "string", "raw": "\"string\"" @@ -233,18 +76,7 @@ }, { "type": "EmptyStatement", - "start": 65, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 65 - }, - "end": { - "line": 1, - "column": 66 - } - } + "start":65,"end":66,"loc":{"start":{"line":1,"column":65},"end":{"line":1,"column":66}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/predicates/4/output.json b/packages/babel-parser/test/fixtures/flow/predicates/4/output.json index 7b38d3c94c..8c9ecb9c8b 100644 --- a/packages/babel-parser/test/fixtures/flow/predicates/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/predicates/4/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "errors": [ "SyntaxError: Spaces between `%` and `checks` are not allowed here. (1:20)" ], "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":4,"end":53,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":53}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "f" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"f"}, "name": "f" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":8,"end":53,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":53}}, "predicate": { "type": "InferredPredicate", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}} }, "returnType": null, "id": null, @@ -114,115 +36,36 @@ "params": [ { "type": "Identifier", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "x" - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "MixedTypeAnnotation", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17}} } } } ], "body": { "type": "BinaryExpression", - "start": 32, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":32,"end":53,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":53}}, "left": { "type": "UnaryExpression", - "start": 32, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":32,"end":40,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":40}}, "operator": "typeof", "prefix": true, "argument": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "x" - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"x"}, "name": "x" } }, "operator": "===", "right": { "type": "StringLiteral", - "start": 45, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":45,"end":53,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":53}}, "extra": { "rawValue": "string", "raw": "\"string\"" diff --git a/packages/babel-parser/test/fixtures/flow/predicates/5/output.json b/packages/babel-parser/test/fixtures/flow/predicates/5/output.json index 5d1c62f1f3..484e2d0717 100644 --- a/packages/babel-parser/test/fixtures/flow/predicates/5/output.json +++ b/packages/babel-parser/test/fixtures/flow/predicates/5/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Spaces between `%` and `checks` are not allowed here. (1:17)" ], "program": { "type": "Program", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -68,130 +23,40 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"x"}, "name": "x" } ], "predicate": { "type": "InferredPredicate", - "start": 17, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":17,"end":25,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":25}} }, "returnType": null, "body": { "type": "BlockStatement", - "start": 26, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":26,"end":61,"loc":{"start":{"line":1,"column":26},"end":{"line":3,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 30, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":30,"end":59,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":31}}, "argument": { "type": "BinaryExpression", - "start": 37, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":37,"end":58,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":30}}, "left": { "type": "UnaryExpression", - "start": 37, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":37,"end":45,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":17}}, "operator": "typeof", "prefix": true, "argument": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "x" - }, + "start":44,"end":45,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"x"}, "name": "x" } }, "operator": "===", "right": { "type": "StringLiteral", - "start": 50, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":50,"end":58,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":30}}, "extra": { "rawValue": "string", "raw": "\"string\"" diff --git a/packages/babel-parser/test/fixtures/flow/predicates/6/output.json b/packages/babel-parser/test/fixtures/flow/predicates/6/output.json index 945e2bedf0..e3602f7e23 100644 --- a/packages/babel-parser/test/fixtures/flow/predicates/6/output.json +++ b/packages/babel-parser/test/fixtures/flow/predicates/6/output.json @@ -1,197 +1,53 @@ { "type": "File", - "start": 0, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 86 - } - }, + "start":0,"end":86,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":86}}, "program": { "type": "Program", - "start": 0, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 86 - } - }, + "start":0,"end":86,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":86}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareFunction", - "start": 0, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 86 - } - }, + "start":0,"end":86,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":86}}, "id": { "type": "Identifier", - "start": 17, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 85 - }, - "identifierName": "my_filter" - }, + "start":17,"end":85,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":85},"identifierName":"my_filter"}, "name": "my_filter", "typeAnnotation": { "type": "TypeAnnotation", - "start": 26, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 85 - } - }, + "start":26,"end":85,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":85}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 26, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 85 - } - }, + "start":26,"end":85,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":85}}, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 26, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":26,"end":42,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":42}}, "params": [ { "type": "TypeParameter", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28}}, "name": "T", "variance": null }, { "type": "TypeParameter", - "start": 30, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":30,"end":41,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":41}}, "name": "P", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 31, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":31,"end":41,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":41}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 33, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":33,"end":41,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":41}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 38, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":38,"end":41,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":41}}, "params": [ { "type": "NumberLiteralTypeAnnotation", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40}}, "extra": { "rawValue": 1, "raw": "1" @@ -202,19 +58,7 @@ }, "id": { "type": "Identifier", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "$Pred" - }, + "start":33,"end":38,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":38},"identifierName":"$Pred"}, "name": "$Pred" } } @@ -225,95 +69,27 @@ "params": [ { "type": "FunctionTypeParam", - "start": 43, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":43,"end":54,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":54}}, "name": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "v" - }, + "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44},"identifierName":"v"}, "name": "v" }, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 46, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":46,"end":54,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":54}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":51,"end":54,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":54}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":52,"end":53,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":53}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 53 - }, - "identifierName": "T" - }, + "start":52,"end":53,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":53},"identifierName":"T"}, "name": "T" } } @@ -321,85 +97,27 @@ }, "id": { "type": "Identifier", - "start": 46, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "Array" - }, + "start":46,"end":51,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":51},"identifierName":"Array"}, "name": "Array" } } }, { "type": "FunctionTypeParam", - "start": 56, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 56 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":56,"end":61,"loc":{"start":{"line":1,"column":56},"end":{"line":1,"column":61}}, "name": { "type": "Identifier", - "start": 56, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 56 - }, - "end": { - "line": 1, - "column": 58 - }, - "identifierName": "cb" - }, + "start":56,"end":58,"loc":{"start":{"line":1,"column":56},"end":{"line":1,"column":58},"identifierName":"cb"}, "name": "cb" }, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 60, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 60 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":60,"end":61,"loc":{"start":{"line":1,"column":60},"end":{"line":1,"column":61}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 60, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 60 - }, - "end": { - "line": 1, - "column": 61 - }, - "identifierName": "P" - }, + "start":60,"end":61,"loc":{"start":{"line":1,"column":60},"end":{"line":1,"column":61},"identifierName":"P"}, "name": "P" } } @@ -408,142 +126,41 @@ "rest": null, "returnType": { "type": "GenericTypeAnnotation", - "start": 64, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 64 - }, - "end": { - "line": 1, - "column": 85 - } - }, + "start":64,"end":85,"loc":{"start":{"line":1,"column":64},"end":{"line":1,"column":85}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 69, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 69 - }, - "end": { - "line": 1, - "column": 85 - } - }, + "start":69,"end":85,"loc":{"start":{"line":1,"column":69},"end":{"line":1,"column":85}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 70, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 70 - }, - "end": { - "line": 1, - "column": 84 - } - }, + "start":70,"end":84,"loc":{"start":{"line":1,"column":70},"end":{"line":1,"column":84}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 77, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 77 - }, - "end": { - "line": 1, - "column": 84 - } - }, + "start":77,"end":84,"loc":{"start":{"line":1,"column":77},"end":{"line":1,"column":84}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 78, - "end": 79, - "loc": { - "start": { - "line": 1, - "column": 78 - }, - "end": { - "line": 1, - "column": 79 - } - }, + "start":78,"end":79,"loc":{"start":{"line":1,"column":78},"end":{"line":1,"column":79}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 78, - "end": 79, - "loc": { - "start": { - "line": 1, - "column": 78 - }, - "end": { - "line": 1, - "column": 79 - }, - "identifierName": "T" - }, + "start":78,"end":79,"loc":{"start":{"line":1,"column":78},"end":{"line":1,"column":79},"identifierName":"T"}, "name": "T" } }, { "type": "GenericTypeAnnotation", - "start": 80, - "end": 81, - "loc": { - "start": { - "line": 1, - "column": 80 - }, - "end": { - "line": 1, - "column": 81 - } - }, + "start":80,"end":81,"loc":{"start":{"line":1,"column":80},"end":{"line":1,"column":81}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 80, - "end": 81, - "loc": { - "start": { - "line": 1, - "column": 80 - }, - "end": { - "line": 1, - "column": 81 - }, - "identifierName": "P" - }, + "start":80,"end":81,"loc":{"start":{"line":1,"column":80},"end":{"line":1,"column":81},"identifierName":"P"}, "name": "P" } }, { "type": "NumberLiteralTypeAnnotation", - "start": 82, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 82 - }, - "end": { - "line": 1, - "column": 83 - } - }, + "start":82,"end":83,"loc":{"start":{"line":1,"column":82},"end":{"line":1,"column":83}}, "extra": { "rawValue": 1, "raw": "1" @@ -554,19 +171,7 @@ }, "id": { "type": "Identifier", - "start": 70, - "end": 77, - "loc": { - "start": { - "line": 1, - "column": 70 - }, - "end": { - "line": 1, - "column": 77 - }, - "identifierName": "$Refine" - }, + "start":70,"end":77,"loc":{"start":{"line":1,"column":70},"end":{"line":1,"column":77},"identifierName":"$Refine"}, "name": "$Refine" } } @@ -574,19 +179,7 @@ }, "id": { "type": "Identifier", - "start": 64, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 64 - }, - "end": { - "line": 1, - "column": 69 - }, - "identifierName": "Array" - }, + "start":64,"end":69,"loc":{"start":{"line":1,"column":64},"end":{"line":1,"column":69},"identifierName":"Array"}, "name": "Array" } } diff --git a/packages/babel-parser/test/fixtures/flow/proto-props/declare-class/output.json b/packages/babel-parser/test/fixtures/flow/proto-props/declare-class/output.json index c4c890bf22..3eb6751e16 100644 --- a/packages/babel-parser/test/fixtures/flow/proto-props/declare-class/output.json +++ b/packages/babel-parser/test/fixtures/flow/proto-props/declare-class/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 102, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":0,"end":102,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 102, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":0,"end":102,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":31,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":20,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10}}, "key": { "type": "Identifier", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "proto" - }, + "start":20,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7},"identifierName":"proto"}, "name": "proto" }, "static": false, @@ -117,34 +38,11 @@ "method": false, "value": { "type": "GenericTypeAnnotation", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "T" - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"T"}, "name": "T" } }, @@ -159,33 +57,10 @@ }, { "type": "DeclareClass", - "start": 33, - "end": 66, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":33,"end":66,"loc":{"start":{"line":5,"column":0},"end":{"line":7,"column":1}}, "id": { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 15 - }, - "identifierName": "B" - }, + "start":47,"end":48,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":15},"identifierName":"B"}, "name": "B" }, "typeParameters": null, @@ -194,49 +69,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 49, - "end": 66, - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":49,"end":66,"loc":{"start":{"line":5,"column":16},"end":{"line":7,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 53, - "end": 63, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 12 - } - }, + "start":53,"end":63,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":12}}, "key": { "type": "Identifier", - "start": 59, - "end": 60, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 6, - "column": 9 - }, - "identifierName": "x" - }, + "start":59,"end":60,"loc":{"start":{"line":6,"column":8},"end":{"line":6,"column":9},"identifierName":"x"}, "name": "x" }, "static": false, @@ -245,34 +86,11 @@ "method": false, "value": { "type": "GenericTypeAnnotation", - "start": 62, - "end": 63, - "loc": { - "start": { - "line": 6, - "column": 11 - }, - "end": { - "line": 6, - "column": 12 - } - }, + "start":62,"end":63,"loc":{"start":{"line":6,"column":11},"end":{"line":6,"column":12}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 62, - "end": 63, - "loc": { - "start": { - "line": 6, - "column": 11 - }, - "end": { - "line": 6, - "column": 12 - }, - "identifierName": "T" - }, + "start":62,"end":63,"loc":{"start":{"line":6,"column":11},"end":{"line":6,"column":12},"identifierName":"T"}, "name": "T" } }, @@ -287,33 +105,10 @@ }, { "type": "DeclareClass", - "start": 68, - "end": 102, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":68,"end":102,"loc":{"start":{"line":9,"column":0},"end":{"line":11,"column":1}}, "id": { "type": "Identifier", - "start": 82, - "end": 83, - "loc": { - "start": { - "line": 9, - "column": 14 - }, - "end": { - "line": 9, - "column": 15 - }, - "identifierName": "C" - }, + "start":82,"end":83,"loc":{"start":{"line":9,"column":14},"end":{"line":9,"column":15},"identifierName":"C"}, "name": "C" }, "typeParameters": null, @@ -322,49 +117,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 84, - "end": 102, - "loc": { - "start": { - "line": 9, - "column": 16 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":84,"end":102,"loc":{"start":{"line":9,"column":16},"end":{"line":11,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 88, - "end": 99, - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 10, - "column": 13 - } - }, + "start":88,"end":99,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":13}}, "key": { "type": "Identifier", - "start": 95, - "end": 96, - "loc": { - "start": { - "line": 10, - "column": 9 - }, - "end": { - "line": 10, - "column": 10 - }, - "identifierName": "x" - }, + "start":95,"end":96,"loc":{"start":{"line":10,"column":9},"end":{"line":10,"column":10},"identifierName":"x"}, "name": "x" }, "static": false, @@ -373,51 +134,17 @@ "method": false, "value": { "type": "GenericTypeAnnotation", - "start": 98, - "end": 99, - "loc": { - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 10, - "column": 13 - } - }, + "start":98,"end":99,"loc":{"start":{"line":10,"column":12},"end":{"line":10,"column":13}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 98, - "end": 99, - "loc": { - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 10, - "column": 13 - }, - "identifierName": "T" - }, + "start":98,"end":99,"loc":{"start":{"line":10,"column":12},"end":{"line":10,"column":13},"identifierName":"T"}, "name": "T" } }, "variance": { "type": "Variance", - "start": 94, - "end": 95, - "loc": { - "start": { - "line": 10, - "column": 8 - }, - "end": { - "line": 10, - "column": 9 - } - }, + "start":94,"end":95,"loc":{"start":{"line":10,"column":8},"end":{"line":10,"column":9}}, "kind": "plus" }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/qualified-generic-type/1/output.json b/packages/babel-parser/test/fixtures/flow/qualified-generic-type/1/output.json index ceb8577ee6..27f21b7432 100644 --- a/packages/babel-parser/test/fixtures/flow/qualified-generic-type/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/qualified-generic-type/1/output.json @@ -1,154 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "typeParameters": null, "id": { "type": "QualifiedTypeIdentifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "qualification": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "A" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"A"}, "name": "A" }, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "B" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"B"}, "name": "B" } } diff --git a/packages/babel-parser/test/fixtures/flow/qualified-generic-type/2/output.json b/packages/babel-parser/test/fixtures/flow/qualified-generic-type/2/output.json index b0b946f1c2..fb91bcb296 100644 --- a/packages/babel-parser/test/fixtures/flow/qualified-generic-type/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/qualified-generic-type/2/output.json @@ -1,186 +1,50 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "a" - }, + "start":4,"end":13,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":13},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "typeParameters": null, "id": { "type": "QualifiedTypeIdentifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13}}, "qualification": { "type": "QualifiedTypeIdentifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "qualification": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "A" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"A"}, "name": "A" }, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "B" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"B"}, "name": "B" } }, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "C" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"C"}, "name": "C" } } diff --git a/packages/babel-parser/test/fixtures/flow/qualified-generic-type/3/output.json b/packages/babel-parser/test/fixtures/flow/qualified-generic-type/3/output.json index 8ce86cb8f9..348a23ff9f 100644 --- a/packages/babel-parser/test/fixtures/flow/qualified-generic-type/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/qualified-generic-type/3/output.json @@ -1,152 +1,40 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "T" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"T"}, "name": "T" } } @@ -154,50 +42,15 @@ }, "id": { "type": "QualifiedTypeIdentifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "qualification": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "A" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"A"}, "name": "A" }, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "B" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"B"}, "name": "B" } } diff --git a/packages/babel-parser/test/fixtures/flow/qualified-generic-type/4/output.json b/packages/babel-parser/test/fixtures/flow/qualified-generic-type/4/output.json index 7838f04a0a..b79a2c17e3 100644 --- a/packages/babel-parser/test/fixtures/flow/qualified-generic-type/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/qualified-generic-type/4/output.json @@ -1,166 +1,43 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":4,"end":21,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "a" - }, + "start":4,"end":21,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":21},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":6,"end":21,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 8, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":8,"end":21,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":21}}, "argument": { "type": "GenericTypeAnnotation", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "T" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"T"}, "name": "T" } } @@ -168,50 +45,15 @@ }, "id": { "type": "QualifiedTypeIdentifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "qualification": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "A" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"A"}, "name": "A" }, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "B" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"B"}, "name": "B" } } diff --git a/packages/babel-parser/test/fixtures/flow/regression/arrow-function-with-newline/output.json b/packages/babel-parser/test/fixtures/flow/regression/arrow-function-with-newline/output.json index acc286d064..7722bab4ad 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/arrow-function-with-newline/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/arrow-function-with-newline/output.json @@ -1,106 +1,28 @@ { "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "returnType": { "type": "TypeAnnotation", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":10,"end":13,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "t" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"t"}, "name": "t" } } @@ -111,36 +33,13 @@ "params": [ { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "f" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"f"}, "name": "f" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":10}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type-like/output.json b/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type-like/output.json index 3c80e21673..d1defb7ec1 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type-like/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type-like/output.json @@ -1,154 +1,41 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "expression": { "type": "ConditionalExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "test": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "test" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"test"}, "name": "test" }, "consequent": { "type": "TypeCastExpression", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":10,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":9}}, "expression": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"x"}, "name": "x" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":11,"end":14,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"T"}, "name": "T" } } @@ -160,55 +47,20 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":17,"end":23,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":18}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "U" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"U"}, "name": "U" } ], "body": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "y" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"y"}, "name": "y" } } diff --git a/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type/output.json b/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type/output.json index 6be59ef645..405840d57d 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/arrow-in-ternary-with-param-type-and-return-type/output.json @@ -1,138 +1,37 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "expression": { "type": "ConditionalExpression", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "test": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "test" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"test"}, "name": "test" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":9,"end":23,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":18}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "U" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"U"}, "name": "U" } } @@ -143,64 +42,18 @@ "params": [ { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "x" - }, + "start":10,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":9},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":11,"end":14,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"T"}, "name": "T" } } @@ -209,37 +62,13 @@ ], "body": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "y" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"y"}, "name": "y" } }, "alternate": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "z" - }, + "start":28,"end":29,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-10044/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-10044/output.json index 5df63e757a..538c795748 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-10044/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-10044/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 140, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 34 - } - }, + "start":0,"end":140,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 140, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 34 - } - }, + "start":0,"end":140,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "C1" - }, + "start":14,"end":16,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":16},"identifierName":"C1"}, "name": "C1" }, "typeParameters": null, @@ -66,18 +21,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "callProperties": [], "properties": [], "indexers": [], @@ -87,33 +31,10 @@ }, { "type": "DeclareInterface", - "start": 20, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":20,"end":43,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}}, "id": { "type": "Identifier", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "I1" - }, + "start":38,"end":40,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20},"identifierName":"I1"}, "name": "I1" }, "typeParameters": null, @@ -122,18 +43,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":41,"end":43,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":23}}, "callProperties": [], "properties": [], "indexers": [], @@ -143,81 +53,24 @@ }, { "type": "DeclareTypeAlias", - "start": 44, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":44,"end":69,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":25}}, "id": { "type": "Identifier", - "start": 57, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "T1" - }, + "start":57,"end":59,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15},"identifierName":"T1"}, "name": "T1" }, "typeParameters": null, "right": { "type": "NumberTypeAnnotation", - "start": 62, - "end": 68, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 24 - } - } + "start":62,"end":68,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":24}} } }, { "type": "InterfaceDeclaration", - "start": 71, - "end": 86, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":71,"end":86,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":15}}, "id": { "type": "Identifier", - "start": 81, - "end": 83, - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 12 - }, - "identifierName": "I2" - }, + "start":81,"end":83,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":12},"identifierName":"I2"}, "name": "I2" }, "typeParameters": null, @@ -226,18 +79,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 84, - "end": 86, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":84,"end":86,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":15}}, "callProperties": [], "properties": [], "indexers": [], @@ -247,309 +89,89 @@ }, { "type": "TypeAlias", - "start": 87, - "end": 104, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":87,"end":104,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":17}}, "id": { "type": "Identifier", - "start": 92, - "end": 94, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 7 - }, - "identifierName": "T2" - }, + "start":92,"end":94,"loc":{"start":{"line":6,"column":5},"end":{"line":6,"column":7},"identifierName":"T2"}, "name": "T2" }, "typeParameters": null, "right": { "type": "NumberTypeAnnotation", - "start": 97, - "end": 103, - "loc": { - "start": { - "line": 6, - "column": 10 - }, - "end": { - "line": 6, - "column": 16 - } - } + "start":97,"end":103,"loc":{"start":{"line":6,"column":10},"end":{"line":6,"column":16}} } }, { "type": "ExportNamedDeclaration", - "start": 106, - "end": 140, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 34 - } - }, + "start":106,"end":140,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":34}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 120, - "end": 122, - "loc": { - "start": { - "line": 8, - "column": 14 - }, - "end": { - "line": 8, - "column": 16 - } - }, + "start":120,"end":122,"loc":{"start":{"line":8,"column":14},"end":{"line":8,"column":16}}, "local": { "type": "Identifier", - "start": 120, - "end": 122, - "loc": { - "start": { - "line": 8, - "column": 14 - }, - "end": { - "line": 8, - "column": 16 - }, - "identifierName": "C1" - }, + "start":120,"end":122,"loc":{"start":{"line":8,"column":14},"end":{"line":8,"column":16},"identifierName":"C1"}, "name": "C1" }, "exported": { "type": "Identifier", - "start": 120, - "end": 122, - "loc": { - "start": { - "line": 8, - "column": 14 - }, - "end": { - "line": 8, - "column": 16 - }, - "identifierName": "C1" - }, + "start":120,"end":122,"loc":{"start":{"line":8,"column":14},"end":{"line":8,"column":16},"identifierName":"C1"}, "name": "C1" } }, { "type": "ExportSpecifier", - "start": 124, - "end": 126, - "loc": { - "start": { - "line": 8, - "column": 18 - }, - "end": { - "line": 8, - "column": 20 - } - }, + "start":124,"end":126,"loc":{"start":{"line":8,"column":18},"end":{"line":8,"column":20}}, "local": { "type": "Identifier", - "start": 124, - "end": 126, - "loc": { - "start": { - "line": 8, - "column": 18 - }, - "end": { - "line": 8, - "column": 20 - }, - "identifierName": "I1" - }, + "start":124,"end":126,"loc":{"start":{"line":8,"column":18},"end":{"line":8,"column":20},"identifierName":"I1"}, "name": "I1" }, "exported": { "type": "Identifier", - "start": 124, - "end": 126, - "loc": { - "start": { - "line": 8, - "column": 18 - }, - "end": { - "line": 8, - "column": 20 - }, - "identifierName": "I1" - }, + "start":124,"end":126,"loc":{"start":{"line":8,"column":18},"end":{"line":8,"column":20},"identifierName":"I1"}, "name": "I1" } }, { "type": "ExportSpecifier", - "start": 128, - "end": 130, - "loc": { - "start": { - "line": 8, - "column": 22 - }, - "end": { - "line": 8, - "column": 24 - } - }, + "start":128,"end":130,"loc":{"start":{"line":8,"column":22},"end":{"line":8,"column":24}}, "local": { "type": "Identifier", - "start": 128, - "end": 130, - "loc": { - "start": { - "line": 8, - "column": 22 - }, - "end": { - "line": 8, - "column": 24 - }, - "identifierName": "I2" - }, + "start":128,"end":130,"loc":{"start":{"line":8,"column":22},"end":{"line":8,"column":24},"identifierName":"I2"}, "name": "I2" }, "exported": { "type": "Identifier", - "start": 128, - "end": 130, - "loc": { - "start": { - "line": 8, - "column": 22 - }, - "end": { - "line": 8, - "column": 24 - }, - "identifierName": "I2" - }, + "start":128,"end":130,"loc":{"start":{"line":8,"column":22},"end":{"line":8,"column":24},"identifierName":"I2"}, "name": "I2" } }, { "type": "ExportSpecifier", - "start": 132, - "end": 134, - "loc": { - "start": { - "line": 8, - "column": 26 - }, - "end": { - "line": 8, - "column": 28 - } - }, + "start":132,"end":134,"loc":{"start":{"line":8,"column":26},"end":{"line":8,"column":28}}, "local": { "type": "Identifier", - "start": 132, - "end": 134, - "loc": { - "start": { - "line": 8, - "column": 26 - }, - "end": { - "line": 8, - "column": 28 - }, - "identifierName": "T1" - }, + "start":132,"end":134,"loc":{"start":{"line":8,"column":26},"end":{"line":8,"column":28},"identifierName":"T1"}, "name": "T1" }, "exported": { "type": "Identifier", - "start": 132, - "end": 134, - "loc": { - "start": { - "line": 8, - "column": 26 - }, - "end": { - "line": 8, - "column": 28 - }, - "identifierName": "T1" - }, + "start":132,"end":134,"loc":{"start":{"line":8,"column":26},"end":{"line":8,"column":28},"identifierName":"T1"}, "name": "T1" } }, { "type": "ExportSpecifier", - "start": 136, - "end": 138, - "loc": { - "start": { - "line": 8, - "column": 30 - }, - "end": { - "line": 8, - "column": 32 - } - }, + "start":136,"end":138,"loc":{"start":{"line":8,"column":30},"end":{"line":8,"column":32}}, "local": { "type": "Identifier", - "start": 136, - "end": 138, - "loc": { - "start": { - "line": 8, - "column": 30 - }, - "end": { - "line": 8, - "column": 32 - }, - "identifierName": "T2" - }, + "start":136,"end":138,"loc":{"start":{"line":8,"column":30},"end":{"line":8,"column":32},"identifierName":"T2"}, "name": "T2" }, "exported": { "type": "Identifier", - "start": 136, - "end": 138, - "loc": { - "start": { - "line": 8, - "column": 30 - }, - "end": { - "line": 8, - "column": 32 - }, - "identifierName": "T2" - }, + "start":136,"end":138,"loc":{"start":{"line":8,"column":30},"end":{"line":8,"column":32},"identifierName":"T2"}, "name": "T2" } } 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 3742c1bbf7..8bb74d389a 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 @@ -1,138 +1,37 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 32 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":32}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 32 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":32}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 10, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 32 - } - }, + "start":10,"end":42,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":32}}, "expression": { "type": "ConditionalExpression", - "start": 10, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 31 - } - }, + "start":10,"end":41,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":31}}, "test": { "type": "BooleanLiteral", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":10,"end":14,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":4}}, "value": true }, "consequent": { "type": "CallExpression", - "start": 17, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":17,"end":34,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":24}}, "callee": { "type": "MemberExpression", - "start": 17, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":17,"end":32,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":22}}, "object": { "type": "Identifier", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 12 - }, - "identifierName": "async" - }, + "start":17,"end":22,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":12},"identifierName":"async"}, "name": "async" }, "property": { "type": "Identifier", - "start": 23, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 22 - }, - "identifierName": "waterfall" - }, + "start":23,"end":32,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":22},"identifierName":"waterfall"}, "name": "waterfall" }, "computed": false @@ -141,36 +40,14 @@ }, "alternate": { "type": "NullLiteral", - "start": 37, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 27 - }, - "end": { - "line": 3, - "column": 31 - } - } + "start":37,"end":41,"loc":{"start":{"line":3,"column":27},"end":{"line":3,"column":31}} } }, "leadingComments": [ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -181,18 +58,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-166/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-166/output.json index efd8f22618..1c9495485e 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-166/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-166/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,108 +20,30 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":16,"end":66,"loc":{"start":{"line":1,"column":16},"end":{"line":4,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 20, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":20,"end":45,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 26, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":26,"end":44,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":26}}, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "x" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"x"}, "name": "x" }, "init": { "type": "TypeCastExpression", - "start": 31, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":31,"end":43,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":25}}, "expression": { "type": "YieldExpression", - "start": 31, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":31,"end":38,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":20}}, "delegate": false, "argument": { "type": "NumericLiteral", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":37,"end":38,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20}}, "extra": { "rawValue": 5, "raw": "5" @@ -176,32 +53,10 @@ }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 38, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":38,"end":43,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":25}}, "typeAnnotation": { "type": "AnyTypeAnnotation", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - } - } + "start":40,"end":43,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25}} } }, "extra": { @@ -215,78 +70,22 @@ }, { "type": "ExpressionStatement", - "start": 48, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":48,"end":64,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":18}}, "expression": { "type": "ConditionalExpression", - "start": 48, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":48,"end":63,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":17}}, "test": { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "x" - }, + "start":48,"end":49,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"x"}, "name": "x" }, "consequent": { "type": "YieldExpression", - "start": 52, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":52,"end":59,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":13}}, "delegate": false, "argument": { "type": "NumericLiteral", - "start": 58, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":58,"end":59,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}}, "extra": { "rawValue": 1, "raw": "1" @@ -296,19 +95,7 @@ }, "alternate": { "type": "Identifier", - "start": 62, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "x" - }, + "start":62,"end":63,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":17},"identifierName":"x"}, "name": "x" } } 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 69b72ebc29..42b9161b37 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 @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 164, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":0,"end":164,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 164, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":0,"end":164,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 164, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":0,"end":164,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 164, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":10,"end":164,"loc":{"start":{"line":1,"column":10},"end":{"line":11,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 110, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":14,"end":110,"loc":{"start":{"line":2,"column":2},"end":{"line":6,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -116,47 +37,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 110, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":20,"end":110,"loc":{"start":{"line":2,"column":8},"end":{"line":6,"column":3}}, "body": [ { "type": "SwitchStatement", - "start": 26, - "end": 106, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":26,"end":106,"loc":{"start":{"line":3,"column":4},"end":{"line":5,"column":5}}, "discriminant": { "type": "NumericLiteral", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":34,"end":35,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}}, "extra": { "rawValue": 1, "raw": "1" @@ -166,79 +54,22 @@ "cases": [ { "type": "SwitchCase", - "start": 45, - "end": 100, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 61 - } - }, + "start":45,"end":100,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":61}}, "consequent": [], "test": { "type": "BinaryExpression", - "start": 51, - "end": 98, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 59 - } - }, + "start":51,"end":98,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":59}}, "left": { "type": "MemberExpression", - "start": 51, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 32 - } - }, + "start":51,"end":71,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":32}}, "object": { "type": "Identifier", - "start": 51, - "end": 61, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 22 - }, - "identifierName": "MatrixType" - }, + "start":51,"end":61,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":22},"identifierName":"MatrixType"}, "name": "MatrixType" }, "property": { "type": "Identifier", - "start": 62, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 23 - }, - "end": { - "line": 4, - "column": 32 - }, - "identifierName": "IsScaling" - }, + "start":62,"end":71,"loc":{"start":{"line":4,"column":23},"end":{"line":4,"column":32},"identifierName":"IsScaling"}, "name": "IsScaling" }, "computed": false @@ -246,50 +77,15 @@ "operator": "|", "right": { "type": "MemberExpression", - "start": 74, - "end": 98, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 59 - } - }, + "start":74,"end":98,"loc":{"start":{"line":4,"column":35},"end":{"line":4,"column":59}}, "object": { "type": "Identifier", - "start": 74, - "end": 84, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 45 - }, - "identifierName": "MatrixType" - }, + "start":74,"end":84,"loc":{"start":{"line":4,"column":35},"end":{"line":4,"column":45},"identifierName":"MatrixType"}, "name": "MatrixType" }, "property": { "type": "Identifier", - "start": 85, - "end": 98, - "loc": { - "start": { - "line": 4, - "column": 46 - }, - "end": { - "line": 4, - "column": 59 - }, - "identifierName": "IsTranslation" - }, + "start":85,"end":98,"loc":{"start":{"line":4,"column":46},"end":{"line":4,"column":59},"identifierName":"IsTranslation"}, "name": "IsTranslation" }, "computed": false @@ -308,34 +104,11 @@ }, { "type": "ClassMethod", - "start": 114, - "end": 162, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 10, - "column": 3 - } - }, + "start":114,"end":162,"loc":{"start":{"line":8,"column":2},"end":{"line":10,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 114, - "end": 117, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 5 - }, - "identifierName": "bar" - }, + "start":114,"end":117,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":5},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -346,93 +119,26 @@ "params": [], "body": { "type": "BlockStatement", - "start": 120, - "end": 162, - "loc": { - "start": { - "line": 8, - "column": 8 - }, - "end": { - "line": 10, - "column": 3 - } - }, + "start":120,"end":162,"loc":{"start":{"line":8,"column":8},"end":{"line":10,"column":3}}, "body": [ { "type": "SwitchStatement", - "start": 126, - "end": 158, - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 9, - "column": 36 - } - }, + "start":126,"end":158,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":36}}, "discriminant": { "type": "BinaryExpression", - "start": 134, - "end": 154, - "loc": { - "start": { - "line": 9, - "column": 12 - }, - "end": { - "line": 9, - "column": 32 - } - }, + "start":134,"end":154,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":32}}, "left": { "type": "BinaryExpression", - "start": 135, - "end": 145, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 23 - } - }, + "start":135,"end":145,"loc":{"start":{"line":9,"column":13},"end":{"line":9,"column":23}}, "left": { "type": "Identifier", - "start": 135, - "end": 140, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 18 - }, - "identifierName": "typeA" - }, + "start":135,"end":140,"loc":{"start":{"line":9,"column":13},"end":{"line":9,"column":18},"identifierName":"typeA"}, "name": "typeA" }, "operator": "<<", "right": { "type": "NumericLiteral", - "start": 144, - "end": 145, - "loc": { - "start": { - "line": 9, - "column": 22 - }, - "end": { - "line": 9, - "column": 23 - } - }, + "start":144,"end":145,"loc":{"start":{"line":9,"column":22},"end":{"line":9,"column":23}}, "extra": { "rawValue": 4, "raw": "4" @@ -447,19 +153,7 @@ "operator": "|", "right": { "type": "Identifier", - "start": 149, - "end": 154, - "loc": { - "start": { - "line": 9, - "column": 27 - }, - "end": { - "line": 9, - "column": 32 - }, - "identifierName": "typeB" - }, + "start":149,"end":154,"loc":{"start":{"line":9,"column":27},"end":{"line":9,"column":32},"identifierName":"typeB"}, "name": "typeB" } }, 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 adcc7ca593..4f09012ac7 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 @@ -1,123 +1,34 @@ { "type": "File", - "start": 0, - "end": 102, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 8 - } - }, + "start":0,"end":102,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 102, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 8 - } - }, + "start":0,"end":102,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":8}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 92, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":92,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":4,"end":91,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "hello" - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9},"identifierName":"hello"}, "name": "hello" }, "init": { "type": "ArrowFunctionExpression", - "start": 12, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":91,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 41, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":41,"end":49,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":49}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 43, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 49 - } - } + "start":43,"end":49,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":49}} } }, "id": null, @@ -126,79 +37,23 @@ "params": [ { "type": "AssignmentPattern", - "start": 13, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":13,"end":39,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":39}}, "left": { "type": "Identifier", - "start": 13, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "greeting" - }, + "start":13,"end":28,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":28},"identifierName":"greeting"}, "name": "greeting", "typeAnnotation": { "type": "TypeAnnotation", - "start": 21, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":21,"end":28,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":28}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":22,"end":28,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":28}} } } }, "right": { "type": "StringLiteral", - "start": 31, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":31,"end":39,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":39}}, "extra": { "rawValue": " world", "raw": "' world'" @@ -209,93 +64,25 @@ ], "body": { "type": "BlockStatement", - "start": 53, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":53,"end":91,"loc":{"start":{"line":1,"column":53},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 57, - "end": 89, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":57,"end":89,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":34}}, "expression": { "type": "CallExpression", - "start": 57, - "end": 88, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":57,"end":88,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":33}}, "callee": { "type": "MemberExpression", - "start": 57, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":57,"end":68,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "object": { "type": "Identifier", - "start": 57, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "console" - }, + "start":57,"end":64,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":9},"identifierName":"console"}, "name": "console" }, "property": { "type": "Identifier", - "start": 65, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "log" - }, + "start":65,"end":68,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13},"identifierName":"log"}, "name": "log" }, "computed": false @@ -303,32 +90,10 @@ "arguments": [ { "type": "BinaryExpression", - "start": 69, - "end": 87, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":69,"end":87,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":32}}, "left": { "type": "StringLiteral", - "start": 69, - "end": 76, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":69,"end":76,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":21}}, "extra": { "rawValue": "hello", "raw": "'hello'" @@ -338,19 +103,7 @@ "operator": "+", "right": { "type": "Identifier", - "start": 79, - "end": 87, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 32 - }, - "identifierName": "greeting" - }, + "start":79,"end":87,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":32},"identifierName":"greeting"}, "name": "greeting" } } @@ -367,47 +120,13 @@ }, { "type": "ExpressionStatement", - "start": 94, - "end": 102, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 8 - } - }, + "start":94,"end":102,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":8}}, "expression": { "type": "CallExpression", - "start": 94, - "end": 101, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 7 - } - }, + "start":94,"end":101,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":7}}, "callee": { "type": "Identifier", - "start": 94, - "end": 99, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 5 - }, - "identifierName": "hello" - }, + "start":94,"end":99,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":5},"identifierName":"hello"}, "name": "hello" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-264/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-264/output.json index a6292dca52..b5cac75b32 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-264/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-264/output.json @@ -1,157 +1,45 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":6,"end":43,"loc":{"start":{"line":1,"column":6},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "map" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"map"}, "name": "map" }, "init": { "type": "ObjectExpression", - "start": 12, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":43,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "properties": [ { "type": "ObjectProperty", - "start": 16, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":16,"end":41,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":27}}, "method": false, "computed": true, "key": { "type": "BinaryExpression", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":17,"end":26,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":12}}, "left": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "age" - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6},"identifierName":"age"}, "name": "age" }, "operator": "<=", "right": { "type": "NumericLiteral", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":12}}, "extra": { "rawValue": 17, "raw": "17" @@ -162,18 +50,7 @@ "shorthand": false, "value": { "type": "StringLiteral", - "start": 30, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":30,"end":41,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":27}}, "extra": { "rawValue": "Too young", "raw": "'Too young'" diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-321/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-321/output.json index 1af4cfcdc0..0c22b938a4 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-321/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-321/output.json @@ -1,218 +1,61 @@ { "type": "File", - "start": 0, - "end": 118, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 60 - } - }, + "start":0,"end":118,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":60}}, "program": { "type": "Program", - "start": 0, - "end": 118, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 60 - } - }, + "start":0,"end":118,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":60}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":6,"end":56,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":56}}, "id": { "type": "Identifier", - "start": 6, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "fn" - }, + "start":6,"end":37,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":37},"identifierName":"fn"}, "name": "fn", "typeAnnotation": { "type": "TypeAnnotation", - "start": 8, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":8,"end":37,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":37}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 10, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":10,"end":37,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":37}}, "params": [ { "type": "FunctionTypeParam", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19}}, "name": null, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "Object" - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18},"identifierName":"Object"}, "name": "Object" } } }, { "type": "FunctionTypeParam", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27}}, "name": null, "optional": false, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "Object" - }, + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27},"identifierName":"Object"}, "name": "Object" } } @@ -222,18 +65,7 @@ "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 33, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37}} }, "typeParameters": null } @@ -241,72 +73,25 @@ }, "init": { "type": "ArrowFunctionExpression", - "start": 40, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":40,"end":56,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":56}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "o1" - }, + "start":42,"end":44,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":44},"identifierName":"o1"}, "name": "o1" }, { "type": "Identifier", - "start": 46, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "o2" - }, + "start":46,"end":48,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":48},"identifierName":"o2"}, "name": "o2" } ], "body": { "type": "Identifier", - "start": 54, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 56 - }, - "identifierName": "o1" - }, + "start":54,"end":56,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":56},"identifierName":"o1"}, "name": "o1" } } @@ -316,188 +101,53 @@ }, { "type": "VariableDeclaration", - "start": 58, - "end": 118, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 60 - } - }, + "start":58,"end":118,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":60}}, "declarations": [ { "type": "VariableDeclarator", - "start": 64, - "end": 117, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 59 - } - }, + "start":64,"end":117,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":59}}, "id": { "type": "Identifier", - "start": 64, - "end": 97, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 39 - }, - "identifierName": "fn2" - }, + "start":64,"end":97,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":39},"identifierName":"fn2"}, "name": "fn2", "typeAnnotation": { "type": "TypeAnnotation", - "start": 67, - "end": 97, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 39 - } - }, + "start":67,"end":97,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":39}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 69, - "end": 97, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 39 - } - }, + "start":69,"end":97,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":39}}, "params": [ { "type": "FunctionTypeParam", - "start": 71, - "end": 78, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":71,"end":78,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":20}}, "name": null, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 71, - "end": 77, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":71,"end":77,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":19}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 71, - "end": 77, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "Object" - }, + "start":71,"end":77,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":19},"identifierName":"Object"}, "name": "Object" } } }, { "type": "FunctionTypeParam", - "start": 79, - "end": 86, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":79,"end":86,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":28}}, "name": null, "optional": false, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 79, - "end": 86, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":79,"end":86,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":28}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 80, - "end": 86, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":80,"end":86,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":28}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 80, - "end": 86, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 28 - }, - "identifierName": "Object" - }, + "start":80,"end":86,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":28},"identifierName":"Object"}, "name": "Object" } } @@ -507,18 +157,7 @@ "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 93, - "end": 97, - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 39 - } - } + "start":93,"end":97,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":39}} }, "typeParameters": null } @@ -526,72 +165,25 @@ }, "init": { "type": "ArrowFunctionExpression", - "start": 100, - "end": 117, - "loc": { - "start": { - "line": 2, - "column": 42 - }, - "end": { - "line": 2, - "column": 59 - } - }, + "start":100,"end":117,"loc":{"start":{"line":2,"column":42},"end":{"line":2,"column":59}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 102, - "end": 104, - "loc": { - "start": { - "line": 2, - "column": 44 - }, - "end": { - "line": 2, - "column": 46 - }, - "identifierName": "o1" - }, + "start":102,"end":104,"loc":{"start":{"line":2,"column":44},"end":{"line":2,"column":46},"identifierName":"o1"}, "name": "o1" }, { "type": "Identifier", - "start": 106, - "end": 108, - "loc": { - "start": { - "line": 2, - "column": 48 - }, - "end": { - "line": 2, - "column": 50 - }, - "identifierName": "o2" - }, + "start":106,"end":108,"loc":{"start":{"line":2,"column":48},"end":{"line":2,"column":50},"identifierName":"o2"}, "name": "o2" } ], "body": { "type": "Identifier", - "start": 115, - "end": 117, - "loc": { - "start": { - "line": 2, - "column": 57 - }, - "end": { - "line": 2, - "column": 59 - }, - "identifierName": "o1" - }, + "start":115,"end":117,"loc":{"start":{"line":2,"column":57},"end":{"line":2,"column":59},"identifierName":"o1"}, "name": "o1" } } diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-336/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-336/output.json index 241024d9b6..465217227f 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-336/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-336/output.json @@ -1,169 +1,46 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":6,"end":47,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":47}}, "id": { "type": "Identifier", - "start": 6, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "fn" - }, + "start":6,"end":8,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":8},"identifierName":"fn"}, "name": "fn" }, "init": { "type": "ArrowFunctionExpression", - "start": 11, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":11,"end":47,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":47}}, "returnType": { "type": "TypeAnnotation", - "start": 26, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":26,"end":41,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":41}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 28, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":28,"end":41,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":41}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":35,"end":41,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":41}}, "params": [ { "type": "VoidTypeAnnotation", - "start": 36, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 40 - } - } + "start":36,"end":40,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":40}} } ] }, "id": { "type": "Identifier", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "Promise" - }, + "start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35},"identifierName":"Promise"}, "name": "Promise" } } @@ -174,67 +51,22 @@ "params": [ { "type": "Identifier", - "start": 18, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "a" - }, + "start":18,"end":25,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":25},"identifierName":"a"}, "name": "a", "optional": true, "typeAnnotation": { "type": "TypeAnnotation", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25}}, "typeAnnotation": { "type": "AnyTypeAnnotation", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}} } } } ], "body": { "type": "BlockStatement", - "start": 45, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":45,"end":47,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":47}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json index 598107b649..92d6267292 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-1/output.json @@ -1,97 +1,29 @@ { "type": "File", - "start": 0, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":0,"end":67,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":24}}, "errors": [ "SyntaxError: Binding invalid left-hand side in function parameter list (2:11)" ], "program": { "type": "Program", - "start": 0, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":0,"end":67,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 43, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":43,"end":67,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":24}}, "expression": { "type": "ConditionalExpression", - "start": 43, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":43,"end":66,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}}, "test": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "a" - }, + "start":43,"end":44,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "b" - }, + "start":48,"end":49,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"b"}, "name": "b", "extra": { "parenthesized": true, @@ -100,92 +32,34 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 53, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":53,"end":66,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":23}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ArrowFunctionExpression", - "start": 54, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":54,"end":60,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":17}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 54, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "c" - }, + "start":54,"end":55,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"c"}, "name": "c" } ], "body": { "type": "Identifier", - "start": 59, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "d" - }, + "start":59,"end":60,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"d"}, "name": "d" } } ], "body": { "type": "Identifier", - "start": 65, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "e" - }, + "start":65,"end":66,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":23},"identifierName":"e"}, "name": "e" } } @@ -194,18 +68,7 @@ { "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 - } - } + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}} } ] } @@ -216,18 +79,7 @@ { "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 - } - } + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json index c65e342557..f6bdf3a0ad 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-2/output.json @@ -1,141 +1,40 @@ { "type": "File", - "start": 0, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":36}}, "errors": [ "SyntaxError: Binding invalid left-hand side in function parameter list (2:8)" ], "program": { "type": "Program", - "start": 0, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 47, - "end": 83, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":47,"end":83,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":36}}, "expression": { "type": "ConditionalExpression", - "start": 47, - "end": 82, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":47,"end":82,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":35}}, "test": { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "a" - }, + "start":47,"end":48,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 51, - "end": 73, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":51,"end":73,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":26}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 63, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":63,"end":66,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":19}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 65, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":65,"end":66,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 65, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "d" - }, + "start":65,"end":66,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19},"identifierName":"d"}, "name": "d" } } @@ -146,74 +45,27 @@ "params": [ { "type": "ArrowFunctionExpression", - "start": 55, - "end": 61, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":55,"end":61,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "b" - }, + "start":55,"end":56,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"b"}, "name": "b" } ], "body": { "type": "Identifier", - "start": 60, - "end": 61, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "c" - }, + "start":60,"end":61,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"c"}, "name": "c" } } ], "body": { "type": "Identifier", - "start": 71, - "end": 72, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "e" - }, + "start":71,"end":72,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":25},"identifierName":"e"}, "name": "e", "extra": { "parenthesized": true, @@ -222,33 +74,11 @@ }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":51,"end":54,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}}, "params": [ { "type": "TypeParameter", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":52,"end":53,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6}}, "name": "T", "variance": null } @@ -257,55 +87,20 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 76, - "end": 82, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":76,"end":82,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":35}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 76, - "end": 77, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 30 - }, - "identifierName": "f" - }, + "start":76,"end":77,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":30},"identifierName":"f"}, "name": "f" } ], "body": { "type": "Identifier", - "start": 81, - "end": 82, - "loc": { - "start": { - "line": 2, - "column": 34 - }, - "end": { - "line": 2, - "column": 35 - }, - "identifierName": "g" - }, + "start":81,"end":82,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":35},"identifierName":"g"}, "name": "g" } } @@ -314,18 +109,7 @@ { "type": "CommentLine", "value": " Invalid LHS parameter after type parameters", - "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}} } ] } @@ -336,18 +120,7 @@ { "type": "CommentLine", "value": " Invalid LHS parameter after type parameters", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json index ae2fe29baf..d527059cda 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-3/output.json @@ -1,170 +1,56 @@ { "type": "File", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":29}}, "errors": [ "SyntaxError: Binding invalid left-hand side in function parameter list (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 76, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":0,"end":76,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":29}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 47, - "end": 76, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":47,"end":76,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":29}}, "expression": { "type": "ConditionalExpression", - "start": 47, - "end": 75, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":47,"end":75,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, "test": { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "a" - }, + "start":47,"end":48,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 51, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":51,"end":66,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":19}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ArrowFunctionExpression", - "start": 52, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":52,"end":58,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":11}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "b" - }, + "start":52,"end":53,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"b"}, "name": "b" } ], "body": { "type": "Identifier", - "start": 57, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "c" - }, + "start":57,"end":58,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"c"}, "name": "c" } } ], "body": { "type": "Identifier", - "start": 64, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "e" - }, + "start":64,"end":65,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"e"}, "name": "e", "extra": { "parenthesized": true, @@ -174,55 +60,20 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 69, - "end": 75, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":69,"end":75,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":28}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 69, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "f" - }, + "start":69,"end":70,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":23},"identifierName":"f"}, "name": "f" } ], "body": { "type": "Identifier", - "start": 74, - "end": 75, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 28 - }, - "identifierName": "g" - }, + "start":74,"end":75,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":28},"identifierName":"g"}, "name": "g" } } @@ -231,18 +82,7 @@ { "type": "CommentLine", "value": " Invalid LHS parameter after type parameters", - "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}} } ] } @@ -253,18 +93,7 @@ { "type": "CommentLine", "value": " Invalid LHS parameter after type parameters", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json index 2479192b78..72ec0ee872 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58-failing-4/output.json @@ -1,170 +1,56 @@ { "type": "File", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":35}}, "errors": [ "SyntaxError: Binding invalid left-hand side in function parameter list (2:11)" ], "program": { "type": "Program", - "start": 0, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":35}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 25, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":25,"end":60,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":35}}, "expression": { "type": "ConditionalExpression", - "start": 25, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":25,"end":59,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}}, "test": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "a" - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 29, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":29,"end":50,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":25}}, "id": null, "generator": false, "async": true, "params": [ { "type": "ArrowFunctionExpression", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":36,"end":42,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":17}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "b" - }, + "start":36,"end":37,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"b"}, "name": "b" } ], "body": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "c" - }, + "start":41,"end":42,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"c"}, "name": "c" } } ], "body": { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "d" - }, + "start":48,"end":49,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":24},"identifierName":"d"}, "name": "d", "extra": { "parenthesized": true, @@ -174,55 +60,20 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 53, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":53,"end":59,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":34}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 29 - }, - "identifierName": "f" - }, + "start":53,"end":54,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":29},"identifierName":"f"}, "name": "f" } ], "body": { "type": "Identifier", - "start": 58, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 33 - }, - "end": { - "line": 2, - "column": 34 - }, - "identifierName": "g" - }, + "start":58,"end":59,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":34},"identifierName":"g"}, "name": "g" } } @@ -231,18 +82,7 @@ { "type": "CommentLine", "value": " Invalid LHS parameter", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}} } ] } @@ -253,18 +93,7 @@ { "type": "CommentLine", "value": " Invalid LHS parameter", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-58/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-58/output.json index b976e5fd9e..c761185924 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-58/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-58/output.json @@ -1,94 +1,26 @@ { "type": "File", - "start": 0, - "end": 1930, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 44, - "column": 36 - } - }, + "start":0,"end":1930,"loc":{"start":{"line":1,"column":0},"end":{"line":44,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 1930, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 44, - "column": 36 - } - }, + "start":0,"end":1930,"loc":{"start":{"line":1,"column":0},"end":{"line":44,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 38, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":38,"end":55,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "expression": { "type": "ConditionalExpression", - "start": 38, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":38,"end":54,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "test": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "a" - }, + "start":38,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "b" - }, + "start":43,"end":44,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"b"}, "name": "b", "extra": { "parenthesized": true, @@ -97,55 +29,20 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 48, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":48,"end":54,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "c" - }, + "start":48,"end":49,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"c"}, "name": "c" } ], "body": { "type": "Identifier", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "d" - }, + "start":53,"end":54,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16},"identifierName":"d"}, "name": "d" } } @@ -154,143 +51,42 @@ { "type": "CommentLine", "value": " Valid lhs value inside parentheses", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - } + "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 - } - } + "start":56,"end":75,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":37}} } ] }, { "type": "ExpressionStatement", - "start": 76, - "end": 97, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "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 - } - }, + "start":76,"end":96,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":20}}, "test": { "type": "Identifier", - "start": 76, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - }, - "identifierName": "a" - }, + "start":76,"end":77,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 80, - "end": 92, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":80,"end":92,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":16}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 84, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":84,"end":87,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":11}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 86, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":86,"end":87,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 86, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "c" - }, + "start":86,"end":87,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"c"}, "name": "c" } } @@ -301,55 +97,19 @@ "params": [ { "type": "Identifier", - "start": 81, - "end": 82, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "b" - }, + "start":81,"end":82,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":6},"identifierName":"b"}, "name": "b" } ], "body": { "type": "Identifier", - "start": 91, - "end": 92, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 16 - }, - "identifierName": "d" - }, + "start":91,"end":92,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":16},"identifierName":"d"}, "name": "d" } }, "alternate": { "type": "Identifier", - "start": 95, - "end": 96, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 20 - }, - "identifierName": "e" - }, + "start":95,"end":96,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":20},"identifierName":"e"}, "name": "e" } }, @@ -357,99 +117,31 @@ { "type": "CommentLine", "value": " a ? b : (c => d)", - "start": 56, - "end": 75, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 37 - } - } + "start":56,"end":75,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":37}} } ], "trailingComments": [ { "type": "CommentLine", "value": " a ? ((b): c => d) : e", - "start": 98, - "end": 122, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 46 - } - } + "start":98,"end":122,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":46}} } ] }, { "type": "ExpressionStatement", - "start": 123, - "end": 146, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 23 - } - }, + "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 - } - }, + "start":123,"end":145,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":22}}, "test": { "type": "Identifier", - "start": 123, - "end": 124, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - }, - "identifierName": "a" - }, + "start":123,"end":124,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "Identifier", - "start": 128, - "end": 129, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 6 - }, - "identifierName": "b" - }, + "start":128,"end":129,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":6},"identifierName":"b"}, "name": "b", "extra": { "parenthesized": true, @@ -458,63 +150,18 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 133, - "end": 145, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 22 - } - }, + "start":133,"end":145,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":22}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 137, - "end": 140, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 17 - } - }, + "start":137,"end":140,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":17}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 139, - "end": 140, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 17 - } - }, + "start":139,"end":140,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":17}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 139, - "end": 140, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 17 - }, - "identifierName": "d" - }, + "start":139,"end":140,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":17},"identifierName":"d"}, "name": "d" } } @@ -525,37 +172,13 @@ "params": [ { "type": "Identifier", - "start": 134, - "end": 135, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 12 - }, - "identifierName": "c" - }, + "start":134,"end":135,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":12},"identifierName":"c"}, "name": "c" } ], "body": { "type": "Identifier", - "start": 144, - "end": 145, - "loc": { - "start": { - "line": 4, - "column": 21 - }, - "end": { - "line": 4, - "column": 22 - }, - "identifierName": "e" - }, + "start":144,"end":145,"loc":{"start":{"line":4,"column":21},"end":{"line":4,"column":22},"identifierName":"e"}, "name": "e" } } @@ -564,183 +187,58 @@ { "type": "CommentLine", "value": " a ? ((b): c => d) : e", - "start": 98, - "end": 122, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 46 - } - } + "start":98,"end":122,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":46}} } ], "trailingComments": [ { "type": "CommentLine", "value": " a ? b : ((c): d => e)", - "start": 147, - "end": 171, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 48 - } - } + "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 - } - } + "start":173,"end":216,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":43}} } ] }, { "type": "ExpressionStatement", - "start": 217, - "end": 245, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 28 - } - }, + "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 - } - }, + "start":217,"end":244,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":27}}, "test": { "type": "Identifier", - "start": 217, - "end": 218, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - }, - "identifierName": "a" - }, + "start":217,"end":218,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "AssignmentExpression", - "start": 222, - "end": 234, - "loc": { - "start": { - "line": 7, - "column": 5 - }, - "end": { - "line": 7, - "column": 17 - } - }, + "start":222,"end":234,"loc":{"start":{"line":7,"column":5},"end":{"line":7,"column":17}}, "operator": "=", "left": { "type": "Identifier", - "start": 222, - "end": 223, - "loc": { - "start": { - "line": 7, - "column": 5 - }, - "end": { - "line": 7, - "column": 6 - }, - "identifierName": "b" - }, + "start":222,"end":223,"loc":{"start":{"line":7,"column":5},"end":{"line":7,"column":6},"identifierName":"b"}, "name": "b" }, "right": { "type": "ArrowFunctionExpression", - "start": 226, - "end": 234, - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 17 - } - }, + "start":226,"end":234,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":17}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 227, - "end": 228, - "loc": { - "start": { - "line": 7, - "column": 10 - }, - "end": { - "line": 7, - "column": 11 - }, - "identifierName": "c" - }, + "start":227,"end":228,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":11},"identifierName":"c"}, "name": "c" } ], "body": { "type": "Identifier", - "start": 233, - "end": 234, - "loc": { - "start": { - "line": 7, - "column": 16 - }, - "end": { - "line": 7, - "column": 17 - }, - "identifierName": "d" - }, + "start":233,"end":234,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":17},"identifierName":"d"}, "name": "d" } }, @@ -751,55 +249,20 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 238, - "end": 244, - "loc": { - "start": { - "line": 7, - "column": 21 - }, - "end": { - "line": 7, - "column": 27 - } - }, + "start":238,"end":244,"loc":{"start":{"line":7,"column":21},"end":{"line":7,"column":27}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 238, - "end": 239, - "loc": { - "start": { - "line": 7, - "column": 21 - }, - "end": { - "line": 7, - "column": 22 - }, - "identifierName": "e" - }, + "start":238,"end":239,"loc":{"start":{"line":7,"column":21},"end":{"line":7,"column":22},"identifierName":"e"}, "name": "e" } ], "body": { "type": "Identifier", - "start": 243, - "end": 244, - "loc": { - "start": { - "line": 7, - "column": 26 - }, - "end": { - "line": 7, - "column": 27 - }, - "identifierName": "f" - }, + "start":243,"end":244,"loc":{"start":{"line":7,"column":26},"end":{"line":7,"column":27},"identifierName":"f"}, "name": "f" } } @@ -808,159 +271,47 @@ { "type": "CommentLine", "value": " a ? b : ((c): d => e)", - "start": 147, - "end": 171, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 48 - } - } + "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 - } - } + "start":173,"end":216,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":43}} } ], "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 - } - } + "start":246,"end":278,"loc":{"start":{"line":7,"column":29},"end":{"line":7,"column":61}} } ] }, { "type": "ExpressionStatement", - "start": 279, - "end": 311, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 32 - } - }, + "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 - } - }, + "start":279,"end":310,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":31}}, "test": { "type": "Identifier", - "start": 279, - "end": 280, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - }, - "identifierName": "a" - }, + "start":279,"end":280,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 283, - "end": 306, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 27 - } - }, + "start":283,"end":306,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":27}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 298, - "end": 301, - "loc": { - "start": { - "line": 8, - "column": 19 - }, - "end": { - "line": 8, - "column": 22 - } - }, + "start":298,"end":301,"loc":{"start":{"line":8,"column":19},"end":{"line":8,"column":22}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 300, - "end": 301, - "loc": { - "start": { - "line": 8, - "column": 21 - }, - "end": { - "line": 8, - "column": 22 - } - }, + "start":300,"end":301,"loc":{"start":{"line":8,"column":21},"end":{"line":8,"column":22}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 300, - "end": 301, - "loc": { - "start": { - "line": 8, - "column": 21 - }, - "end": { - "line": 8, - "column": 22 - }, - "identifierName": "e" - }, + "start":300,"end":301,"loc":{"start":{"line":8,"column":21},"end":{"line":8,"column":22},"identifierName":"e"}, "name": "e" } } @@ -971,86 +322,28 @@ "params": [ { "type": "AssignmentPattern", - "start": 284, - "end": 296, - "loc": { - "start": { - "line": 8, - "column": 5 - }, - "end": { - "line": 8, - "column": 17 - } - }, + "start":284,"end":296,"loc":{"start":{"line":8,"column":5},"end":{"line":8,"column":17}}, "left": { "type": "Identifier", - "start": 284, - "end": 285, - "loc": { - "start": { - "line": 8, - "column": 5 - }, - "end": { - "line": 8, - "column": 6 - }, - "identifierName": "b" - }, + "start":284,"end":285,"loc":{"start":{"line":8,"column":5},"end":{"line":8,"column":6},"identifierName":"b"}, "name": "b" }, "right": { "type": "ArrowFunctionExpression", - "start": 288, - "end": 296, - "loc": { - "start": { - "line": 8, - "column": 9 - }, - "end": { - "line": 8, - "column": 17 - } - }, + "start":288,"end":296,"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":17}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 289, - "end": 290, - "loc": { - "start": { - "line": 8, - "column": 10 - }, - "end": { - "line": 8, - "column": 11 - }, - "identifierName": "c" - }, + "start":289,"end":290,"loc":{"start":{"line":8,"column":10},"end":{"line":8,"column":11},"identifierName":"c"}, "name": "c" } ], "body": { "type": "Identifier", - "start": 295, - "end": 296, - "loc": { - "start": { - "line": 8, - "column": 16 - }, - "end": { - "line": 8, - "column": 17 - }, - "identifierName": "d" - }, + "start":295,"end":296,"loc":{"start":{"line":8,"column":16},"end":{"line":8,"column":17},"identifierName":"d"}, "name": "d" } } @@ -1058,37 +351,13 @@ ], "body": { "type": "Identifier", - "start": 305, - "end": 306, - "loc": { - "start": { - "line": 8, - "column": 26 - }, - "end": { - "line": 8, - "column": 27 - }, - "identifierName": "f" - }, + "start":305,"end":306,"loc":{"start":{"line":8,"column":26},"end":{"line":8,"column":27},"identifierName":"f"}, "name": "f" } }, "alternate": { "type": "Identifier", - "start": 309, - "end": 310, - "loc": { - "start": { - "line": 8, - "column": 30 - }, - "end": { - "line": 8, - "column": 31 - }, - "identifierName": "g" - }, + "start":309,"end":310,"loc":{"start":{"line":8,"column":30},"end":{"line":8,"column":31},"identifierName":"g"}, "name": "g" } }, @@ -1096,190 +365,55 @@ { "type": "CommentLine", "value": " a ? (b = (c) => d) : (e => f)", - "start": 246, - "end": 278, - "loc": { - "start": { - "line": 7, - "column": 29 - }, - "end": { - "line": 7, - "column": 61 - } - } + "start":246,"end":278,"loc":{"start":{"line":7,"column":29},"end":{"line":7,"column":61}} } ], "trailingComments": [ { "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 - } - } + "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 - } - } + "start":349,"end":382,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":33}} } ] }, { "type": "ExpressionStatement", - "start": 387, - "end": 418, - "loc": { - "start": { - "line": 11, - "column": 4 - }, - "end": { - "line": 11, - "column": 35 - } - }, + "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 - } - }, + "start":387,"end":417,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":34}}, "test": { "type": "Identifier", - "start": 387, - "end": 388, - "loc": { - "start": { - "line": 11, - "column": 4 - }, - "end": { - "line": 11, - "column": 5 - }, - "identifierName": "b" - }, + "start":387,"end":388,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":5},"identifierName":"b"}, "name": "b" }, "consequent": { "type": "ConditionalExpression", - "start": 391, - "end": 413, - "loc": { - "start": { - "line": 11, - "column": 8 - }, - "end": { - "line": 11, - "column": 30 - } - }, + "start":391,"end":413,"loc":{"start":{"line":11,"column":8},"end":{"line":11,"column":30}}, "test": { "type": "Identifier", - "start": 391, - "end": 392, - "loc": { - "start": { - "line": 11, - "column": 8 - }, - "end": { - "line": 11, - "column": 9 - }, - "identifierName": "c" - }, + "start":391,"end":392,"loc":{"start":{"line":11,"column":8},"end":{"line":11,"column":9},"identifierName":"c"}, "name": "c" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 395, - "end": 409, - "loc": { - "start": { - "line": 11, - "column": 12 - }, - "end": { - "line": 11, - "column": 26 - } - }, + "start":395,"end":409,"loc":{"start":{"line":11,"column":12},"end":{"line":11,"column":26}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 399, - "end": 402, - "loc": { - "start": { - "line": 11, - "column": 16 - }, - "end": { - "line": 11, - "column": 19 - } - }, + "start":399,"end":402,"loc":{"start":{"line":11,"column":16},"end":{"line":11,"column":19}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 401, - "end": 402, - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 19 - } - }, + "start":401,"end":402,"loc":{"start":{"line":11,"column":18},"end":{"line":11,"column":19}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 401, - "end": 402, - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 19 - }, - "identifierName": "e" - }, + "start":401,"end":402,"loc":{"start":{"line":11,"column":18},"end":{"line":11,"column":19},"identifierName":"e"}, "name": "e" } } @@ -1290,37 +424,13 @@ "params": [ { "type": "Identifier", - "start": 396, - "end": 397, - "loc": { - "start": { - "line": 11, - "column": 13 - }, - "end": { - "line": 11, - "column": 14 - }, - "identifierName": "d" - }, + "start":396,"end":397,"loc":{"start":{"line":11,"column":13},"end":{"line":11,"column":14},"identifierName":"d"}, "name": "d" } ], "body": { "type": "Identifier", - "start": 407, - "end": 408, - "loc": { - "start": { - "line": 11, - "column": 24 - }, - "end": { - "line": 11, - "column": 25 - }, - "identifierName": "f" - }, + "start":407,"end":408,"loc":{"start":{"line":11,"column":24},"end":{"line":11,"column":25},"identifierName":"f"}, "name": "f", "extra": { "parenthesized": true, @@ -1330,37 +440,13 @@ }, "alternate": { "type": "Identifier", - "start": 412, - "end": 413, - "loc": { - "start": { - "line": 11, - "column": 29 - }, - "end": { - "line": 11, - "column": 30 - }, - "identifierName": "g" - }, + "start":412,"end":413,"loc":{"start":{"line":11,"column":29},"end":{"line":11,"column":30},"identifierName":"g"}, "name": "g" } }, "alternate": { "type": "Identifier", - "start": 416, - "end": 417, - "loc": { - "start": { - "line": 11, - "column": 33 - }, - "end": { - "line": 11, - "column": 34 - }, - "identifierName": "h" - }, + "start":416,"end":417,"loc":{"start":{"line":11,"column":33},"end":{"line":11,"column":34},"identifierName":"h"}, "name": "h" } }, @@ -1368,177 +454,52 @@ { "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 - } - } + "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 - } - } + "start":349,"end":382,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":33}} } ], "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 - } - } + "start":419,"end":453,"loc":{"start":{"line":11,"column":36},"end":{"line":11,"column":70}} } ] }, { "type": "ExpressionStatement", - "start": 454, - "end": 489, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 35 - } - }, + "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 - } - }, + "start":454,"end":488,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":34}}, "test": { "type": "Identifier", - "start": 454, - "end": 455, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 1 - }, - "identifierName": "a" - }, + "start":454,"end":455,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ConditionalExpression", - "start": 458, - "end": 484, - "loc": { - "start": { - "line": 12, - "column": 4 - }, - "end": { - "line": 12, - "column": 30 - } - }, + "start":458,"end":484,"loc":{"start":{"line":12,"column":4},"end":{"line":12,"column":30}}, "test": { "type": "Identifier", - "start": 458, - "end": 459, - "loc": { - "start": { - "line": 12, - "column": 4 - }, - "end": { - "line": 12, - "column": 5 - }, - "identifierName": "b" - }, + "start":458,"end":459,"loc":{"start":{"line":12,"column":4},"end":{"line":12,"column":5},"identifierName":"b"}, "name": "b" }, "consequent": { "type": "ConditionalExpression", - "start": 462, - "end": 480, - "loc": { - "start": { - "line": 12, - "column": 8 - }, - "end": { - "line": 12, - "column": 26 - } - }, + "start":462,"end":480,"loc":{"start":{"line":12,"column":8},"end":{"line":12,"column":26}}, "test": { "type": "Identifier", - "start": 462, - "end": 463, - "loc": { - "start": { - "line": 12, - "column": 8 - }, - "end": { - "line": 12, - "column": 9 - }, - "identifierName": "c" - }, + "start":462,"end":463,"loc":{"start":{"line":12,"column":8},"end":{"line":12,"column":9},"identifierName":"c"}, "name": "c" }, "consequent": { "type": "Identifier", - "start": 467, - "end": 468, - "loc": { - "start": { - "line": 12, - "column": 13 - }, - "end": { - "line": 12, - "column": 14 - }, - "identifierName": "d" - }, + "start":467,"end":468,"loc":{"start":{"line":12,"column":13},"end":{"line":12,"column":14},"identifierName":"d"}, "name": "d", "extra": { "parenthesized": true, @@ -1547,55 +508,20 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 472, - "end": 480, - "loc": { - "start": { - "line": 12, - "column": 18 - }, - "end": { - "line": 12, - "column": 26 - } - }, + "start":472,"end":480,"loc":{"start":{"line":12,"column":18},"end":{"line":12,"column":26}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 472, - "end": 473, - "loc": { - "start": { - "line": 12, - "column": 18 - }, - "end": { - "line": 12, - "column": 19 - }, - "identifierName": "e" - }, + "start":472,"end":473,"loc":{"start":{"line":12,"column":18},"end":{"line":12,"column":19},"identifierName":"e"}, "name": "e" } ], "body": { "type": "Identifier", - "start": 478, - "end": 479, - "loc": { - "start": { - "line": 12, - "column": 24 - }, - "end": { - "line": 12, - "column": 25 - }, - "identifierName": "f" - }, + "start":478,"end":479,"loc":{"start":{"line":12,"column":24},"end":{"line":12,"column":25},"identifierName":"f"}, "name": "f", "extra": { "parenthesized": true, @@ -1606,37 +532,13 @@ }, "alternate": { "type": "Identifier", - "start": 483, - "end": 484, - "loc": { - "start": { - "line": 12, - "column": 29 - }, - "end": { - "line": 12, - "column": 30 - }, - "identifierName": "g" - }, + "start":483,"end":484,"loc":{"start":{"line":12,"column":29},"end":{"line":12,"column":30},"identifierName":"g"}, "name": "g" } }, "alternate": { "type": "Identifier", - "start": 487, - "end": 488, - "loc": { - "start": { - "line": 12, - "column": 33 - }, - "end": { - "line": 12, - "column": 34 - }, - "identifierName": "h" - }, + "start":487,"end":488,"loc":{"start":{"line":12,"column":33},"end":{"line":12,"column":34},"identifierName":"h"}, "name": "h" } }, @@ -1644,130 +546,39 @@ { "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 - } - } + "start":419,"end":453,"loc":{"start":{"line":11,"column":36},"end":{"line":11,"column":70}} } ], "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 - } - } + "start":490,"end":529,"loc":{"start":{"line":12,"column":36},"end":{"line":12,"column":75}} } ] }, { "type": "ExpressionStatement", - "start": 531, - "end": 564, - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 33 - } - }, + "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 - } - }, + "start":531,"end":563,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":32}}, "test": { "type": "Identifier", - "start": 531, - "end": 532, - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 1 - }, - "identifierName": "a" - }, + "start":531,"end":532,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ConditionalExpression", - "start": 535, - "end": 559, - "loc": { - "start": { - "line": 14, - "column": 4 - }, - "end": { - "line": 14, - "column": 28 - } - }, + "start":535,"end":559,"loc":{"start":{"line":14,"column":4},"end":{"line":14,"column":28}}, "test": { "type": "Identifier", - "start": 535, - "end": 536, - "loc": { - "start": { - "line": 14, - "column": 4 - }, - "end": { - "line": 14, - "column": 5 - }, - "identifierName": "b" - }, + "start":535,"end":536,"loc":{"start":{"line":14,"column":4},"end":{"line":14,"column":5},"identifierName":"b"}, "name": "b" }, "consequent": { "type": "Identifier", - "start": 540, - "end": 541, - "loc": { - "start": { - "line": 14, - "column": 9 - }, - "end": { - "line": 14, - "column": 10 - }, - "identifierName": "c" - }, + "start":540,"end":541,"loc":{"start":{"line":14,"column":9},"end":{"line":14,"column":10},"identifierName":"c"}, "name": "c", "extra": { "parenthesized": true, @@ -1776,63 +587,18 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 545, - "end": 559, - "loc": { - "start": { - "line": 14, - "column": 14 - }, - "end": { - "line": 14, - "column": 28 - } - }, + "start":545,"end":559,"loc":{"start":{"line":14,"column":14},"end":{"line":14,"column":28}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 549, - "end": 554, - "loc": { - "start": { - "line": 14, - "column": 18 - }, - "end": { - "line": 14, - "column": 23 - } - }, + "start":549,"end":554,"loc":{"start":{"line":14,"column":18},"end":{"line":14,"column":23}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 552, - "end": 553, - "loc": { - "start": { - "line": 14, - "column": 21 - }, - "end": { - "line": 14, - "column": 22 - } - }, + "start":552,"end":553,"loc":{"start":{"line":14,"column":21},"end":{"line":14,"column":22}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 552, - "end": 553, - "loc": { - "start": { - "line": 14, - "column": 21 - }, - "end": { - "line": 14, - "column": 22 - }, - "identifierName": "e" - }, + "start":552,"end":553,"loc":{"start":{"line":14,"column":21},"end":{"line":14,"column":22},"identifierName":"e"}, "name": "e" } } @@ -1843,56 +609,20 @@ "params": [ { "type": "Identifier", - "start": 546, - "end": 547, - "loc": { - "start": { - "line": 14, - "column": 15 - }, - "end": { - "line": 14, - "column": 16 - }, - "identifierName": "d" - }, + "start":546,"end":547,"loc":{"start":{"line":14,"column":15},"end":{"line":14,"column":16},"identifierName":"d"}, "name": "d" } ], "body": { "type": "Identifier", - "start": 558, - "end": 559, - "loc": { - "start": { - "line": 14, - "column": 27 - }, - "end": { - "line": 14, - "column": 28 - }, - "identifierName": "f" - }, + "start":558,"end":559,"loc":{"start":{"line":14,"column":27},"end":{"line":14,"column":28},"identifierName":"f"}, "name": "f" } } }, "alternate": { "type": "Identifier", - "start": 562, - "end": 563, - "loc": { - "start": { - "line": 14, - "column": 31 - }, - "end": { - "line": 14, - "column": 32 - }, - "identifierName": "g" - }, + "start":562,"end":563,"loc":{"start":{"line":14,"column":31},"end":{"line":14,"column":32},"identifierName":"g"}, "name": "g" } }, @@ -1900,159 +630,47 @@ { "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 - } - } + "start":490,"end":529,"loc":{"start":{"line":12,"column":36},"end":{"line":12,"column":75}} } ], "trailingComments": [ { "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 - } - } + "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 - } - } + "start":601,"end":628,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":27}} } ] }, { "type": "ExpressionStatement", - "start": 629, - "end": 661, - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 17, - "column": 32 - } - }, + "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 - } - }, + "start":629,"end":660,"loc":{"start":{"line":17,"column":0},"end":{"line":17,"column":31}}, "test": { "type": "Identifier", - "start": 629, - "end": 630, - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 17, - "column": 1 - }, - "identifierName": "a" - }, + "start":629,"end":630,"loc":{"start":{"line":17,"column":0},"end":{"line":17,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 633, - "end": 645, - "loc": { - "start": { - "line": 17, - "column": 4 - }, - "end": { - "line": 17, - "column": 16 - } - }, + "start":633,"end":645,"loc":{"start":{"line":17,"column":4},"end":{"line":17,"column":16}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 637, - "end": 640, - "loc": { - "start": { - "line": 17, - "column": 8 - }, - "end": { - "line": 17, - "column": 11 - } - }, + "start":637,"end":640,"loc":{"start":{"line":17,"column":8},"end":{"line":17,"column":11}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 639, - "end": 640, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - }, + "start":639,"end":640,"loc":{"start":{"line":17,"column":10},"end":{"line":17,"column":11}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 639, - "end": 640, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - }, - "identifierName": "c" - }, + "start":639,"end":640,"loc":{"start":{"line":17,"column":10},"end":{"line":17,"column":11},"identifierName":"c"}, "name": "c" } } @@ -2063,99 +681,30 @@ "params": [ { "type": "Identifier", - "start": 634, - "end": 635, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 6 - }, - "identifierName": "b" - }, + "start":634,"end":635,"loc":{"start":{"line":17,"column":5},"end":{"line":17,"column":6},"identifierName":"b"}, "name": "b" } ], "body": { "type": "Identifier", - "start": 644, - "end": 645, - "loc": { - "start": { - "line": 17, - "column": 15 - }, - "end": { - "line": 17, - "column": 16 - }, - "identifierName": "d" - }, + "start":644,"end":645,"loc":{"start":{"line":17,"column":15},"end":{"line":17,"column":16},"identifierName":"d"}, "name": "d" } }, "alternate": { "type": "ArrowFunctionExpression", - "start": 648, - "end": 660, - "loc": { - "start": { - "line": 17, - "column": 19 - }, - "end": { - "line": 17, - "column": 31 - } - }, + "start":648,"end":660,"loc":{"start":{"line":17,"column":19},"end":{"line":17,"column":31}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 652, - "end": 655, - "loc": { - "start": { - "line": 17, - "column": 23 - }, - "end": { - "line": 17, - "column": 26 - } - }, + "start":652,"end":655,"loc":{"start":{"line":17,"column":23},"end":{"line":17,"column":26}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 654, - "end": 655, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 26 - } - }, + "start":654,"end":655,"loc":{"start":{"line":17,"column":25},"end":{"line":17,"column":26}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 654, - "end": 655, - "loc": { - "start": { - "line": 17, - "column": 25 - }, - "end": { - "line": 17, - "column": 26 - }, - "identifierName": "f" - }, + "start":654,"end":655,"loc":{"start":{"line":17,"column":25},"end":{"line":17,"column":26},"identifierName":"f"}, "name": "f" } } @@ -2166,37 +715,13 @@ "params": [ { "type": "Identifier", - "start": 649, - "end": 650, - "loc": { - "start": { - "line": 17, - "column": 20 - }, - "end": { - "line": 17, - "column": 21 - }, - "identifierName": "e" - }, + "start":649,"end":650,"loc":{"start":{"line":17,"column":20},"end":{"line":17,"column":21},"identifierName":"e"}, "name": "e" } ], "body": { "type": "Identifier", - "start": 659, - "end": 660, - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 31 - }, - "identifierName": "g" - }, + "start":659,"end":660,"loc":{"start":{"line":17,"column":30},"end":{"line":17,"column":31},"identifierName":"g"}, "name": "g" } } @@ -2205,175 +730,52 @@ { "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 - } - } + "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 - } - } + "start":601,"end":628,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":27}} } ], "trailingComments": [ { "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 - } - } + "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 - } - } + "start":700,"end":771,"loc":{"start":{"line":19,"column":0},"end":{"line":19,"column":71}} } ] }, { "type": "ExpressionStatement", - "start": 772, - "end": 804, - "loc": { - "start": { - "line": 20, - "column": 0 - }, - "end": { - "line": 20, - "column": 32 - } - }, + "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 - } - }, + "start":772,"end":803,"loc":{"start":{"line":20,"column":0},"end":{"line":20,"column":31}}, "test": { "type": "Identifier", - "start": 772, - "end": 773, - "loc": { - "start": { - "line": 20, - "column": 0 - }, - "end": { - "line": 20, - "column": 1 - }, - "identifierName": "a" - }, + "start":772,"end":773,"loc":{"start":{"line":20,"column":0},"end":{"line":20,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 776, - "end": 799, - "loc": { - "start": { - "line": 20, - "column": 4 - }, - "end": { - "line": 20, - "column": 27 - } - }, + "start":776,"end":799,"loc":{"start":{"line":20,"column":4},"end":{"line":20,"column":27}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 780, - "end": 783, - "loc": { - "start": { - "line": 20, - "column": 8 - }, - "end": { - "line": 20, - "column": 11 - } - }, + "start":780,"end":783,"loc":{"start":{"line":20,"column":8},"end":{"line":20,"column":11}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 782, - "end": 783, - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 11 - } - }, + "start":782,"end":783,"loc":{"start":{"line":20,"column":10},"end":{"line":20,"column":11}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 782, - "end": 783, - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 11 - }, - "identifierName": "c" - }, + "start":782,"end":783,"loc":{"start":{"line":20,"column":10},"end":{"line":20,"column":11},"identifierName":"c"}, "name": "c" } } @@ -2384,81 +786,24 @@ "params": [ { "type": "Identifier", - "start": 777, - "end": 778, - "loc": { - "start": { - "line": 20, - "column": 5 - }, - "end": { - "line": 20, - "column": 6 - }, - "identifierName": "b" - }, + "start":777,"end":778,"loc":{"start":{"line":20,"column":5},"end":{"line":20,"column":6},"identifierName":"b"}, "name": "b" } ], "body": { "type": "ArrowFunctionExpression", - "start": 787, - "end": 799, - "loc": { - "start": { - "line": 20, - "column": 15 - }, - "end": { - "line": 20, - "column": 27 - } - }, + "start":787,"end":799,"loc":{"start":{"line":20,"column":15},"end":{"line":20,"column":27}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 791, - "end": 794, - "loc": { - "start": { - "line": 20, - "column": 19 - }, - "end": { - "line": 20, - "column": 22 - } - }, + "start":791,"end":794,"loc":{"start":{"line":20,"column":19},"end":{"line":20,"column":22}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 793, - "end": 794, - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 22 - } - }, + "start":793,"end":794,"loc":{"start":{"line":20,"column":21},"end":{"line":20,"column":22}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 793, - "end": 794, - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 22 - }, - "identifierName": "e" - }, + "start":793,"end":794,"loc":{"start":{"line":20,"column":21},"end":{"line":20,"column":22},"identifierName":"e"}, "name": "e" } } @@ -2469,56 +814,20 @@ "params": [ { "type": "Identifier", - "start": 788, - "end": 789, - "loc": { - "start": { - "line": 20, - "column": 16 - }, - "end": { - "line": 20, - "column": 17 - }, - "identifierName": "d" - }, + "start":788,"end":789,"loc":{"start":{"line":20,"column":16},"end":{"line":20,"column":17},"identifierName":"d"}, "name": "d" } ], "body": { "type": "Identifier", - "start": 798, - "end": 799, - "loc": { - "start": { - "line": 20, - "column": 26 - }, - "end": { - "line": 20, - "column": 27 - }, - "identifierName": "f" - }, + "start":798,"end":799,"loc":{"start":{"line":20,"column":26},"end":{"line":20,"column":27},"identifierName":"f"}, "name": "f" } } }, "alternate": { "type": "Identifier", - "start": 802, - "end": 803, - "loc": { - "start": { - "line": 20, - "column": 30 - }, - "end": { - "line": 20, - "column": 31 - }, - "identifierName": "g" - }, + "start":802,"end":803,"loc":{"start":{"line":20,"column":30},"end":{"line":20,"column":31},"identifierName":"g"}, "name": "g" } }, @@ -2526,115 +835,36 @@ { "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 - } - } + "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 - } - } + "start":700,"end":771,"loc":{"start":{"line":19,"column":0},"end":{"line":19,"column":71}} } ], "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 - } - } + "start":805,"end":841,"loc":{"start":{"line":20,"column":33},"end":{"line":20,"column":69}} } ] }, { "type": "ExpressionStatement", - "start": 842, - "end": 873, - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 21, - "column": 31 - } - }, + "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 - } - }, + "start":842,"end":872,"loc":{"start":{"line":21,"column":0},"end":{"line":21,"column":30}}, "test": { "type": "Identifier", - "start": 842, - "end": 843, - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 21, - "column": 1 - }, - "identifierName": "a" - }, + "start":842,"end":843,"loc":{"start":{"line":21,"column":0},"end":{"line":21,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "Identifier", - "start": 847, - "end": 848, - "loc": { - "start": { - "line": 21, - "column": 5 - }, - "end": { - "line": 21, - "column": 6 - }, - "identifierName": "b" - }, + "start":847,"end":848,"loc":{"start":{"line":21,"column":5},"end":{"line":21,"column":6},"identifierName":"b"}, "name": "b", "extra": { "parenthesized": true, @@ -2643,99 +873,31 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 852, - "end": 872, - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 30 - } - }, + "start":852,"end":872,"loc":{"start":{"line":21,"column":10},"end":{"line":21,"column":30}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 852, - "end": 853, - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 11 - }, - "identifierName": "c" - }, + "start":852,"end":853,"loc":{"start":{"line":21,"column":10},"end":{"line":21,"column":11},"identifierName":"c"}, "name": "c" } ], "body": { "type": "ArrowFunctionExpression", - "start": 857, - "end": 872, - "loc": { - "start": { - "line": 21, - "column": 15 - }, - "end": { - "line": 21, - "column": 30 - } - }, + "start":857,"end":872,"loc":{"start":{"line":21,"column":15},"end":{"line":21,"column":30}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 864, - "end": 867, - "loc": { - "start": { - "line": 21, - "column": 22 - }, - "end": { - "line": 21, - "column": 25 - } - }, + "start":864,"end":867,"loc":{"start":{"line":21,"column":22},"end":{"line":21,"column":25}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 866, - "end": 867, - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 25 - } - }, + "start":866,"end":867,"loc":{"start":{"line":21,"column":24},"end":{"line":21,"column":25}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 866, - "end": 867, - "loc": { - "start": { - "line": 21, - "column": 24 - }, - "end": { - "line": 21, - "column": 25 - }, - "identifierName": "e" - }, + "start":866,"end":867,"loc":{"start":{"line":21,"column":24},"end":{"line":21,"column":25},"identifierName":"e"}, "name": "e" } } @@ -2746,68 +908,22 @@ "params": [ { "type": "Identifier", - "start": 861, - "end": 862, - "loc": { - "start": { - "line": 21, - "column": 19 - }, - "end": { - "line": 21, - "column": 20 - }, - "identifierName": "d" - }, + "start":861,"end":862,"loc":{"start":{"line":21,"column":19},"end":{"line":21,"column":20},"identifierName":"d"}, "name": "d" } ], "body": { "type": "Identifier", - "start": 871, - "end": 872, - "loc": { - "start": { - "line": 21, - "column": 29 - }, - "end": { - "line": 21, - "column": 30 - }, - "identifierName": "f" - }, + "start":871,"end":872,"loc":{"start":{"line":21,"column":29},"end":{"line":21,"column":30},"identifierName":"f"}, "name": "f" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 857, - "end": 860, - "loc": { - "start": { - "line": 21, - "column": 15 - }, - "end": { - "line": 21, - "column": 18 - } - }, + "start":857,"end":860,"loc":{"start":{"line":21,"column":15},"end":{"line":21,"column":18}}, "params": [ { "type": "TypeParameter", - "start": 858, - "end": 859, - "loc": { - "start": { - "line": 21, - "column": 16 - }, - "end": { - "line": 21, - "column": 17 - } - }, + "start":858,"end":859,"loc":{"start":{"line":21,"column":16},"end":{"line":21,"column":17}}, "name": "T", "variance": null } @@ -2820,143 +936,42 @@ { "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 - } - } + "start":805,"end":841,"loc":{"start":{"line":20,"column":33},"end":{"line":20,"column":69}} } ], "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 - } - } + "start":874,"end":908,"loc":{"start":{"line":21,"column":32},"end":{"line":21,"column":66}} } ] }, { "type": "ExpressionStatement", - "start": 909, - "end": 940, - "loc": { - "start": { - "line": 22, - "column": 0 - }, - "end": { - "line": 22, - "column": 31 - } - }, + "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 - } - }, + "start":909,"end":939,"loc":{"start":{"line":22,"column":0},"end":{"line":22,"column":30}}, "test": { "type": "Identifier", - "start": 909, - "end": 910, - "loc": { - "start": { - "line": 22, - "column": 0 - }, - "end": { - "line": 22, - "column": 1 - }, - "identifierName": "a" - }, + "start":909,"end":910,"loc":{"start":{"line":22,"column":0},"end":{"line":22,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 913, - "end": 930, - "loc": { - "start": { - "line": 22, - "column": 4 - }, - "end": { - "line": 22, - "column": 21 - } - }, + "start":913,"end":930,"loc":{"start":{"line":22,"column":4},"end":{"line":22,"column":21}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 920, - "end": 923, - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 22, - "column": 14 - } - }, + "start":920,"end":923,"loc":{"start":{"line":22,"column":11},"end":{"line":22,"column":14}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 922, - "end": 923, - "loc": { - "start": { - "line": 22, - "column": 13 - }, - "end": { - "line": 22, - "column": 14 - } - }, + "start":922,"end":923,"loc":{"start":{"line":22,"column":13},"end":{"line":22,"column":14}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 922, - "end": 923, - "loc": { - "start": { - "line": 22, - "column": 13 - }, - "end": { - "line": 22, - "column": 14 - }, - "identifierName": "c" - }, + "start":922,"end":923,"loc":{"start":{"line":22,"column":13},"end":{"line":22,"column":14},"identifierName":"c"}, "name": "c" } } @@ -2967,37 +982,13 @@ "params": [ { "type": "Identifier", - "start": 917, - "end": 918, - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 9 - }, - "identifierName": "b" - }, + "start":917,"end":918,"loc":{"start":{"line":22,"column":8},"end":{"line":22,"column":9},"identifierName":"b"}, "name": "b" } ], "body": { "type": "Identifier", - "start": 928, - "end": 929, - "loc": { - "start": { - "line": 22, - "column": 19 - }, - "end": { - "line": 22, - "column": 20 - }, - "identifierName": "d" - }, + "start":928,"end":929,"loc":{"start":{"line":22,"column":19},"end":{"line":22,"column":20},"identifierName":"d"}, "name": "d", "extra": { "parenthesized": true, @@ -3006,33 +997,11 @@ }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 913, - "end": 916, - "loc": { - "start": { - "line": 22, - "column": 4 - }, - "end": { - "line": 22, - "column": 7 - } - }, + "start":913,"end":916,"loc":{"start":{"line":22,"column":4},"end":{"line":22,"column":7}}, "params": [ { "type": "TypeParameter", - "start": 914, - "end": 915, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 6 - } - }, + "start":914,"end":915,"loc":{"start":{"line":22,"column":5},"end":{"line":22,"column":6}}, "name": "T", "variance": null } @@ -3041,55 +1010,20 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 933, - "end": 939, - "loc": { - "start": { - "line": 22, - "column": 24 - }, - "end": { - "line": 22, - "column": 30 - } - }, + "start":933,"end":939,"loc":{"start":{"line":22,"column":24},"end":{"line":22,"column":30}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 933, - "end": 934, - "loc": { - "start": { - "line": 22, - "column": 24 - }, - "end": { - "line": 22, - "column": 25 - }, - "identifierName": "e" - }, + "start":933,"end":934,"loc":{"start":{"line":22,"column":24},"end":{"line":22,"column":25},"identifierName":"e"}, "name": "e" } ], "body": { "type": "Identifier", - "start": 938, - "end": 939, - "loc": { - "start": { - "line": 22, - "column": 29 - }, - "end": { - "line": 22, - "column": 30 - }, - "identifierName": "f" - }, + "start":938,"end":939,"loc":{"start":{"line":22,"column":29},"end":{"line":22,"column":30},"identifierName":"f"}, "name": "f" } } @@ -3098,151 +1032,49 @@ { "type": "CommentLine", "value": " a ? b : (c => ((d): e => f))", - "start": 874, - "end": 908, - "loc": { - "start": { - "line": 21, - "column": 32 - }, - "end": { - "line": 21, - "column": 66 - } - } + "start":874,"end":908,"loc":{"start":{"line":21,"column":32},"end":{"line":21,"column":66}} } ], "trailingComments": [ { "type": "CommentLine", "value": " a ? ((b): c => d) : (e => f)", - "start": 941, - "end": 975, - "loc": { - "start": { - "line": 22, - "column": 32 - }, - "end": { - "line": 22, - "column": 66 - } - } + "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 - } - } + "start":977,"end":1016,"loc":{"start":{"line":24,"column":0},"end":{"line":24,"column":39}} } ] }, { "type": "ExpressionStatement", - "start": 1017, - "end": 1039, - "loc": { - "start": { - "line": 25, - "column": 0 - }, - "end": { - "line": 25, - "column": 22 - } - }, + "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 - } - }, + "start":1017,"end":1038,"loc":{"start":{"line":25,"column":0},"end":{"line":25,"column":21}}, "test": { "type": "Identifier", - "start": 1017, - "end": 1018, - "loc": { - "start": { - "line": 25, - "column": 0 - }, - "end": { - "line": 25, - "column": 1 - }, - "identifierName": "a" - }, + "start":1017,"end":1018,"loc":{"start":{"line":25,"column":0},"end":{"line":25,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 1022, - "end": 1028, - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 11 - } - }, + "start":1022,"end":1028,"loc":{"start":{"line":25,"column":5},"end":{"line":25,"column":11}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1022, - "end": 1023, - "loc": { - "start": { - "line": 25, - "column": 5 - }, - "end": { - "line": 25, - "column": 6 - }, - "identifierName": "b" - }, + "start":1022,"end":1023,"loc":{"start":{"line":25,"column":5},"end":{"line":25,"column":6},"identifierName":"b"}, "name": "b" } ], "body": { "type": "Identifier", - "start": 1027, - "end": 1028, - "loc": { - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 25, - "column": 11 - }, - "identifierName": "c" - }, + "start":1027,"end":1028,"loc":{"start":{"line":25,"column":10},"end":{"line":25,"column":11},"identifierName":"c"}, "name": "c" }, "extra": { @@ -3252,55 +1084,20 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 1032, - "end": 1038, - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 25, - "column": 21 - } - }, + "start":1032,"end":1038,"loc":{"start":{"line":25,"column":15},"end":{"line":25,"column":21}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1032, - "end": 1033, - "loc": { - "start": { - "line": 25, - "column": 15 - }, - "end": { - "line": 25, - "column": 16 - }, - "identifierName": "d" - }, + "start":1032,"end":1033,"loc":{"start":{"line":25,"column":15},"end":{"line":25,"column":16},"identifierName":"d"}, "name": "d" } ], "body": { "type": "Identifier", - "start": 1037, - "end": 1038, - "loc": { - "start": { - "line": 25, - "column": 20 - }, - "end": { - "line": 25, - "column": 21 - }, - "identifierName": "e" - }, + "start":1037,"end":1038,"loc":{"start":{"line":25,"column":20},"end":{"line":25,"column":21},"identifierName":"e"}, "name": "e" } } @@ -3309,182 +1106,57 @@ { "type": "CommentLine", "value": " a ? ((b): c => d) : (e => f)", - "start": 941, - "end": 975, - "loc": { - "start": { - "line": 22, - "column": 32 - }, - "end": { - "line": 22, - "column": 66 - } - } + "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 - } - } + "start":977,"end":1016,"loc":{"start":{"line":24,"column":0},"end":{"line":24,"column":39}} } ], "trailingComments": [ { "type": "CommentLine", "value": " a ? (b => c) : (d => e)", - "start": 1040, - "end": 1066, - "loc": { - "start": { - "line": 25, - "column": 23 - }, - "end": { - "line": 25, - "column": 49 - } - } + "start":1040,"end":1066,"loc":{"start":{"line":25,"column":23},"end":{"line":25,"column":49}} } ] }, { "type": "ExpressionStatement", - "start": 1067, - "end": 1097, - "loc": { - "start": { - "line": 26, - "column": 0 - }, - "end": { - "line": 26, - "column": 30 - } - }, + "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 - } - }, + "start":1067,"end":1096,"loc":{"start":{"line":26,"column":0},"end":{"line":26,"column":29}}, "test": { "type": "Identifier", - "start": 1067, - "end": 1068, - "loc": { - "start": { - "line": 26, - "column": 0 - }, - "end": { - "line": 26, - "column": 1 - }, - "identifierName": "a" - }, + "start":1067,"end":1068,"loc":{"start":{"line":26,"column":0},"end":{"line":26,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ConditionalExpression", - "start": 1071, - "end": 1092, - "loc": { - "start": { - "line": 26, - "column": 4 - }, - "end": { - "line": 26, - "column": 25 - } - }, + "start":1071,"end":1092,"loc":{"start":{"line":26,"column":4},"end":{"line":26,"column":25}}, "test": { "type": "Identifier", - "start": 1071, - "end": 1072, - "loc": { - "start": { - "line": 26, - "column": 4 - }, - "end": { - "line": 26, - "column": 5 - }, - "identifierName": "b" - }, + "start":1071,"end":1072,"loc":{"start":{"line":26,"column":4},"end":{"line":26,"column":5},"identifierName":"b"}, "name": "b" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 1076, - "end": 1082, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 15 - } - }, + "start":1076,"end":1082,"loc":{"start":{"line":26,"column":9},"end":{"line":26,"column":15}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1076, - "end": 1077, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 10 - }, - "identifierName": "c" - }, + "start":1076,"end":1077,"loc":{"start":{"line":26,"column":9},"end":{"line":26,"column":10},"identifierName":"c"}, "name": "c" } ], "body": { "type": "Identifier", - "start": 1081, - "end": 1082, - "loc": { - "start": { - "line": 26, - "column": 14 - }, - "end": { - "line": 26, - "column": 15 - }, - "identifierName": "d" - }, + "start":1081,"end":1082,"loc":{"start":{"line":26,"column":14},"end":{"line":26,"column":15},"identifierName":"d"}, "name": "d" }, "extra": { @@ -3494,74 +1166,27 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 1086, - "end": 1092, - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 25 - } - }, + "start":1086,"end":1092,"loc":{"start":{"line":26,"column":19},"end":{"line":26,"column":25}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1086, - "end": 1087, - "loc": { - "start": { - "line": 26, - "column": 19 - }, - "end": { - "line": 26, - "column": 20 - }, - "identifierName": "e" - }, + "start":1086,"end":1087,"loc":{"start":{"line":26,"column":19},"end":{"line":26,"column":20},"identifierName":"e"}, "name": "e" } ], "body": { "type": "Identifier", - "start": 1091, - "end": 1092, - "loc": { - "start": { - "line": 26, - "column": 24 - }, - "end": { - "line": 26, - "column": 25 - }, - "identifierName": "f" - }, + "start":1091,"end":1092,"loc":{"start":{"line":26,"column":24},"end":{"line":26,"column":25},"identifierName":"f"}, "name": "f" } } }, "alternate": { "type": "Identifier", - "start": 1095, - "end": 1096, - "loc": { - "start": { - "line": 26, - "column": 28 - }, - "end": { - "line": 26, - "column": 29 - }, - "identifierName": "g" - }, + "start":1095,"end":1096,"loc":{"start":{"line":26,"column":28},"end":{"line":26,"column":29},"identifierName":"g"}, "name": "g" } }, @@ -3569,159 +1194,47 @@ { "type": "CommentLine", "value": " a ? (b => c) : (d => e)", - "start": 1040, - "end": 1066, - "loc": { - "start": { - "line": 25, - "column": 23 - }, - "end": { - "line": 25, - "column": 49 - } - } + "start":1040,"end":1066,"loc":{"start":{"line":25,"column":23},"end":{"line":25,"column":49}} } ], "trailingComments": [ { "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 - } - } + "start":1098,"end":1134,"loc":{"start":{"line":26,"column":31},"end":{"line":26,"column":67}} }, { "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 - } - } + "start":1136,"end":1197,"loc":{"start":{"line":28,"column":0},"end":{"line":28,"column":61}} } ] }, { "type": "ExpressionStatement", - "start": 1198, - "end": 1231, - "loc": { - "start": { - "line": 29, - "column": 0 - }, - "end": { - "line": 29, - "column": 33 - } - }, + "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 - } - }, + "start":1198,"end":1230,"loc":{"start":{"line":29,"column":0},"end":{"line":29,"column":32}}, "test": { "type": "Identifier", - "start": 1198, - "end": 1199, - "loc": { - "start": { - "line": 29, - "column": 0 - }, - "end": { - "line": 29, - "column": 1 - }, - "identifierName": "a" - }, + "start":1198,"end":1199,"loc":{"start":{"line":29,"column":0},"end":{"line":29,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 1202, - "end": 1221, - "loc": { - "start": { - "line": 29, - "column": 4 - }, - "end": { - "line": 29, - "column": 23 - } - }, + "start":1202,"end":1221,"loc":{"start":{"line":29,"column":4},"end":{"line":29,"column":23}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 1206, - "end": 1209, - "loc": { - "start": { - "line": 29, - "column": 8 - }, - "end": { - "line": 29, - "column": 11 - } - }, + "start":1206,"end":1209,"loc":{"start":{"line":29,"column":8},"end":{"line":29,"column":11}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 1208, - "end": 1209, - "loc": { - "start": { - "line": 29, - "column": 10 - }, - "end": { - "line": 29, - "column": 11 - } - }, + "start":1208,"end":1209,"loc":{"start":{"line":29,"column":10},"end":{"line":29,"column":11}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 1208, - "end": 1209, - "loc": { - "start": { - "line": 29, - "column": 10 - }, - "end": { - "line": 29, - "column": 11 - }, - "identifierName": "c" - }, + "start":1208,"end":1209,"loc":{"start":{"line":29,"column":10},"end":{"line":29,"column":11},"identifierName":"c"}, "name": "c" } } @@ -3732,73 +1245,26 @@ "params": [ { "type": "Identifier", - "start": 1203, - "end": 1204, - "loc": { - "start": { - "line": 29, - "column": 5 - }, - "end": { - "line": 29, - "column": 6 - }, - "identifierName": "b" - }, + "start":1203,"end":1204,"loc":{"start":{"line":29,"column":5},"end":{"line":29,"column":6},"identifierName":"b"}, "name": "b" } ], "body": { "type": "ArrowFunctionExpression", - "start": 1214, - "end": 1220, - "loc": { - "start": { - "line": 29, - "column": 16 - }, - "end": { - "line": 29, - "column": 22 - } - }, + "start":1214,"end":1220,"loc":{"start":{"line":29,"column":16},"end":{"line":29,"column":22}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1214, - "end": 1215, - "loc": { - "start": { - "line": 29, - "column": 16 - }, - "end": { - "line": 29, - "column": 17 - }, - "identifierName": "d" - }, + "start":1214,"end":1215,"loc":{"start":{"line":29,"column":16},"end":{"line":29,"column":17},"identifierName":"d"}, "name": "d" } ], "body": { "type": "Identifier", - "start": 1219, - "end": 1220, - "loc": { - "start": { - "line": 29, - "column": 21 - }, - "end": { - "line": 29, - "column": 22 - }, - "identifierName": "e" - }, + "start":1219,"end":1220,"loc":{"start":{"line":29,"column":21},"end":{"line":29,"column":22},"identifierName":"e"}, "name": "e" }, "extra": { @@ -3809,55 +1275,20 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 1224, - "end": 1230, - "loc": { - "start": { - "line": 29, - "column": 26 - }, - "end": { - "line": 29, - "column": 32 - } - }, + "start":1224,"end":1230,"loc":{"start":{"line":29,"column":26},"end":{"line":29,"column":32}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1224, - "end": 1225, - "loc": { - "start": { - "line": 29, - "column": 26 - }, - "end": { - "line": 29, - "column": 27 - }, - "identifierName": "f" - }, + "start":1224,"end":1225,"loc":{"start":{"line":29,"column":26},"end":{"line":29,"column":27},"identifierName":"f"}, "name": "f" } ], "body": { "type": "Identifier", - "start": 1229, - "end": 1230, - "loc": { - "start": { - "line": 29, - "column": 31 - }, - "end": { - "line": 29, - "column": 32 - }, - "identifierName": "g" - }, + "start":1229,"end":1230,"loc":{"start":{"line":29,"column":31},"end":{"line":29,"column":32},"identifierName":"g"}, "name": "g" } } @@ -3866,182 +1297,57 @@ { "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 - } - } + "start":1098,"end":1134,"loc":{"start":{"line":26,"column":31},"end":{"line":26,"column":67}} }, { "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 - } - } + "start":1136,"end":1197,"loc":{"start":{"line":28,"column":0},"end":{"line":28,"column":61}} } ], "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 - } - } + "start":1232,"end":1270,"loc":{"start":{"line":29,"column":34},"end":{"line":29,"column":72}} } ] }, { "type": "ExpressionStatement", - "start": 1271, - "end": 1313, - "loc": { - "start": { - "line": 30, - "column": 0 - }, - "end": { - "line": 30, - "column": 42 - } - }, + "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 - } - }, + "start":1271,"end":1312,"loc":{"start":{"line":30,"column":0},"end":{"line":30,"column":41}}, "test": { "type": "Identifier", - "start": 1271, - "end": 1272, - "loc": { - "start": { - "line": 30, - "column": 0 - }, - "end": { - "line": 30, - "column": 1 - }, - "identifierName": "a" - }, + "start":1271,"end":1272,"loc":{"start":{"line":30,"column":0},"end":{"line":30,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ConditionalExpression", - "start": 1275, - "end": 1303, - "loc": { - "start": { - "line": 30, - "column": 4 - }, - "end": { - "line": 30, - "column": 32 - } - }, + "start":1275,"end":1303,"loc":{"start":{"line":30,"column":4},"end":{"line":30,"column":32}}, "test": { "type": "Identifier", - "start": 1275, - "end": 1276, - "loc": { - "start": { - "line": 30, - "column": 4 - }, - "end": { - "line": 30, - "column": 5 - }, - "identifierName": "b" - }, + "start":1275,"end":1276,"loc":{"start":{"line":30,"column":4},"end":{"line":30,"column":5},"identifierName":"b"}, "name": "b" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 1280, - "end": 1286, - "loc": { - "start": { - "line": 30, - "column": 9 - }, - "end": { - "line": 30, - "column": 15 - } - }, + "start":1280,"end":1286,"loc":{"start":{"line":30,"column":9},"end":{"line":30,"column":15}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1280, - "end": 1281, - "loc": { - "start": { - "line": 30, - "column": 9 - }, - "end": { - "line": 30, - "column": 10 - }, - "identifierName": "c" - }, + "start":1280,"end":1281,"loc":{"start":{"line":30,"column":9},"end":{"line":30,"column":10},"identifierName":"c"}, "name": "c" } ], "body": { "type": "Identifier", - "start": 1285, - "end": 1286, - "loc": { - "start": { - "line": 30, - "column": 14 - }, - "end": { - "line": 30, - "column": 15 - }, - "identifierName": "d" - }, + "start":1285,"end":1286,"loc":{"start":{"line":30,"column":14},"end":{"line":30,"column":15},"identifierName":"d"}, "name": "d" }, "extra": { @@ -4051,91 +1357,33 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 1290, - "end": 1303, - "loc": { - "start": { - "line": 30, - "column": 19 - }, - "end": { - "line": 30, - "column": 32 - } - }, + "start":1290,"end":1303,"loc":{"start":{"line":30,"column":19},"end":{"line":30,"column":32}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1290, - "end": 1291, - "loc": { - "start": { - "line": 30, - "column": 19 - }, - "end": { - "line": 30, - "column": 20 - }, - "identifierName": "e" - }, + "start":1290,"end":1291,"loc":{"start":{"line":30,"column":19},"end":{"line":30,"column":20},"identifierName":"e"}, "name": "e" } ], "body": { "type": "ArrowFunctionExpression", - "start": 1296, - "end": 1302, - "loc": { - "start": { - "line": 30, - "column": 25 - }, - "end": { - "line": 30, - "column": 31 - } - }, + "start":1296,"end":1302,"loc":{"start":{"line":30,"column":25},"end":{"line":30,"column":31}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1296, - "end": 1297, - "loc": { - "start": { - "line": 30, - "column": 25 - }, - "end": { - "line": 30, - "column": 26 - }, - "identifierName": "f" - }, + "start":1296,"end":1297,"loc":{"start":{"line":30,"column":25},"end":{"line":30,"column":26},"identifierName":"f"}, "name": "f" } ], "body": { "type": "Identifier", - "start": 1301, - "end": 1302, - "loc": { - "start": { - "line": 30, - "column": 30 - }, - "end": { - "line": 30, - "column": 31 - }, - "identifierName": "g" - }, + "start":1301,"end":1302,"loc":{"start":{"line":30,"column":30},"end":{"line":30,"column":31},"identifierName":"g"}, "name": "g" }, "extra": { @@ -4147,55 +1395,20 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 1306, - "end": 1312, - "loc": { - "start": { - "line": 30, - "column": 35 - }, - "end": { - "line": 30, - "column": 41 - } - }, + "start":1306,"end":1312,"loc":{"start":{"line":30,"column":35},"end":{"line":30,"column":41}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1306, - "end": 1307, - "loc": { - "start": { - "line": 30, - "column": 35 - }, - "end": { - "line": 30, - "column": 36 - }, - "identifierName": "h" - }, + "start":1306,"end":1307,"loc":{"start":{"line":30,"column":35},"end":{"line":30,"column":36},"identifierName":"h"}, "name": "h" } ], "body": { "type": "Identifier", - "start": 1311, - "end": 1312, - "loc": { - "start": { - "line": 30, - "column": 40 - }, - "end": { - "line": 30, - "column": 41 - }, - "identifierName": "i" - }, + "start":1311,"end":1312,"loc":{"start":{"line":30,"column":40},"end":{"line":30,"column":41},"identifierName":"i"}, "name": "i" } } @@ -4204,190 +1417,56 @@ { "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 - } - } + "start":1232,"end":1270,"loc":{"start":{"line":29,"column":34},"end":{"line":29,"column":72}} } ], "trailingComments": [ { "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 - } - } + "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 - } - } + "start":1366,"end":1396,"loc":{"start":{"line":32,"column":0},"end":{"line":32,"column":30}} } ] }, { "type": "ExpressionStatement", - "start": 1397, - "end": 1425, - "loc": { - "start": { - "line": 33, - "column": 0 - }, - "end": { - "line": 33, - "column": 28 - } - }, + "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 - } - }, + "start":1397,"end":1424,"loc":{"start":{"line":33,"column":0},"end":{"line":33,"column":27}}, "test": { "type": "Identifier", - "start": 1397, - "end": 1398, - "loc": { - "start": { - "line": 33, - "column": 0 - }, - "end": { - "line": 33, - "column": 1 - }, - "identifierName": "a" - }, + "start":1397,"end":1398,"loc":{"start":{"line":33,"column":0},"end":{"line":33,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 1401, - "end": 1420, - "loc": { - "start": { - "line": 33, - "column": 4 - }, - "end": { - "line": 33, - "column": 23 - } - }, + "start":1401,"end":1420,"loc":{"start":{"line":33,"column":4},"end":{"line":33,"column":23}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 1405, - "end": 1415, - "loc": { - "start": { - "line": 33, - "column": 8 - }, - "end": { - "line": 33, - "column": 18 - } - }, + "start":1405,"end":1415,"loc":{"start":{"line":33,"column":8},"end":{"line":33,"column":18}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 1408, - "end": 1414, - "loc": { - "start": { - "line": 33, - "column": 11 - }, - "end": { - "line": 33, - "column": 17 - } - }, + "start":1408,"end":1414,"loc":{"start":{"line":33,"column":11},"end":{"line":33,"column":17}}, "params": [ { "type": "FunctionTypeParam", - "start": 1408, - "end": 1412, - "loc": { - "start": { - "line": 33, - "column": 11 - }, - "end": { - "line": 33, - "column": 15 - } - }, + "start":1408,"end":1412,"loc":{"start":{"line":33,"column":11},"end":{"line":33,"column":15}}, "name": null, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 1408, - "end": 1409, - "loc": { - "start": { - "line": 33, - "column": 11 - }, - "end": { - "line": 33, - "column": 12 - } - }, + "start":1408,"end":1409,"loc":{"start":{"line":33,"column":11},"end":{"line":33,"column":12}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 1408, - "end": 1409, - "loc": { - "start": { - "line": 33, - "column": 11 - }, - "end": { - "line": 33, - "column": 12 - }, - "identifierName": "c" - }, + "start":1408,"end":1409,"loc":{"start":{"line":33,"column":11},"end":{"line":33,"column":12},"identifierName":"c"}, "name": "c" } } @@ -4396,34 +1475,11 @@ "rest": null, "returnType": { "type": "GenericTypeAnnotation", - "start": 1413, - "end": 1414, - "loc": { - "start": { - "line": 33, - "column": 16 - }, - "end": { - "line": 33, - "column": 17 - } - }, + "start":1413,"end":1414,"loc":{"start":{"line":33,"column":16},"end":{"line":33,"column":17}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 1413, - "end": 1414, - "loc": { - "start": { - "line": 33, - "column": 16 - }, - "end": { - "line": 33, - "column": 17 - }, - "identifierName": "d" - }, + "start":1413,"end":1414,"loc":{"start":{"line":33,"column":16},"end":{"line":33,"column":17},"identifierName":"d"}, "name": "d" } }, @@ -4436,55 +1492,19 @@ "params": [ { "type": "Identifier", - "start": 1402, - "end": 1403, - "loc": { - "start": { - "line": 33, - "column": 5 - }, - "end": { - "line": 33, - "column": 6 - }, - "identifierName": "b" - }, + "start":1402,"end":1403,"loc":{"start":{"line":33,"column":5},"end":{"line":33,"column":6},"identifierName":"b"}, "name": "b" } ], "body": { "type": "Identifier", - "start": 1419, - "end": 1420, - "loc": { - "start": { - "line": 33, - "column": 22 - }, - "end": { - "line": 33, - "column": 23 - }, - "identifierName": "e" - }, + "start":1419,"end":1420,"loc":{"start":{"line":33,"column":22},"end":{"line":33,"column":23},"identifierName":"e"}, "name": "e" } }, "alternate": { "type": "Identifier", - "start": 1423, - "end": 1424, - "loc": { - "start": { - "line": 33, - "column": 26 - }, - "end": { - "line": 33, - "column": 27 - }, - "identifierName": "f" - }, + "start":1423,"end":1424,"loc":{"start":{"line":33,"column":26},"end":{"line":33,"column":27},"identifierName":"f"}, "name": "f" } }, @@ -4492,218 +1512,70 @@ { "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 - } - } + "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 - } - } + "start":1366,"end":1396,"loc":{"start":{"line":32,"column":0},"end":{"line":32,"column":30}} } ], "trailingComments": [ { "type": "CommentLine", "value": " a ? ((b): (c => d) => e) : f", - "start": 1426, - "end": 1457, - "loc": { - "start": { - "line": 33, - "column": 29 - }, - "end": { - "line": 33, - "column": 60 - } - } + "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 - } - } + "start":1459,"end":1486,"loc":{"start":{"line":35,"column":0},"end":{"line":35,"column":27}} } ] }, { "type": "ExpressionStatement", - "start": 1487, - "end": 1510, - "loc": { - "start": { - "line": 36, - "column": 0 - }, - "end": { - "line": 36, - "column": 23 - } - }, + "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 - } - }, + "start":1487,"end":1509,"loc":{"start":{"line":36,"column":0},"end":{"line":36,"column":22}}, "test": { "type": "Identifier", - "start": 1487, - "end": 1488, - "loc": { - "start": { - "line": 36, - "column": 0 - }, - "end": { - "line": 36, - "column": 1 - }, - "identifierName": "a" - }, + "start":1487,"end":1488,"loc":{"start":{"line":36,"column":0},"end":{"line":36,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "CallExpression", - "start": 1491, - "end": 1500, - "loc": { - "start": { - "line": 36, - "column": 4 - }, - "end": { - "line": 36, - "column": 13 - } - }, + "start":1491,"end":1500,"loc":{"start":{"line":36,"column":4},"end":{"line":36,"column":13}}, "callee": { "type": "Identifier", - "start": 1491, - "end": 1496, - "loc": { - "start": { - "line": 36, - "column": 4 - }, - "end": { - "line": 36, - "column": 9 - }, - "identifierName": "async" - }, + "start":1491,"end":1496,"loc":{"start":{"line":36,"column":4},"end":{"line":36,"column":9},"identifierName":"async"}, "name": "async" }, "arguments": [ { "type": "Identifier", - "start": 1498, - "end": 1499, - "loc": { - "start": { - "line": 36, - "column": 11 - }, - "end": { - "line": 36, - "column": 12 - }, - "identifierName": "b" - }, + "start":1498,"end":1499,"loc":{"start":{"line":36,"column":11},"end":{"line":36,"column":12},"identifierName":"b"}, "name": "b" } ] }, "alternate": { "type": "ArrowFunctionExpression", - "start": 1503, - "end": 1509, - "loc": { - "start": { - "line": 36, - "column": 16 - }, - "end": { - "line": 36, - "column": 22 - } - }, + "start":1503,"end":1509,"loc":{"start":{"line":36,"column":16},"end":{"line":36,"column":22}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1503, - "end": 1504, - "loc": { - "start": { - "line": 36, - "column": 16 - }, - "end": { - "line": 36, - "column": 17 - }, - "identifierName": "c" - }, + "start":1503,"end":1504,"loc":{"start":{"line":36,"column":16},"end":{"line":36,"column":17},"identifierName":"c"}, "name": "c" } ], "body": { "type": "Identifier", - "start": 1508, - "end": 1509, - "loc": { - "start": { - "line": 36, - "column": 21 - }, - "end": { - "line": 36, - "column": 22 - }, - "identifierName": "d" - }, + "start":1508,"end":1509,"loc":{"start":{"line":36,"column":21},"end":{"line":36,"column":22},"identifierName":"d"}, "name": "d" } } @@ -4712,158 +1584,46 @@ { "type": "CommentLine", "value": " a ? ((b): (c => d) => e) : f", - "start": 1426, - "end": 1457, - "loc": { - "start": { - "line": 33, - "column": 29 - }, - "end": { - "line": 33, - "column": 60 - } - } + "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 - } - } + "start":1459,"end":1486,"loc":{"start":{"line":35,"column":0},"end":{"line":35,"column":27}} } ], "trailingComments": [ { "type": "CommentLine", "value": " a ? (async(b)) : (c => d)", - "start": 1511, - "end": 1539, - "loc": { - "start": { - "line": 36, - "column": 24 - }, - "end": { - "line": 36, - "column": 52 - } - } + "start":1511,"end":1539,"loc":{"start":{"line":36,"column":24},"end":{"line":36,"column":52}} } ] }, { "type": "ExpressionStatement", - "start": 1540, - "end": 1567, - "loc": { - "start": { - "line": 37, - "column": 0 - }, - "end": { - "line": 37, - "column": 27 - } - }, + "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 - } - }, + "start":1540,"end":1566,"loc":{"start":{"line":37,"column":0},"end":{"line":37,"column":26}}, "test": { "type": "Identifier", - "start": 1540, - "end": 1541, - "loc": { - "start": { - "line": 37, - "column": 0 - }, - "end": { - "line": 37, - "column": 1 - }, - "identifierName": "a" - }, + "start":1540,"end":1541,"loc":{"start":{"line":37,"column":0},"end":{"line":37,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 1544, - "end": 1562, - "loc": { - "start": { - "line": 37, - "column": 4 - }, - "end": { - "line": 37, - "column": 22 - } - }, + "start":1544,"end":1562,"loc":{"start":{"line":37,"column":4},"end":{"line":37,"column":22}}, "returnType": { "type": "TypeAnnotation", - "start": 1554, - "end": 1557, - "loc": { - "start": { - "line": 37, - "column": 14 - }, - "end": { - "line": 37, - "column": 17 - } - }, + "start":1554,"end":1557,"loc":{"start":{"line":37,"column":14},"end":{"line":37,"column":17}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 1556, - "end": 1557, - "loc": { - "start": { - "line": 37, - "column": 16 - }, - "end": { - "line": 37, - "column": 17 - } - }, + "start":1556,"end":1557,"loc":{"start":{"line":37,"column":16},"end":{"line":37,"column":17}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 1556, - "end": 1557, - "loc": { - "start": { - "line": 37, - "column": 16 - }, - "end": { - "line": 37, - "column": 17 - }, - "identifierName": "c" - }, + "start":1556,"end":1557,"loc":{"start":{"line":37,"column":16},"end":{"line":37,"column":17},"identifierName":"c"}, "name": "c" } } @@ -4874,55 +1634,19 @@ "params": [ { "type": "Identifier", - "start": 1551, - "end": 1552, - "loc": { - "start": { - "line": 37, - "column": 11 - }, - "end": { - "line": 37, - "column": 12 - }, - "identifierName": "b" - }, + "start":1551,"end":1552,"loc":{"start":{"line":37,"column":11},"end":{"line":37,"column":12},"identifierName":"b"}, "name": "b" } ], "body": { "type": "Identifier", - "start": 1561, - "end": 1562, - "loc": { - "start": { - "line": 37, - "column": 21 - }, - "end": { - "line": 37, - "column": 22 - }, - "identifierName": "d" - }, + "start":1561,"end":1562,"loc":{"start":{"line":37,"column":21},"end":{"line":37,"column":22},"identifierName":"d"}, "name": "d" } }, "alternate": { "type": "Identifier", - "start": 1565, - "end": 1566, - "loc": { - "start": { - "line": 37, - "column": 25 - }, - "end": { - "line": 37, - "column": 26 - }, - "identifierName": "e" - }, + "start":1565,"end":1566,"loc":{"start":{"line":37,"column":25},"end":{"line":37,"column":26},"identifierName":"e"}, "name": "e" } }, @@ -4930,167 +1654,53 @@ { "type": "CommentLine", "value": " a ? (async(b)) : (c => d)", - "start": 1511, - "end": 1539, - "loc": { - "start": { - "line": 36, - "column": 24 - }, - "end": { - "line": 36, - "column": 52 - } - } + "start":1511,"end":1539,"loc":{"start":{"line":36,"column":24},"end":{"line":36,"column":52}} } ], "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 - } - } + "start":1568,"end":1598,"loc":{"start":{"line":37,"column":28},"end":{"line":37,"column":58}} } ] }, { "type": "ExpressionStatement", - "start": 1599, - "end": 1627, - "loc": { - "start": { - "line": 38, - "column": 0 - }, - "end": { - "line": 38, - "column": 28 - } - }, + "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 - } - }, + "start":1599,"end":1626,"loc":{"start":{"line":38,"column":0},"end":{"line":38,"column":27}}, "test": { "type": "Identifier", - "start": 1599, - "end": 1600, - "loc": { - "start": { - "line": 38, - "column": 0 - }, - "end": { - "line": 38, - "column": 1 - }, - "identifierName": "a" - }, + "start":1599,"end":1600,"loc":{"start":{"line":38,"column":0},"end":{"line":38,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "CallExpression", - "start": 1603, - "end": 1617, - "loc": { - "start": { - "line": 38, - "column": 4 - }, - "end": { - "line": 38, - "column": 18 - } - }, + "start":1603,"end":1617,"loc":{"start":{"line":38,"column":4},"end":{"line":38,"column":18}}, "callee": { "type": "Identifier", - "start": 1603, - "end": 1608, - "loc": { - "start": { - "line": 38, - "column": 4 - }, - "end": { - "line": 38, - "column": 9 - }, - "identifierName": "async" - }, + "start":1603,"end":1608,"loc":{"start":{"line":38,"column":4},"end":{"line":38,"column":9},"identifierName":"async"}, "name": "async" }, "arguments": [ { "type": "ArrowFunctionExpression", - "start": 1610, - "end": 1616, - "loc": { - "start": { - "line": 38, - "column": 11 - }, - "end": { - "line": 38, - "column": 17 - } - }, + "start":1610,"end":1616,"loc":{"start":{"line":38,"column":11},"end":{"line":38,"column":17}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1610, - "end": 1611, - "loc": { - "start": { - "line": 38, - "column": 11 - }, - "end": { - "line": 38, - "column": 12 - }, - "identifierName": "b" - }, + "start":1610,"end":1611,"loc":{"start":{"line":38,"column":11},"end":{"line":38,"column":12},"identifierName":"b"}, "name": "b" } ], "body": { "type": "Identifier", - "start": 1615, - "end": 1616, - "loc": { - "start": { - "line": 38, - "column": 16 - }, - "end": { - "line": 38, - "column": 17 - }, - "identifierName": "c" - }, + "start":1615,"end":1616,"loc":{"start":{"line":38,"column":16},"end":{"line":38,"column":17},"identifierName":"c"}, "name": "c" } } @@ -5098,55 +1708,20 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 1620, - "end": 1626, - "loc": { - "start": { - "line": 38, - "column": 21 - }, - "end": { - "line": 38, - "column": 27 - } - }, + "start":1620,"end":1626,"loc":{"start":{"line":38,"column":21},"end":{"line":38,"column":27}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1620, - "end": 1621, - "loc": { - "start": { - "line": 38, - "column": 21 - }, - "end": { - "line": 38, - "column": 22 - }, - "identifierName": "d" - }, + "start":1620,"end":1621,"loc":{"start":{"line":38,"column":21},"end":{"line":38,"column":22},"identifierName":"d"}, "name": "d" } ], "body": { "type": "Identifier", - "start": 1625, - "end": 1626, - "loc": { - "start": { - "line": 38, - "column": 26 - }, - "end": { - "line": 38, - "column": 27 - }, - "identifierName": "e" - }, + "start":1625,"end":1626,"loc":{"start":{"line":38,"column":26},"end":{"line":38,"column":27},"identifierName":"e"}, "name": "e" } } @@ -5155,171 +1730,57 @@ { "type": "CommentLine", "value": " a ? (async (b): c => d) : e", - "start": 1568, - "end": 1598, - "loc": { - "start": { - "line": 37, - "column": 28 - }, - "end": { - "line": 37, - "column": 58 - } - } + "start":1568,"end":1598,"loc":{"start":{"line":37,"column":28},"end":{"line":37,"column":58}} } ], "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 - } - } + "start":1628,"end":1661,"loc":{"start":{"line":38,"column":29},"end":{"line":38,"column":62}} } ] }, { "type": "ExpressionStatement", - "start": 1662, - "end": 1697, - "loc": { - "start": { - "line": 39, - "column": 0 - }, - "end": { - "line": 39, - "column": 35 - } - }, + "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 - } - }, + "start":1662,"end":1696,"loc":{"start":{"line":39,"column":0},"end":{"line":39,"column":34}}, "test": { "type": "Identifier", - "start": 1662, - "end": 1663, - "loc": { - "start": { - "line": 39, - "column": 0 - }, - "end": { - "line": 39, - "column": 1 - }, - "identifierName": "a" - }, + "start":1662,"end":1663,"loc":{"start":{"line":39,"column":0},"end":{"line":39,"column":1},"identifierName":"a"}, "name": "a" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 1666, - "end": 1687, - "loc": { - "start": { - "line": 39, - "column": 4 - }, - "end": { - "line": 39, - "column": 25 - } - }, + "start":1666,"end":1687,"loc":{"start":{"line":39,"column":4},"end":{"line":39,"column":25}}, "id": null, "generator": false, "async": true, "params": [ { "type": "Identifier", - "start": 1673, - "end": 1674, - "loc": { - "start": { - "line": 39, - "column": 11 - }, - "end": { - "line": 39, - "column": 12 - }, - "identifierName": "b" - }, + "start":1673,"end":1674,"loc":{"start":{"line":39,"column":11},"end":{"line":39,"column":12},"identifierName":"b"}, "name": "b" } ], "body": { "type": "ArrowFunctionExpression", - "start": 1680, - "end": 1686, - "loc": { - "start": { - "line": 39, - "column": 18 - }, - "end": { - "line": 39, - "column": 24 - } - }, + "start":1680,"end":1686,"loc":{"start":{"line":39,"column":18},"end":{"line":39,"column":24}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1680, - "end": 1681, - "loc": { - "start": { - "line": 39, - "column": 18 - }, - "end": { - "line": 39, - "column": 19 - }, - "identifierName": "c" - }, + "start":1680,"end":1681,"loc":{"start":{"line":39,"column":18},"end":{"line":39,"column":19},"identifierName":"c"}, "name": "c" } ], "body": { "type": "Identifier", - "start": 1685, - "end": 1686, - "loc": { - "start": { - "line": 39, - "column": 23 - }, - "end": { - "line": 39, - "column": 24 - }, - "identifierName": "d" - }, + "start":1685,"end":1686,"loc":{"start":{"line":39,"column":23},"end":{"line":39,"column":24},"identifierName":"d"}, "name": "d" }, "extra": { @@ -5330,55 +1791,20 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 1690, - "end": 1696, - "loc": { - "start": { - "line": 39, - "column": 28 - }, - "end": { - "line": 39, - "column": 34 - } - }, + "start":1690,"end":1696,"loc":{"start":{"line":39,"column":28},"end":{"line":39,"column":34}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1690, - "end": 1691, - "loc": { - "start": { - "line": 39, - "column": 28 - }, - "end": { - "line": 39, - "column": 29 - }, - "identifierName": "e" - }, + "start":1690,"end":1691,"loc":{"start":{"line":39,"column":28},"end":{"line":39,"column":29},"identifierName":"e"}, "name": "e" } ], "body": { "type": "Identifier", - "start": 1695, - "end": 1696, - "loc": { - "start": { - "line": 39, - "column": 33 - }, - "end": { - "line": 39, - "column": 34 - }, - "identifierName": "f" - }, + "start":1695,"end":1696,"loc":{"start":{"line":39,"column":33},"end":{"line":39,"column":34},"identifierName":"f"}, "name": "f" } } @@ -5387,161 +1813,49 @@ { "type": "CommentLine", "value": " a ? (async(b => c)) : (d => e)", - "start": 1628, - "end": 1661, - "loc": { - "start": { - "line": 38, - "column": 29 - }, - "end": { - "line": 38, - "column": 62 - } - } + "start":1628,"end":1661,"loc":{"start":{"line":38,"column":29},"end":{"line":38,"column":62}} } ], "trailingComments": [ { "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 - } - } + "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 - } - } + "start":1739,"end":1790,"loc":{"start":{"line":41,"column":0},"end":{"line":41,"column":51}} } ] }, { "type": "VariableDeclaration", - "start": 1791, - "end": 1930, - "loc": { - "start": { - "line": 42, - "column": 0 - }, - "end": { - "line": 44, - "column": 36 - } - }, + "start":1791,"end":1930,"loc":{"start":{"line":42,"column":0},"end":{"line":44,"column":36}}, "declarations": [ { "type": "VariableDeclarator", - "start": 1795, - "end": 1929, - "loc": { - "start": { - "line": 42, - "column": 4 - }, - "end": { - "line": 44, - "column": 35 - } - }, + "start":1795,"end":1929,"loc":{"start":{"line":42,"column":4},"end":{"line":44,"column":35}}, "id": { "type": "Identifier", - "start": 1795, - "end": 1803, - "loc": { - "start": { - "line": 42, - "column": 4 - }, - "end": { - "line": 42, - "column": 12 - }, - "identifierName": "icecream" - }, + "start":1795,"end":1803,"loc":{"start":{"line":42,"column":4},"end":{"line":42,"column":12},"identifierName":"icecream"}, "name": "icecream" }, "init": { "type": "ConditionalExpression", - "start": 1806, - "end": 1929, - "loc": { - "start": { - "line": 42, - "column": 15 - }, - "end": { - "line": 44, - "column": 35 - } - }, + "start":1806,"end":1929,"loc":{"start":{"line":42,"column":15},"end":{"line":44,"column":35}}, "test": { "type": "BinaryExpression", - "start": 1806, - "end": 1820, - "loc": { - "start": { - "line": 42, - "column": 15 - }, - "end": { - "line": 42, - "column": 29 - } - }, + "start":1806,"end":1820,"loc":{"start":{"line":42,"column":15},"end":{"line":42,"column":29}}, "left": { "type": "Identifier", - "start": 1806, - "end": 1810, - "loc": { - "start": { - "line": 42, - "column": 15 - }, - "end": { - "line": 42, - "column": 19 - }, - "identifierName": "what" - }, + "start":1806,"end":1810,"loc":{"start":{"line":42,"column":15},"end":{"line":42,"column":19},"identifierName":"what"}, "name": "what" }, "operator": "==", "right": { "type": "StringLiteral", - "start": 1814, - "end": 1820, - "loc": { - "start": { - "line": 42, - "column": 23 - }, - "end": { - "line": 42, - "column": 29 - } - }, + "start":1814,"end":1820,"loc":{"start":{"line":42,"column":23},"end":{"line":42,"column":29}}, "extra": { "rawValue": "cone", "raw": "\"cone\"" @@ -5551,153 +1865,51 @@ }, "consequent": { "type": "ArrowFunctionExpression", - "start": 1825, - "end": 1893, - "loc": { - "start": { - "line": 43, - "column": 4 - }, - "end": { - "line": 43, - "column": 72 - } - }, + "start":1825,"end":1893,"loc":{"start":{"line":43,"column":4},"end":{"line":43,"column":72}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1825, - "end": 1826, - "loc": { - "start": { - "line": 43, - "column": 4 - }, - "end": { - "line": 43, - "column": 5 - }, - "identifierName": "p" - }, + "start":1825,"end":1826,"loc":{"start":{"line":43,"column":4},"end":{"line":43,"column":5},"identifierName":"p"}, "name": "p" } ], "body": { "type": "ConditionalExpression", - "start": 1831, - "end": 1892, - "loc": { - "start": { - "line": 43, - "column": 10 - }, - "end": { - "line": 43, - "column": 71 - } - }, + "start":1831,"end":1892,"loc":{"start":{"line":43,"column":10},"end":{"line":43,"column":71}}, "test": { "type": "UnaryExpression", - "start": 1831, - "end": 1834, - "loc": { - "start": { - "line": 43, - "column": 10 - }, - "end": { - "line": 43, - "column": 13 - } - }, + "start":1831,"end":1834,"loc":{"start":{"line":43,"column":10},"end":{"line":43,"column":13}}, "operator": "!", "prefix": true, "argument": { "type": "UnaryExpression", - "start": 1832, - "end": 1834, - "loc": { - "start": { - "line": 43, - "column": 11 - }, - "end": { - "line": 43, - "column": 13 - } - }, + "start":1832,"end":1834,"loc":{"start":{"line":43,"column":11},"end":{"line":43,"column":13}}, "operator": "!", "prefix": true, "argument": { "type": "Identifier", - "start": 1833, - "end": 1834, - "loc": { - "start": { - "line": 43, - "column": 12 - }, - "end": { - "line": 43, - "column": 13 - }, - "identifierName": "p" - }, + "start":1833,"end":1834,"loc":{"start":{"line":43,"column":12},"end":{"line":43,"column":13},"identifierName":"p"}, "name": "p" } } }, "consequent": { "type": "TemplateLiteral", - "start": 1837, - "end": 1860, - "loc": { - "start": { - "line": 43, - "column": 16 - }, - "end": { - "line": 43, - "column": 39 - } - }, + "start":1837,"end":1860,"loc":{"start":{"line":43,"column":16},"end":{"line":43,"column":39}}, "expressions": [ { "type": "Identifier", - "start": 1852, - "end": 1853, - "loc": { - "start": { - "line": 43, - "column": 31 - }, - "end": { - "line": 43, - "column": 32 - }, - "identifierName": "p" - }, + "start":1852,"end":1853,"loc":{"start":{"line":43,"column":31},"end":{"line":43,"column":32},"identifierName":"p"}, "name": "p" } ], "quasis": [ { "type": "TemplateElement", - "start": 1838, - "end": 1850, - "loc": { - "start": { - "line": 43, - "column": 17 - }, - "end": { - "line": 43, - "column": 29 - } - }, + "start":1838,"end":1850,"loc":{"start":{"line":43,"column":17},"end":{"line":43,"column":29}}, "value": { "raw": "here's your ", "cooked": "here's your " @@ -5706,18 +1918,7 @@ }, { "type": "TemplateElement", - "start": 1854, - "end": 1859, - "loc": { - "start": { - "line": 43, - "column": 33 - }, - "end": { - "line": 43, - "column": 38 - } - }, + "start":1854,"end":1859,"loc":{"start":{"line":43,"column":33},"end":{"line":43,"column":38}}, "value": { "raw": " cone", "cooked": " cone" @@ -5728,34 +1929,12 @@ }, "alternate": { "type": "TemplateLiteral", - "start": 1863, - "end": 1892, - "loc": { - "start": { - "line": 43, - "column": 42 - }, - "end": { - "line": 43, - "column": 71 - } - }, + "start":1863,"end":1892,"loc":{"start":{"line":43,"column":42},"end":{"line":43,"column":71}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 1864, - "end": 1891, - "loc": { - "start": { - "line": 43, - "column": 43 - }, - "end": { - "line": 43, - "column": 70 - } - }, + "start":1864,"end":1891,"loc":{"start":{"line":43,"column":43},"end":{"line":43,"column":70}}, "value": { "raw": "just the empty cone for you", "cooked": "just the empty cone for you" @@ -5772,105 +1951,36 @@ }, "alternate": { "type": "ArrowFunctionExpression", - "start": 1898, - "end": 1929, - "loc": { - "start": { - "line": 44, - "column": 4 - }, - "end": { - "line": 44, - "column": 35 - } - }, + "start":1898,"end":1929,"loc":{"start":{"line":44,"column":4},"end":{"line":44,"column":35}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 1898, - "end": 1899, - "loc": { - "start": { - "line": 44, - "column": 4 - }, - "end": { - "line": 44, - "column": 5 - }, - "identifierName": "p" - }, + "start":1898,"end":1899,"loc":{"start":{"line":44,"column":4},"end":{"line":44,"column":5},"identifierName":"p"}, "name": "p" } ], "body": { "type": "TemplateLiteral", - "start": 1903, - "end": 1929, - "loc": { - "start": { - "line": 44, - "column": 9 - }, - "end": { - "line": 44, - "column": 35 - } - }, + "start":1903,"end":1929,"loc":{"start":{"line":44,"column":9},"end":{"line":44,"column":35}}, "expressions": [ { "type": "Identifier", - "start": 1918, - "end": 1919, - "loc": { - "start": { - "line": 44, - "column": 24 - }, - "end": { - "line": 44, - "column": 25 - }, - "identifierName": "p" - }, + "start":1918,"end":1919,"loc":{"start":{"line":44,"column":24},"end":{"line":44,"column":25},"identifierName":"p"}, "name": "p" }, { "type": "Identifier", - "start": 1923, - "end": 1927, - "loc": { - "start": { - "line": 44, - "column": 29 - }, - "end": { - "line": 44, - "column": 33 - }, - "identifierName": "what" - }, + "start":1923,"end":1927,"loc":{"start":{"line":44,"column":29},"end":{"line":44,"column":33},"identifierName":"what"}, "name": "what" } ], "quasis": [ { "type": "TemplateElement", - "start": 1904, - "end": 1916, - "loc": { - "start": { - "line": 44, - "column": 10 - }, - "end": { - "line": 44, - "column": 22 - } - }, + "start":1904,"end":1916,"loc":{"start":{"line":44,"column":10},"end":{"line":44,"column":22}}, "value": { "raw": "here's your ", "cooked": "here's your " @@ -5879,18 +1989,7 @@ }, { "type": "TemplateElement", - "start": 1920, - "end": 1921, - "loc": { - "start": { - "line": 44, - "column": 26 - }, - "end": { - "line": 44, - "column": 27 - } - }, + "start":1920,"end":1921,"loc":{"start":{"line":44,"column":26},"end":{"line":44,"column":27}}, "value": { "raw": " ", "cooked": " " @@ -5899,18 +1998,7 @@ }, { "type": "TemplateElement", - "start": 1928, - "end": 1928, - "loc": { - "start": { - "line": 44, - "column": 34 - }, - "end": { - "line": 44, - "column": 34 - } - }, + "start":1928,"end":1928,"loc":{"start":{"line":44,"column":34},"end":{"line":44,"column":34}}, "value": { "raw": "", "cooked": "" @@ -5928,34 +2016,12 @@ { "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 - } - } + "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 - } - } + "start":1739,"end":1790,"loc":{"start":{"line":41,"column":0},"end":{"line":41,"column":51}} } ] } @@ -5966,498 +2032,157 @@ { "type": "CommentLine", "value": " Valid lhs value inside parentheses", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}} }, { "type": "CommentLine", "value": " a ? b : (c => d)", - "start": 56, - "end": 75, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 37 - } - } + "start":56,"end":75,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":37}} }, { "type": "CommentLine", "value": " a ? ((b): c => d) : e", - "start": 98, - "end": 122, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 46 - } - } + "start":98,"end":122,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":46}} }, { "type": "CommentLine", "value": " a ? b : ((c): d => e)", - "start": 147, - "end": 171, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 48 - } - } + "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 - } - } + "start":173,"end":216,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":43}} }, { "type": "CommentLine", "value": " a ? (b = (c) => d) : (e => f)", - "start": 246, - "end": 278, - "loc": { - "start": { - "line": 7, - "column": 29 - }, - "end": { - "line": 7, - "column": 61 - } - } + "start":246,"end":278,"loc":{"start":{"line":7,"column":29},"end":{"line":7,"column":61}} }, { "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 - } - } + "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 - } - } + "start":349,"end":382,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":33}} }, { "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 - } - } + "start":419,"end":453,"loc":{"start":{"line":11,"column":36},"end":{"line":11,"column":70}} }, { "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 - } - } + "start":490,"end":529,"loc":{"start":{"line":12,"column":36},"end":{"line":12,"column":75}} }, { "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 - } - } + "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 - } - } + "start":601,"end":628,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":27}} }, { "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 - } - } + "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 - } - } + "start":700,"end":771,"loc":{"start":{"line":19,"column":0},"end":{"line":19,"column":71}} }, { "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 - } - } + "start":805,"end":841,"loc":{"start":{"line":20,"column":33},"end":{"line":20,"column":69}} }, { "type": "CommentLine", "value": " a ? b : (c => ((d): e => f))", - "start": 874, - "end": 908, - "loc": { - "start": { - "line": 21, - "column": 32 - }, - "end": { - "line": 21, - "column": 66 - } - } + "start":874,"end":908,"loc":{"start":{"line":21,"column":32},"end":{"line":21,"column":66}} }, { "type": "CommentLine", "value": " a ? ((b): c => d) : (e => f)", - "start": 941, - "end": 975, - "loc": { - "start": { - "line": 22, - "column": 32 - }, - "end": { - "line": 22, - "column": 66 - } - } + "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 - } - } + "start":977,"end":1016,"loc":{"start":{"line":24,"column":0},"end":{"line":24,"column":39}} }, { "type": "CommentLine", "value": " a ? (b => c) : (d => e)", - "start": 1040, - "end": 1066, - "loc": { - "start": { - "line": 25, - "column": 23 - }, - "end": { - "line": 25, - "column": 49 - } - } + "start":1040,"end":1066,"loc":{"start":{"line":25,"column":23},"end":{"line":25,"column":49}} }, { "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 - } - } + "start":1098,"end":1134,"loc":{"start":{"line":26,"column":31},"end":{"line":26,"column":67}} }, { "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 - } - } + "start":1136,"end":1197,"loc":{"start":{"line":28,"column":0},"end":{"line":28,"column":61}} }, { "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 - } - } + "start":1232,"end":1270,"loc":{"start":{"line":29,"column":34},"end":{"line":29,"column":72}} }, { "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 - } - } + "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 - } - } + "start":1366,"end":1396,"loc":{"start":{"line":32,"column":0},"end":{"line":32,"column":30}} }, { "type": "CommentLine", "value": " a ? ((b): (c => d) => e) : f", - "start": 1426, - "end": 1457, - "loc": { - "start": { - "line": 33, - "column": 29 - }, - "end": { - "line": 33, - "column": 60 - } - } + "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 - } - } + "start":1459,"end":1486,"loc":{"start":{"line":35,"column":0},"end":{"line":35,"column":27}} }, { "type": "CommentLine", "value": " a ? (async(b)) : (c => d)", - "start": 1511, - "end": 1539, - "loc": { - "start": { - "line": 36, - "column": 24 - }, - "end": { - "line": 36, - "column": 52 - } - } + "start":1511,"end":1539,"loc":{"start":{"line":36,"column":24},"end":{"line":36,"column":52}} }, { "type": "CommentLine", "value": " a ? (async (b): c => d) : e", - "start": 1568, - "end": 1598, - "loc": { - "start": { - "line": 37, - "column": 28 - }, - "end": { - "line": 37, - "column": 58 - } - } + "start":1568,"end":1598,"loc":{"start":{"line":37,"column":28},"end":{"line":37,"column":58}} }, { "type": "CommentLine", "value": " a ? (async(b => c)) : (d => e)", - "start": 1628, - "end": 1661, - "loc": { - "start": { - "line": 38, - "column": 29 - }, - "end": { - "line": 38, - "column": 62 - } - } + "start":1628,"end":1661,"loc":{"start":{"line":38,"column":29},"end":{"line":38,"column":62}} }, { "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 - } - } + "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 - } - } + "start":1739,"end":1790,"loc":{"start":{"line":41,"column":0},"end":{"line":41,"column":51}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-593/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-593/output.json index db7856dd3f..e7bc479248 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-593/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-593/output.json @@ -1,139 +1,38 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":6,"end":27,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "fail" - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10},"identifierName":"fail"}, "name": "fail" }, "init": { "type": "ArrowFunctionExpression", - "start": 13, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":13,"end":27,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":27}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "X" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"X"}, "name": "X" } } @@ -144,49 +43,16 @@ "params": [], "body": { "type": "JSXElement", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27}}, "openingElement": { "type": "JSXOpeningElement", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "attributes": [], + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27}}, "name": { "type": "JSXIdentifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "name": "x" }, + "attributes": [], "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/flow/regression/issue-92/output.json b/packages/babel-parser/test/fixtures/flow/regression/issue-92/output.json index 6088c82682..8eb0830187 100644 --- a/packages/babel-parser/test/fixtures/flow/regression/issue-92/output.json +++ b/packages/babel-parser/test/fixtures/flow/regression/issue-92/output.json @@ -1,173 +1,50 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":6,"end":40,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":40}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":10,"end":40,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":40}}, "id": null, "generator": false, "async": true, "params": [ { "type": "AssignmentPattern", - "start": 17, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":17,"end":33,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":33}}, "left": { "type": "Identifier", - "start": 17, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "foo" - }, + "start":17,"end":28,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":28},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TypeAnnotation", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":22,"end":28,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":28}} } } }, "right": { "type": "StringLiteral", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "extra": { "rawValue": "", "raw": "\"\"" @@ -178,18 +55,7 @@ ], "body": { "type": "BlockStatement", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":38,"end":40,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":40}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/scope/abcdef/output.json b/packages/babel-parser/test/fixtures/flow/scope/abcdef/output.json index e743dd0477..a30af7f2bb 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/abcdef/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/abcdef/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,163 +20,51 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":13,"end":73,"loc":{"start":{"line":1,"column":13},"end":{"line":5,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 17, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":17,"end":50,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":35}}, "declarations": [ { "type": "VariableDeclarator", - "start": 23, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":23,"end":49,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":34}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "g" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"g"}, "name": "g" }, "init": { "type": "ConditionalExpression", - "start": 27, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":27,"end":49,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":34}}, "test": { "type": "BooleanLiteral", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":27,"end":31,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":16}}, "value": true }, "consequent": { "type": "ArrowFunctionExpression", - "start": 34, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":34,"end":43,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":28}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "foo" - }, + "start":34,"end":37,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":22},"identifierName":"foo"}, "name": "foo" } ], "body": { "type": "BlockStatement", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":41,"end":43,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":28}}, "body": [], "directives": [] } }, "alternate": { "type": "NullLiteral", - "start": 45, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 34 - } - } + "start":45,"end":49,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":34}} } } } @@ -230,64 +73,19 @@ }, { "type": "VariableDeclaration", - "start": 54, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 19 - } - }, + "start":54,"end":71,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 60, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 19 - } - }, + "start":60,"end":71,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":19}}, "id": { "type": "Identifier", - "start": 60, - "end": 63, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 11 - }, - "identifierName": "foo" - }, + "start":60,"end":63,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":11},"identifierName":"foo"}, "name": "foo" }, "init": { "type": "StringLiteral", - "start": 66, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 19 - } - }, + "start":66,"end":71,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":19}}, "extra": { "rawValue": "foo", "raw": "'foo'" diff --git a/packages/babel-parser/test/fixtures/flow/scope/declare-module/output.json b/packages/babel-parser/test/fixtures/flow/scope/declare-module/output.json index 672f98d0ad..3315087c3d 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/declare-module/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/declare-module/output.json @@ -1,109 +1,30 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareModule", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "A" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"A"}, "name": "A" }, "body": { "type": "BlockStatement", - "start": 17, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":17,"end":41,"loc":{"start":{"line":1,"column":17},"end":{"line":3,"column":1}}, "body": [ { "type": "DeclareClass", - "start": 21, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":21,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "id": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "X" - }, + "start":35,"end":36,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"X"}, "name": "X" }, "typeParameters": null, @@ -112,18 +33,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":37,"end":39,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}}, "callProperties": [], "properties": [], "indexers": [], @@ -137,50 +47,16 @@ }, { "type": "ClassDeclaration", - "start": 43, - "end": 53, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":43,"end":53,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":10}}, "id": { "type": "Identifier", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 7 - }, - "identifierName": "X" - }, + "start":49,"end":50,"loc":{"start":{"line":5,"column":6},"end":{"line":5,"column":7},"identifierName":"X"}, "name": "X" }, "superClass": null, "body": { "type": "ClassBody", - "start": 51, - "end": 53, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":51,"end":53,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":10}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json index a5fb057eb1..c3c7f880bf 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-class/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:14)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "id": { "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" }, "init": { "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" @@ -104,33 +37,10 @@ }, { "type": "DeclareClass", - "start": 13, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":13,"end":31,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "A" - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -139,18 +49,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/output.json index 93ec46f9bc..24563be730 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-declare-interface/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:18)" ], "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "id": { "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" }, "init": { "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" @@ -104,33 +37,10 @@ }, { "type": "DeclareInterface", - "start": 13, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":13,"end":35,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, "id": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "A" - }, + "start":31,"end":32,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -139,18 +49,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":33,"end":35,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":22}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/output.json index 9de1cc4338..b687d17111 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-interface/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:10)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "id": { "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" }, "init": { "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" @@ -104,33 +37,10 @@ }, { "type": "InterfaceDeclaration", - "start": 13, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":13,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "A" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -139,18 +49,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":25,"end":27,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/output.json index 7b807528c3..baeda3cb81 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-opaque-type/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:12)" ], "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "id": { "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" }, "init": { "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" @@ -104,51 +37,17 @@ }, { "type": "OpaqueType", - "start": 13, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":13,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "id": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "A" - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "supertype": null, "impltype": { "type": "ObjectTypeAnnotation", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/output.json index a69cbb049a..efef580046 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-const-type/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11}}, "id": { "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" }, "init": { "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" @@ -104,50 +37,16 @@ }, { "type": "TypeAlias", - "start": 13, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":13,"end":25,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "A" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-class/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-class/output.json index 25358ef97a..01a9ab8538 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-class/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-class/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -66,18 +21,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "callProperties": [], "properties": [], "indexers": [], @@ -87,33 +31,10 @@ }, { "type": "DeclareClass", - "start": 19, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":19,"end":37,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "A" - }, + "start":33,"end":34,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -122,18 +43,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":35,"end":37,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/output.json index a5e92908c5..33e3c98521 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-class-declare-interface/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:18)" ], "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -69,18 +24,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "callProperties": [], "properties": [], "indexers": [], @@ -90,33 +34,10 @@ }, { "type": "DeclareInterface", - "start": 19, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":19,"end":41,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "A" - }, + "start":37,"end":38,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -125,18 +46,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":39,"end":41,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":22}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-func/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-func/output.json index c4c86f1991..de9cd47bb3 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-func/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-func/output.json @@ -1,109 +1,31 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareFunction", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "A" - }, + "start":17,"end":26,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":26},"identifierName":"A"}, "name": "A", "typeAnnotation": { "type": "TypeAnnotation", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "typeParameters": null, "params": [], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 26 - } - } + "start":22,"end":26,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":26}} } } } @@ -112,79 +34,23 @@ }, { "type": "DeclareFunction", - "start": 28, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":28,"end":55,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}}, "id": { "type": "Identifier", - "start": 45, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 26 - }, - "identifierName": "A" - }, + "start":45,"end":54,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":26},"identifierName":"A"}, "name": "A", "typeAnnotation": { "type": "TypeAnnotation", - "start": 46, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":46,"end":54,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":26}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 46, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":46,"end":54,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":26}}, "typeParameters": null, "params": [], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 50, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 26 - } - } + "start":50,"end":54,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":26}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-var/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-var/output.json index 5e5c135d59..27ab9b95ad 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-var/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-declare-var/output.json @@ -1,109 +1,31 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareFunction", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "A" - }, + "start":17,"end":26,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":26},"identifierName":"A"}, "name": "A", "typeAnnotation": { "type": "TypeAnnotation", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "typeParameters": null, "params": [], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 26 - } - } + "start":22,"end":26,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":26}} } } } @@ -112,62 +34,17 @@ }, { "type": "DeclareVariable", - "start": 28, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":28,"end":50,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, "id": { "type": "Identifier", - "start": 40, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 21 - }, - "identifierName": "A" - }, + "start":40,"end":49,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":21},"identifierName":"A"}, "name": "A", "typeAnnotation": { "type": "TypeAnnotation", - "start": 41, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":41,"end":49,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":21}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 43, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 21 - } - } + "start":43,"end":49,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":21}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/output.json index 44114ec359..6895d0b4ef 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-func-func/output.json @@ -1,109 +1,31 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareFunction", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "A" - }, + "start":17,"end":26,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":26},"identifierName":"A"}, "name": "A", "typeAnnotation": { "type": "TypeAnnotation", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "typeParameters": null, "params": [], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 26 - } - } + "start":22,"end":26,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":26}} } } } @@ -112,33 +34,10 @@ }, { "type": "FunctionDeclaration", - "start": 28, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":28,"end":43,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "A" - }, + "start":37,"end":38,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"A"}, "name": "A" }, "generator": false, @@ -146,18 +45,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":41,"end":43,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/output.json index b2a4c51e2b..555f58649c 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-interface-declare-class/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:14)" ], "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareInterface", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "A" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -69,18 +24,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "callProperties": [], "properties": [], "indexers": [], @@ -90,33 +34,10 @@ }, { "type": "DeclareClass", - "start": 23, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":23,"end":41,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "A" - }, + "start":37,"end":38,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -125,18 +46,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":39,"end":41,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-declare-var/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-declare-var/output.json index 532ca8848c..d034848f85 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-declare-var/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-declare-var/output.json @@ -1,154 +1,42 @@ { "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareVariable", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 12, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "A" - }, + "start":12,"end":21,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":21},"identifierName":"A"}, "name": "A", "typeAnnotation": { "type": "TypeAnnotation", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}} } } } }, { "type": "DeclareVariable", - "start": 23, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":23,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, "id": { "type": "Identifier", - "start": 35, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 21 - }, - "identifierName": "A" - }, + "start":35,"end":44,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":21},"identifierName":"A"}, "name": "A", "typeAnnotation": { "type": "TypeAnnotation", - "start": 36, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":36,"end":44,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":21}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 38, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 21 - } - } + "start":38,"end":44,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":21}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/output.json index 8389c568e8..dd8f7d4acb 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-declare-var-let/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:4)" ], "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareVariable", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 12, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "A" - }, + "start":12,"end":21,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":21},"identifierName":"A"}, "name": "A", "typeAnnotation": { "type": "TypeAnnotation", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}} } } } }, { "type": "VariableDeclaration", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":23,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "declarations": [ { "type": "VariableDeclarator", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "A" - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"A"}, "name": "A" }, "init": null diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/output.json index d79d846383..4f2b265c88 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-interface-interface/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:10)" ], "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -69,18 +24,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "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}}, "callProperties": [], "properties": [], "indexers": [], @@ -90,33 +34,10 @@ }, { "type": "InterfaceDeclaration", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":15,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "A" - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -125,18 +46,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":27,"end":29,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/output.json index 2dbdc1e727..d1e848e459 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-class/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:14)" ], "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "A" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"A"}, "name": "A" }, "init": { "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": 1, "raw": "1" @@ -104,33 +37,10 @@ }, { "type": "DeclareClass", - "start": 11, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":11,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "A" - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -139,18 +49,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":27,"end":29,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/output.json index a13ba7dc08..6a4433ea75 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-declare-interface/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:18)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "A" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"A"}, "name": "A" }, "init": { "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": 1, "raw": "1" @@ -104,33 +37,10 @@ }, { "type": "DeclareInterface", - "start": 11, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":11,"end":33,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "A" - }, + "start":29,"end":30,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -139,18 +49,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":31,"end":33,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":22}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/output.json index a8dc40e08d..d102313ba8 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-interface/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:10)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "A" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"A"}, "name": "A" }, "init": { "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": 1, "raw": "1" @@ -104,33 +37,10 @@ }, { "type": "InterfaceDeclaration", - "start": 11, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":11,"end":25,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "A" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -139,18 +49,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/output.json index 07a5a53fbc..085f418b8d 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-opaque-type/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:12)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "A" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"A"}, "name": "A" }, "init": { "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": 1, "raw": "1" @@ -104,51 +37,17 @@ }, { "type": "OpaqueType", - "start": 11, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":11,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "A" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "supertype": null, "impltype": { "type": "ObjectTypeAnnotation", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":27,"end":29,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/output.json index 6833e37c4d..4f7bdf0cd2 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-let-type/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "A" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"A"}, "name": "A" }, "init": { "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": 1, "raw": "1" @@ -104,50 +37,16 @@ }, { "type": "TypeAlias", - "start": 11, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":11,"end":23,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "A" - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":20,"end":22,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/output.json index b374e2bceb..b68fa59284 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-const/output.json @@ -1,84 +1,28 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "OpaqueType", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "A" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "supertype": null, "impltype": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "callProperties": [], "properties": [], "indexers": [], @@ -89,64 +33,19 @@ }, { "type": "VariableDeclaration", - "start": 20, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":20,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":26,"end":31,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "A" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"A"}, "name": "A" }, "init": { "type": "NumericLiteral", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":30,"end":31,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/output.json index 9f326dfe3e..00382a7d0f 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-let/output.json @@ -1,84 +1,28 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:4)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "OpaqueType", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "A" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "supertype": null, "impltype": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "callProperties": [], "properties": [], "indexers": [], @@ -89,64 +33,19 @@ }, { "type": "VariableDeclaration", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":20,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":24,"end":29,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "A" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"A"}, "name": "A" }, "init": { "type": "NumericLiteral", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/output.json index 86b98af150..bbcc52e79f 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-opaque-type/output.json @@ -1,84 +1,28 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:12)" ], "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "OpaqueType", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "A" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "supertype": null, "impltype": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "callProperties": [], "properties": [], "indexers": [], @@ -89,51 +33,17 @@ }, { "type": "OpaqueType", - "start": 20, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":20,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "id": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "A" - }, + "start":32,"end":33,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "supertype": null, "impltype": { "type": "ObjectTypeAnnotation", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":36,"end":38,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/output.json index 76300249f5..ae77d22a53 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-type/output.json @@ -1,84 +1,28 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "OpaqueType", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "A" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "supertype": null, "impltype": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "callProperties": [], "properties": [], "indexers": [], @@ -89,50 +33,16 @@ }, { "type": "TypeAlias", - "start": 20, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":20,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "id": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "A" - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/output.json index b5b462a59c..fcfa4d8505 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-opaque-type-var/output.json @@ -1,84 +1,28 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:4)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "OpaqueType", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "A" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "supertype": null, "impltype": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "callProperties": [], "properties": [], "indexers": [], @@ -89,64 +33,19 @@ }, { "type": "VariableDeclaration", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":20,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":24,"end":29,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "A" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"A"}, "name": "A" }, "init": { "type": "NumericLiteral", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/output.json index 916e60eaa9..6170eb332b 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-const/output.json @@ -1,83 +1,27 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "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}}, "callProperties": [], "properties": [], "indexers": [], @@ -88,64 +32,19 @@ }, { "type": "VariableDeclaration", - "start": 13, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":13,"end":25,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":24,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "A" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"A"}, "name": "A" }, "init": { "type": "NumericLiteral", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/output.json index 0aa57e51c3..017c30dec6 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-interface/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:10)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "NumberTypeAnnotation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } }, { "type": "InterfaceDeclaration", - "start": 17, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":17,"end":31,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "A" - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -117,18 +38,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/output.json index 6e394ffbcd..33397a54dd 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-let/output.json @@ -1,83 +1,27 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:4)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "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}}, "callProperties": [], "properties": [], "indexers": [], @@ -88,64 +32,19 @@ }, { "type": "VariableDeclaration", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":13,"end":23,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":17,"end":22,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "A" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"A"}, "name": "A" }, "init": { "type": "NumericLiteral", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/output.json index 95d0b22f7c..13e009e688 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-opaque-type/output.json @@ -1,83 +1,27 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:12)" ], "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "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}}, "callProperties": [], "properties": [], "indexers": [], @@ -88,51 +32,17 @@ }, { "type": "OpaqueType", - "start": 13, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":13,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "id": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "A" - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "supertype": null, "impltype": { "type": "ObjectTypeAnnotation", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/output.json index 09c73482f8..b6c3a2ed34 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-type/output.json @@ -1,83 +1,27 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "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}}, "callProperties": [], "properties": [], "indexers": [], @@ -88,50 +32,16 @@ }, { "type": "TypeAlias", - "start": 13, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":13,"end":25,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "A" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/output.json index 52626b852e..31719046a5 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-type-var/output.json @@ -1,83 +1,27 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:4)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "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}}, "callProperties": [], "properties": [], "indexers": [], @@ -88,64 +32,19 @@ }, { "type": "VariableDeclaration", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":13,"end":23,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "declarations": [ { "type": "VariableDeclarator", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":17,"end":22,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "A" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"A"}, "name": "A" }, "init": { "type": "NumericLiteral", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/output.json index f60940e178..0dbab3e68b 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-declare-interface/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:18)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "A" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"A"}, "name": "A" }, "init": { "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": 1, "raw": "1" @@ -104,33 +37,10 @@ }, { "type": "DeclareInterface", - "start": 11, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":11,"end":33,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "A" - }, + "start":29,"end":30,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -139,18 +49,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":31,"end":33,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":22}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/output.json index 271c66e47d..80e7ca6b69 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-interface/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:10)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "A" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"A"}, "name": "A" }, "init": { "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": 1, "raw": "1" @@ -104,33 +37,10 @@ }, { "type": "InterfaceDeclaration", - "start": 11, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":11,"end":25,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "A" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -139,18 +49,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/output.json index d41f91a9d9..22d33f3427 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-opaque-type/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:12)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "A" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"A"}, "name": "A" }, "init": { "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": 1, "raw": "1" @@ -104,51 +37,17 @@ }, { "type": "OpaqueType", - "start": 11, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":11,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "A" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "supertype": null, "impltype": { "type": "ObjectTypeAnnotation", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":27,"end":29,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/output.json b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/output.json index 4f1dcc1359..749d355f7d 100644 --- a/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/scope/dupl-decl-var-type/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "A" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"A"}, "name": "A" }, "init": { "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": 1, "raw": "1" @@ -104,50 +37,16 @@ }, { "type": "TypeAlias", - "start": 11, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":11,"end":23,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "A" - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":20,"end":22,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/sourcetype-script/export-named/output.json b/packages/babel-parser/test/fixtures/flow/sourcetype-script/export-named/output.json index 70d30bbe8a..3a91cdcabb 100644 --- a/packages/babel-parser/test/fixtures/flow/sourcetype-script/export-named/output.json +++ b/packages/babel-parser/test/fixtures/flow/sourcetype-script/export-named/output.json @@ -1,164 +1,52 @@ { "type": "File", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [], "source": null, "exportKind": "type", "declaration": { "type": "TypeAlias", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "Foo" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"Foo"}, "name": "Foo" }, "typeParameters": null, "right": { "type": "NumberTypeAnnotation", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}} } } }, { "type": "ExportNamedDeclaration", - "start": 26, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":26,"end":59,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":33}}, "specifiers": [], "source": null, "exportKind": "type", "declaration": { "type": "OpaqueType", - "start": 33, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":33,"end":59,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":33}}, "id": { "type": "Identifier", - "start": 45, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "Foo2" - }, + "start":45,"end":49,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":23},"identifierName":"Foo2"}, "name": "Foo2" }, "typeParameters": null, "supertype": null, "impltype": { "type": "NumberTypeAnnotation", - "start": 52, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 32 - } - } + "start":52,"end":58,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":32}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/sourcetype-script/export-star/output.json b/packages/babel-parser/test/fixtures/flow/sourcetype-script/export-star/output.json index 13fe2cfaec..9f02c833e5 100644 --- a/packages/babel-parser/test/fixtures/flow/sourcetype-script/export-star/output.json +++ b/packages/babel-parser/test/fixtures/flow/sourcetype-script/export-star/output.json @@ -1,63 +1,19 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExportAllDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "exportKind": "type", "source": { "type": "StringLiteral", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/flow/sourcetype-script/import/output.json b/packages/babel-parser/test/fixtures/flow/sourcetype-script/import/output.json index d49e3470ff..54d736943f 100644 --- a/packages/babel-parser/test/fixtures/flow/sourcetype-script/import/output.json +++ b/packages/babel-parser/test/fixtures/flow/sourcetype-script/import/output.json @@ -1,96 +1,28 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "imported": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "Foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"Foo"}, "name": "Foo" }, "importKind": null, "local": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "Foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"Foo"}, "name": "Foo" } } @@ -98,18 +30,7 @@ "importKind": "type", "source": { "type": "StringLiteral", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "extra": { "rawValue": "", "raw": "\"\"" @@ -119,48 +40,14 @@ }, { "type": "ImportDeclaration", - "start": 29, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":29,"end":56,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 43, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":43,"end":47,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":18}}, "local": { "type": "Identifier", - "start": 43, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "Foo2" - }, + "start":43,"end":47,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":18},"identifierName":"Foo2"}, "name": "Foo2" } } @@ -168,18 +55,7 @@ "importKind": "typeof", "source": { "type": "StringLiteral", - "start": 53, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":53,"end":55,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":26}}, "extra": { "rawValue": "", "raw": "\"\"" diff --git a/packages/babel-parser/test/fixtures/flow/trailing-function-commas-type/1/output.json b/packages/babel-parser/test/fixtures/flow/trailing-function-commas-type/1/output.json index 02498cad1b..2ab57d3caf 100644 --- a/packages/babel-parser/test/fixtures/flow/trailing-function-commas-type/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/trailing-function-commas-type/1/output.json @@ -1,107 +1,29 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 21, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":23,"end":33,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":33}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "ReturnType" - }, + "start":23,"end":33,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":33},"identifierName":"ReturnType"}, "name": "ReturnType" } } @@ -112,64 +34,18 @@ "params": [ { "type": "Identifier", - "start": 2, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "props" - }, + "start":2,"end":17,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":17},"identifierName":"props"}, "name": "props", "typeAnnotation": { "type": "TypeAnnotation", - "start": 7, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":7,"end":17,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "SomeType" - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"SomeType"}, "name": "SomeType" } } @@ -178,18 +54,7 @@ ], "body": { "type": "NumericLiteral", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40}}, "extra": { "rawValue": 3, "raw": "3", diff --git a/packages/babel-parser/test/fixtures/flow/tuples/1/output.json b/packages/babel-parser/test/fixtures/flow/tuples/1/output.json index 29c44707cd..b5884b3446 100644 --- a/packages/babel-parser/test/fixtures/flow/tuples/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/tuples/1/output.json @@ -1,125 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":6,"end":10,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":10}}, "typeAnnotation": { "type": "TupleTypeAnnotation", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "types": [] } } }, "init": { "type": "ArrayExpression", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "elements": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/tuples/2/output.json b/packages/babel-parser/test/fixtures/flow/tuples/2/output.json index 599c27a964..6b85017fd2 100644 --- a/packages/babel-parser/test/fixtures/flow/tuples/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/tuples/2/output.json @@ -1,167 +1,44 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":6,"end":16,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":16}}, "typeAnnotation": { "type": "TupleTypeAnnotation", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "types": [ { "type": "GenericTypeAnnotation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15}}, "params": [ { "type": "GenericTypeAnnotation", - "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}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"T"}, "name": "T" } } @@ -169,19 +46,7 @@ }, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "Foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"Foo"}, "name": "Foo" } } @@ -191,34 +56,11 @@ }, "init": { "type": "ArrayExpression", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "elements": [ { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23},"identifierName":"foo"}, "name": "foo" } ] diff --git a/packages/babel-parser/test/fixtures/flow/tuples/3/output.json b/packages/babel-parser/test/fixtures/flow/tuples/3/output.json index dada487fe1..b7690d15c2 100644 --- a/packages/babel-parser/test/fixtures/flow/tuples/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/tuples/3/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":4,"end":26,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":26}}, "id": { "type": "Identifier", - "start": 4, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":4,"end":17,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":6,"end":17,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "TupleTypeAnnotation", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17}}, "types": [ { "type": "NumberTypeAnnotation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } ] } @@ -124,43 +35,21 @@ }, "init": { "type": "ArrayExpression", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26}}, + "extra": { + "trailingComma": 24 }, "elements": [ { "type": "NumericLiteral", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24}}, "extra": { "rawValue": 123, "raw": "123" }, "value": 123 } - ], - "extra": { - "trailingComma": 24 - } + ] } } ], diff --git a/packages/babel-parser/test/fixtures/flow/tuples/4/output.json b/packages/babel-parser/test/fixtures/flow/tuples/4/output.json index fd42e0453f..63abf8d6cf 100644 --- a/packages/babel-parser/test/fixtures/flow/tuples/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/tuples/4/output.json @@ -1,137 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":4,"end":40,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":40}}, "id": { "type": "Identifier", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "a" - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":6,"end":24,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":24}}, "typeAnnotation": { "type": "TupleTypeAnnotation", - "start": 8, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":8,"end":24,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":24}}, "types": [ { "type": "NumberTypeAnnotation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} }, { "type": "StringTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} } ] } @@ -139,33 +39,11 @@ }, "init": { "type": "ArrayExpression", - "start": 27, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":27,"end":40,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":40}}, "elements": [ { "type": "NumericLiteral", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":28,"end":31,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":31}}, "extra": { "rawValue": 123, "raw": "123" @@ -174,18 +52,7 @@ }, { "type": "StringLiteral", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":33,"end":39,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":39}}, "extra": { "rawValue": "duck", "raw": "\"duck\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-alias/1/output.json b/packages/babel-parser/test/fixtures/flow/type-alias/1/output.json index e7e01aff77..f12a90e7d0 100644 --- a/packages/babel-parser/test/fixtures/flow/type-alias/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-alias/1/output.json @@ -1,80 +1,24 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "FBID" - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9},"identifierName":"FBID"}, "name": "FBID" }, "typeParameters": null, "right": { "type": "NumberTypeAnnotation", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}} } } ], diff --git a/packages/babel-parser/test/fixtures/flow/type-alias/2/output.json b/packages/babel-parser/test/fixtures/flow/type-alias/2/output.json index b7b8d201d0..6877b15e5f 100644 --- a/packages/babel-parser/test/fixtures/flow/type-alias/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-alias/2/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "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" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "params": [ { "type": "TypeParameter", - "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}}, "name": "T", "variance": null } @@ -96,63 +29,18 @@ }, "right": { "type": "GenericTypeAnnotation", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "T" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"T"}, "name": "T" } } @@ -160,19 +48,7 @@ }, "id": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "Bar" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"Bar"}, "name": "Bar" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-alias/3/output.json b/packages/babel-parser/test/fixtures/flow/type-alias/3/output.json index 1c1fe95023..869c689c86 100644 --- a/packages/babel-parser/test/fixtures/flow/type-alias/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-alias/3/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [], "source": null, "exportKind": "type", "declaration": { "type": "TypeAlias", - "start": 7, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":7,"end":25,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "Foo" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"Foo"}, "name": "Foo" }, "typeParameters": null, "right": { "type": "NumberTypeAnnotation", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/type-alias/4/output.json b/packages/babel-parser/test/fixtures/flow/type-alias/4/output.json index a1ff7e2786..8592d1737f 100644 --- a/packages/babel-parser/test/fixtures/flow/type-alias/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-alias/4/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 246, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 21, - "column": 2 - } - }, + "start":0,"end":246,"loc":{"start":{"line":1,"column":0},"end":{"line":21,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 246, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 21, - "column": 2 - } - }, + "start":0,"end":246,"loc":{"start":{"line":1,"column":0},"end":{"line":21,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "union" - }, + "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10},"identifierName":"union"}, "name": "union" }, "typeParameters": null, "right": { "type": "UnionTypeAnnotation", - "start": 14, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":14,"end":42,"loc":{"start":{"line":2,"column":1},"end":{"line":3,"column":14}}, "types": [ { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":16,"end":27,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":14}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":17,"end":26,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":13}}, "key": { "type": "Identifier", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "type" - }, + "start":17,"end":21,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":8},"identifierName":"type"}, "name": "type" }, "static": false, @@ -129,18 +39,7 @@ "method": false, "value": { "type": "StringLiteralTypeAnnotation", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":23,"end":26,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13}}, "extra": { "rawValue": "A", "raw": "\"A\"" @@ -158,49 +57,15 @@ }, { "type": "ObjectTypeAnnotation", - "start": 31, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":31,"end":42,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":14}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":32,"end":41,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13}}, "key": { "type": "Identifier", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "type" - }, + "start":32,"end":36,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":8},"identifierName":"type"}, "name": "type" }, "static": false, @@ -209,18 +74,7 @@ "method": false, "value": { "type": "StringLiteralTypeAnnotation", - "start": 38, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":38,"end":41,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":13}}, "extra": { "rawValue": "B", "raw": "\"B\"" @@ -241,212 +95,66 @@ }, { "type": "TypeAlias", - "start": 46, - "end": 120, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":46,"end":120,"loc":{"start":{"line":6,"column":0},"end":{"line":9,"column":1}}, "id": { "type": "Identifier", - "start": 51, - "end": 60, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 14 - }, - "identifierName": "overloads" - }, + "start":51,"end":60,"loc":{"start":{"line":6,"column":5},"end":{"line":6,"column":14},"identifierName":"overloads"}, "name": "overloads" }, "typeParameters": null, "right": { "type": "IntersectionTypeAnnotation", - "start": 65, - "end": 118, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 8, - "column": 27 - } - }, + "start":65,"end":118,"loc":{"start":{"line":7,"column":2},"end":{"line":8,"column":27}}, "types": [ { "type": "FunctionTypeAnnotation", - "start": 68, - "end": 89, - "loc": { - "start": { - "line": 7, - "column": 5 - }, - "end": { - "line": 7, - "column": 26 - } - }, + "start":68,"end":89,"loc":{"start":{"line":7,"column":5},"end":{"line":7,"column":26}}, "params": [ { "type": "FunctionTypeParam", - "start": 69, - "end": 78, - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 15 - } - }, + "start":69,"end":78,"loc":{"start":{"line":7,"column":6},"end":{"line":7,"column":15}}, "name": { "type": "Identifier", - "start": 69, - "end": 70, - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 7 - }, - "identifierName": "x" - }, + "start":69,"end":70,"loc":{"start":{"line":7,"column":6},"end":{"line":7,"column":7},"identifierName":"x"}, "name": "x" }, "optional": false, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 72, - "end": 78, - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 15 - } - } + "start":72,"end":78,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":15}} } } ], "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 83, - "end": 89, - "loc": { - "start": { - "line": 7, - "column": 20 - }, - "end": { - "line": 7, - "column": 26 - } - } + "start":83,"end":89,"loc":{"start":{"line":7,"column":20},"end":{"line":7,"column":26}} }, "typeParameters": null }, { "type": "FunctionTypeAnnotation", - "start": 96, - "end": 117, - "loc": { - "start": { - "line": 8, - "column": 5 - }, - "end": { - "line": 8, - "column": 26 - } - }, + "start":96,"end":117,"loc":{"start":{"line":8,"column":5},"end":{"line":8,"column":26}}, "params": [ { "type": "FunctionTypeParam", - "start": 97, - "end": 106, - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 15 - } - }, + "start":97,"end":106,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":15}}, "name": { "type": "Identifier", - "start": 97, - "end": 98, - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 7 - }, - "identifierName": "x" - }, + "start":97,"end":98,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":7},"identifierName":"x"}, "name": "x" }, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 100, - "end": 106, - "loc": { - "start": { - "line": 8, - "column": 9 - }, - "end": { - "line": 8, - "column": 15 - } - } + "start":100,"end":106,"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":15}} } } ], "rest": null, "returnType": { "type": "StringTypeAnnotation", - "start": 111, - "end": 117, - "loc": { - "start": { - "line": 8, - "column": 20 - }, - "end": { - "line": 8, - "column": 26 - } - } + "start":111,"end":117,"loc":{"start":{"line":8,"column":20},"end":{"line":8,"column":26}} }, "typeParameters": null } @@ -455,81 +163,24 @@ }, { "type": "TypeAlias", - "start": 122, - "end": 181, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 15, - "column": 2 - } - }, + "start":122,"end":181,"loc":{"start":{"line":11,"column":0},"end":{"line":15,"column":2}}, "id": { "type": "Identifier", - "start": 127, - "end": 133, - "loc": { - "start": { - "line": 11, - "column": 5 - }, - "end": { - "line": 11, - "column": 11 - }, - "identifierName": "union2" - }, + "start":127,"end":133,"loc":{"start":{"line":11,"column":5},"end":{"line":11,"column":11},"identifierName":"union2"}, "name": "union2" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 136, - "end": 180, - "loc": { - "start": { - "line": 11, - "column": 14 - }, - "end": { - "line": 15, - "column": 1 - } - }, + "start":136,"end":180,"loc":{"start":{"line":11,"column":14},"end":{"line":15,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 140, - "end": 178, - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 14, - "column": 17 - } - }, + "start":140,"end":178,"loc":{"start":{"line":12,"column":2},"end":{"line":14,"column":17}}, "key": { "type": "Identifier", - "start": 140, - "end": 141, - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 12, - "column": 3 - }, - "identifierName": "x" - }, + "start":140,"end":141,"loc":{"start":{"line":12,"column":2},"end":{"line":12,"column":3},"identifierName":"x"}, "name": "x" }, "static": false, @@ -538,64 +189,19 @@ "method": false, "value": { "type": "UnionTypeAnnotation", - "start": 147, - "end": 178, - "loc": { - "start": { - "line": 13, - "column": 4 - }, - "end": { - "line": 14, - "column": 17 - } - }, + "start":147,"end":178,"loc":{"start":{"line":13,"column":4},"end":{"line":14,"column":17}}, "types": [ { "type": "ObjectTypeAnnotation", - "start": 149, - "end": 160, - "loc": { - "start": { - "line": 13, - "column": 6 - }, - "end": { - "line": 13, - "column": 17 - } - }, + "start":149,"end":160,"loc":{"start":{"line":13,"column":6},"end":{"line":13,"column":17}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 150, - "end": 159, - "loc": { - "start": { - "line": 13, - "column": 7 - }, - "end": { - "line": 13, - "column": 16 - } - }, + "start":150,"end":159,"loc":{"start":{"line":13,"column":7},"end":{"line":13,"column":16}}, "key": { "type": "Identifier", - "start": 150, - "end": 154, - "loc": { - "start": { - "line": 13, - "column": 7 - }, - "end": { - "line": 13, - "column": 11 - }, - "identifierName": "type" - }, + "start":150,"end":154,"loc":{"start":{"line":13,"column":7},"end":{"line":13,"column":11},"identifierName":"type"}, "name": "type" }, "static": false, @@ -604,18 +210,7 @@ "method": false, "value": { "type": "StringLiteralTypeAnnotation", - "start": 156, - "end": 159, - "loc": { - "start": { - "line": 13, - "column": 13 - }, - "end": { - "line": 13, - "column": 16 - } - }, + "start":156,"end":159,"loc":{"start":{"line":13,"column":13},"end":{"line":13,"column":16}}, "extra": { "rawValue": "A", "raw": "\"A\"" @@ -633,49 +228,15 @@ }, { "type": "ObjectTypeAnnotation", - "start": 167, - "end": 178, - "loc": { - "start": { - "line": 14, - "column": 6 - }, - "end": { - "line": 14, - "column": 17 - } - }, + "start":167,"end":178,"loc":{"start":{"line":14,"column":6},"end":{"line":14,"column":17}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 168, - "end": 177, - "loc": { - "start": { - "line": 14, - "column": 7 - }, - "end": { - "line": 14, - "column": 16 - } - }, + "start":168,"end":177,"loc":{"start":{"line":14,"column":7},"end":{"line":14,"column":16}}, "key": { "type": "Identifier", - "start": 168, - "end": 172, - "loc": { - "start": { - "line": 14, - "column": 7 - }, - "end": { - "line": 14, - "column": 11 - }, - "identifierName": "type" - }, + "start":168,"end":172,"loc":{"start":{"line":14,"column":7},"end":{"line":14,"column":11},"identifierName":"type"}, "name": "type" }, "static": false, @@ -684,18 +245,7 @@ "method": false, "value": { "type": "StringLiteralTypeAnnotation", - "start": 174, - "end": 177, - "loc": { - "start": { - "line": 14, - "column": 13 - }, - "end": { - "line": 14, - "column": 16 - } - }, + "start":174,"end":177,"loc":{"start":{"line":14,"column":13},"end":{"line":14,"column":16}}, "extra": { "rawValue": "B", "raw": "\"B\"" @@ -725,81 +275,24 @@ }, { "type": "TypeAlias", - "start": 183, - "end": 246, - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 21, - "column": 2 - } - }, + "start":183,"end":246,"loc":{"start":{"line":17,"column":0},"end":{"line":21,"column":2}}, "id": { "type": "Identifier", - "start": 188, - "end": 198, - "loc": { - "start": { - "line": 17, - "column": 5 - }, - "end": { - "line": 17, - "column": 15 - }, - "identifierName": "overloads2" - }, + "start":188,"end":198,"loc":{"start":{"line":17,"column":5},"end":{"line":17,"column":15},"identifierName":"overloads2"}, "name": "overloads2" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 201, - "end": 245, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 21, - "column": 1 - } - }, + "start":201,"end":245,"loc":{"start":{"line":17,"column":18},"end":{"line":21,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 205, - "end": 243, - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 20, - "column": 17 - } - }, + "start":205,"end":243,"loc":{"start":{"line":18,"column":2},"end":{"line":20,"column":17}}, "key": { "type": "Identifier", - "start": 205, - "end": 206, - "loc": { - "start": { - "line": 18, - "column": 2 - }, - "end": { - "line": 18, - "column": 3 - }, - "identifierName": "x" - }, + "start":205,"end":206,"loc":{"start":{"line":18,"column":2},"end":{"line":18,"column":3},"identifierName":"x"}, "name": "x" }, "static": false, @@ -808,64 +301,19 @@ "method": false, "value": { "type": "IntersectionTypeAnnotation", - "start": 212, - "end": 243, - "loc": { - "start": { - "line": 19, - "column": 4 - }, - "end": { - "line": 20, - "column": 17 - } - }, + "start":212,"end":243,"loc":{"start":{"line":19,"column":4},"end":{"line":20,"column":17}}, "types": [ { "type": "ObjectTypeAnnotation", - "start": 214, - "end": 225, - "loc": { - "start": { - "line": 19, - "column": 6 - }, - "end": { - "line": 19, - "column": 17 - } - }, + "start":214,"end":225,"loc":{"start":{"line":19,"column":6},"end":{"line":19,"column":17}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 215, - "end": 224, - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 16 - } - }, + "start":215,"end":224,"loc":{"start":{"line":19,"column":7},"end":{"line":19,"column":16}}, "key": { "type": "Identifier", - "start": 215, - "end": 219, - "loc": { - "start": { - "line": 19, - "column": 7 - }, - "end": { - "line": 19, - "column": 11 - }, - "identifierName": "type" - }, + "start":215,"end":219,"loc":{"start":{"line":19,"column":7},"end":{"line":19,"column":11},"identifierName":"type"}, "name": "type" }, "static": false, @@ -874,18 +322,7 @@ "method": false, "value": { "type": "StringLiteralTypeAnnotation", - "start": 221, - "end": 224, - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 16 - } - }, + "start":221,"end":224,"loc":{"start":{"line":19,"column":13},"end":{"line":19,"column":16}}, "extra": { "rawValue": "A", "raw": "\"A\"" @@ -903,49 +340,15 @@ }, { "type": "ObjectTypeAnnotation", - "start": 232, - "end": 243, - "loc": { - "start": { - "line": 20, - "column": 6 - }, - "end": { - "line": 20, - "column": 17 - } - }, + "start":232,"end":243,"loc":{"start":{"line":20,"column":6},"end":{"line":20,"column":17}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 233, - "end": 242, - "loc": { - "start": { - "line": 20, - "column": 7 - }, - "end": { - "line": 20, - "column": 16 - } - }, + "start":233,"end":242,"loc":{"start":{"line":20,"column":7},"end":{"line":20,"column":16}}, "key": { "type": "Identifier", - "start": 233, - "end": 237, - "loc": { - "start": { - "line": 20, - "column": 7 - }, - "end": { - "line": 20, - "column": 11 - }, - "identifierName": "type" - }, + "start":233,"end":237,"loc":{"start":{"line":20,"column":7},"end":{"line":20,"column":11},"identifierName":"type"}, "name": "type" }, "static": false, @@ -954,18 +357,7 @@ "method": false, "value": { "type": "StringLiteralTypeAnnotation", - "start": 239, - "end": 242, - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 16 - } - }, + "start":239,"end":242,"loc":{"start":{"line":20,"column":13},"end":{"line":20,"column":16}}, "extra": { "rawValue": "B", "raw": "\"B\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-alias/5/output.json b/packages/babel-parser/test/fixtures/flow/type-alias/5/output.json index 75a8bc8b79..e78f03a857 100644 --- a/packages/babel-parser/test/fixtures/flow/type-alias/5/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-alias/5/output.json @@ -1,155 +1,43 @@ { "type": "File", - "start": 0, - "end": 98, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 2 - } - }, + "start":0,"end":98,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 98, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 9, - "column": 2 - } - }, + "start":0,"end":98,"loc":{"start":{"line":1,"column":0},"end":{"line":9,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "GenericTypeAnnotation", - "start": 9, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":9,"end":47,"loc":{"start":{"line":1,"column":9},"end":{"line":4,"column":1}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 12, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":12,"end":47,"loc":{"start":{"line":1,"column":12},"end":{"line":4,"column":1}}, "params": [ { "type": "UnionTypeAnnotation", - "start": 16, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":16,"end":45,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":15}}, "types": [ { "type": "ObjectTypeAnnotation", - "start": 18, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":18,"end":29,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":15}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":19,"end":28,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":14}}, "key": { "type": "Identifier", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "type" - }, + "start":19,"end":23,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":9},"identifierName":"type"}, "name": "type" }, "static": false, @@ -158,18 +46,7 @@ "method": false, "value": { "type": "StringLiteralTypeAnnotation", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":25,"end":28,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14}}, "extra": { "rawValue": "A", "raw": "\"A\"" @@ -187,49 +64,15 @@ }, { "type": "ObjectTypeAnnotation", - "start": 34, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":34,"end":45,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":15}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 35, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":35,"end":44,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":14}}, "key": { "type": "Identifier", - "start": 35, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "type" - }, + "start":35,"end":39,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":9},"identifierName":"type"}, "name": "type" }, "static": false, @@ -238,18 +81,7 @@ "method": false, "value": { "type": "StringLiteralTypeAnnotation", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":41,"end":44,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":14}}, "extra": { "rawValue": "B", "raw": "\"B\"" @@ -271,144 +103,42 @@ }, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "Foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"Foo"}, "name": "Foo" } } }, { "type": "TypeAlias", - "start": 50, - "end": 98, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 9, - "column": 2 - } - }, + "start":50,"end":98,"loc":{"start":{"line":6,"column":0},"end":{"line":9,"column":2}}, "id": { "type": "Identifier", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 6 - }, - "identifierName": "B" - }, + "start":55,"end":56,"loc":{"start":{"line":6,"column":5},"end":{"line":6,"column":6},"identifierName":"B"}, "name": "B" }, "typeParameters": null, "right": { "type": "GenericTypeAnnotation", - "start": 59, - "end": 97, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":59,"end":97,"loc":{"start":{"line":6,"column":9},"end":{"line":9,"column":1}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 62, - "end": 97, - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 9, - "column": 1 - } - }, + "start":62,"end":97,"loc":{"start":{"line":6,"column":12},"end":{"line":9,"column":1}}, "params": [ { "type": "IntersectionTypeAnnotation", - "start": 66, - "end": 95, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 8, - "column": 15 - } - }, + "start":66,"end":95,"loc":{"start":{"line":7,"column":2},"end":{"line":8,"column":15}}, "types": [ { "type": "ObjectTypeAnnotation", - "start": 68, - "end": 79, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 15 - } - }, + "start":68,"end":79,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":15}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 69, - "end": 78, - "loc": { - "start": { - "line": 7, - "column": 5 - }, - "end": { - "line": 7, - "column": 14 - } - }, + "start":69,"end":78,"loc":{"start":{"line":7,"column":5},"end":{"line":7,"column":14}}, "key": { "type": "Identifier", - "start": 69, - "end": 73, - "loc": { - "start": { - "line": 7, - "column": 5 - }, - "end": { - "line": 7, - "column": 9 - }, - "identifierName": "type" - }, + "start":69,"end":73,"loc":{"start":{"line":7,"column":5},"end":{"line":7,"column":9},"identifierName":"type"}, "name": "type" }, "static": false, @@ -417,18 +147,7 @@ "method": false, "value": { "type": "StringLiteralTypeAnnotation", - "start": 75, - "end": 78, - "loc": { - "start": { - "line": 7, - "column": 11 - }, - "end": { - "line": 7, - "column": 14 - } - }, + "start":75,"end":78,"loc":{"start":{"line":7,"column":11},"end":{"line":7,"column":14}}, "extra": { "rawValue": "A", "raw": "\"A\"" @@ -446,49 +165,15 @@ }, { "type": "ObjectTypeAnnotation", - "start": 84, - "end": 95, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 15 - } - }, + "start":84,"end":95,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":15}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 85, - "end": 94, - "loc": { - "start": { - "line": 8, - "column": 5 - }, - "end": { - "line": 8, - "column": 14 - } - }, + "start":85,"end":94,"loc":{"start":{"line":8,"column":5},"end":{"line":8,"column":14}}, "key": { "type": "Identifier", - "start": 85, - "end": 89, - "loc": { - "start": { - "line": 8, - "column": 5 - }, - "end": { - "line": 8, - "column": 9 - }, - "identifierName": "type" - }, + "start":85,"end":89,"loc":{"start":{"line":8,"column":5},"end":{"line":8,"column":9},"identifierName":"type"}, "name": "type" }, "static": false, @@ -497,18 +182,7 @@ "method": false, "value": { "type": "StringLiteralTypeAnnotation", - "start": 91, - "end": 94, - "loc": { - "start": { - "line": 8, - "column": 11 - }, - "end": { - "line": 8, - "column": 14 - } - }, + "start":91,"end":94,"loc":{"start":{"line":8,"column":11},"end":{"line":8,"column":14}}, "extra": { "rawValue": "B", "raw": "\"B\"" @@ -530,19 +204,7 @@ }, "id": { "type": "Identifier", - "start": 59, - "end": 62, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 12 - }, - "identifierName": "Foo" - }, + "start":59,"end":62,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":12},"identifierName":"Foo"}, "name": "Foo" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-alias/6/output.json b/packages/babel-parser/test/fixtures/flow/type-alias/6/output.json index 526e348eab..8bab56eca7 100644 --- a/packages/babel-parser/test/fixtures/flow/type-alias/6/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-alias/6/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "typeParameters": null, "right": { "type": "NullableTypeAnnotation", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/1/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/1/output.json index 85e99c874f..629880bbf2 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/1/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,113 +20,34 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "numVal" - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24},"identifierName":"numVal"}, "name": "numVal", "typeAnnotation": { "type": "TypeAnnotation", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "typeAnnotation": { "type": "AnyTypeAnnotation", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24}} } } }, { "type": "Identifier", - "start": 26, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "otherVal" - }, + "start":26,"end":41,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":41},"identifierName":"otherVal"}, "name": "otherVal", "typeAnnotation": { "type": "TypeAnnotation", - "start": 34, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":34,"end":41,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":41}}, "typeAnnotation": { "type": "MixedTypeAnnotation", - "start": 36, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 41 - } - } + "start":36,"end":41,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":41}} } } } ], "body": { "type": "BlockStatement", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":42,"end":44,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":44}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/10/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/10/output.json index 133149d81a..7a545d1e65 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/10/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/10/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,161 +20,48 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 53 - }, - "identifierName": "callback" - }, + "start":13,"end":53,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":53},"identifierName":"callback"}, "name": "callback", "typeAnnotation": { "type": "TypeAnnotation", - "start": 21, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":21,"end":53,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":53}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 23, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":23,"end":53,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":53}}, "params": [ { "type": "FunctionTypeParam", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}}, "name": { "type": "Identifier", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "_1" - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26},"identifierName":"_1"}, "name": "_1" }, "optional": false, "typeAnnotation": { "type": "BooleanTypeAnnotation", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31}} } }, { "type": "FunctionTypeParam", - "start": 33, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":33,"end":42,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":42}}, "name": { "type": "Identifier", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "_2" - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35},"identifierName":"_2"}, "name": "_2" }, "optional": false, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } - } + "start":36,"end":42,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":42}} } } ], "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 47, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 53 - } - } + "start":47,"end":53,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":53}} }, "typeParameters": null } @@ -228,18 +70,7 @@ ], "body": { "type": "BlockStatement", - "start": 54, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":54,"end":56,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":56}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/100/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/100/output.json index 07264734b5..654e969541 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/100/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/100/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":10,"end":40,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":40}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":12,"end":39,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":39}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "bar" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"bar"}, "name": "bar" }, "computed": false, @@ -117,77 +38,22 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "typeAnnotation": { "type": "ThisTypeAnnotation", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}} } }, "body": { "type": "BlockStatement", - "start": 23, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":23,"end":39,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":39}}, "body": [ { "type": "ReturnStatement", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":25,"end":37,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":37}}, "argument": { "type": "ThisExpression", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 36 - } - } + "start":32,"end":36,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":36}} } } ], diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/101/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/101/output.json index e8d609bee6..f085ab9a2d 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/101/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/101/output.json @@ -1,121 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 23, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":23,"end":36,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":36}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 25, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":25,"end":36,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":36}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 26, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":26,"end":36,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":36}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 26, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "ReturnType" - }, + "start":26,"end":36,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":36},"identifierName":"ReturnType"}, "name": "ReturnType" } } @@ -127,79 +38,22 @@ "params": [ { "type": "RestElement", - "start": 2, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":2,"end":20,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":20}}, "argument": { "type": "Identifier", - "start": 5, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "props" - }, + "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10},"identifierName":"props"}, "name": "props" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "SomeType" - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20},"identifierName":"SomeType"}, "name": "SomeType" } } @@ -208,18 +62,7 @@ ], "body": { "type": "NumericLiteral", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43}}, "extra": { "rawValue": 3, "raw": "3", diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/102/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/102/output.json index 0212f566b6..7e58c33f58 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/102/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/102/output.json @@ -1,138 +1,38 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "declaration": { "type": "ArrowFunctionExpression", - "start": 15, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":15,"end":50,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":50}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 29, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":29,"end":44,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":44}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 31, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":31,"end":44,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":44}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 36, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":36,"end":44,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":44}}, "params": [ { "type": "StringTypeAnnotation", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - } + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43}} } ] }, "id": { "type": "Identifier", - "start": 31, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "Array" - }, + "start":31,"end":36,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":36},"identifierName":"Array"}, "name": "Array" } } @@ -143,51 +43,17 @@ "params": [ { "type": "RestElement", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, "argument": { "type": "Identifier", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "modifiers" - }, + "start":19,"end":28,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":28},"identifierName":"modifiers"}, "name": "modifiers" } } ], "body": { "type": "BlockStatement", - "start": 48, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":48,"end":50,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":50}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/103/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/103/output.json index 3bd5d138ae..d971c67a75 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/103/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/103/output.json @@ -1,139 +1,38 @@ { "type": "File", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 73 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":73}}, "program": { "type": "Program", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 73 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":73}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 73 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":73}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 73 - } - }, + "start":6,"end":73,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":73}}, "id": { "type": "Identifier", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "parser" - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12},"identifierName":"parser"}, "name": "parser" }, "init": { "type": "ArrowFunctionExpression", - "start": 15, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 73 - } - }, + "start":15,"end":73,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":73}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 65, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 65 - }, - "end": { - "line": 1, - "column": 67 - } - }, + "start":65,"end":67,"loc":{"start":{"line":1,"column":65},"end":{"line":1,"column":67}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 66, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 66 - }, - "end": { - "line": 1, - "column": 67 - } - }, + "start":66,"end":67,"loc":{"start":{"line":1,"column":66},"end":{"line":1,"column":67}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 66, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 66 - }, - "end": { - "line": 1, - "column": 67 - }, - "identifierName": "a" - }, + "start":66,"end":67,"loc":{"start":{"line":1,"column":66},"end":{"line":1,"column":67},"identifierName":"a"}, "name": "a" } } @@ -144,157 +43,44 @@ "params": [ { "type": "Identifier", - "start": 16, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "rootPath" - }, + "start":16,"end":32,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":32},"identifierName":"rootPath"}, "name": "rootPath", "typeAnnotation": { "type": "TypeAnnotation", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":24,"end":32,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":32}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - } + "start":26,"end":32,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":32}} } } }, { "type": "RestElement", - "start": 34, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":34,"end":64,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":64}}, "argument": { "type": "Identifier", - "start": 37, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 49 - }, - "identifierName": "filesToParse" - }, + "start":37,"end":49,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":49},"identifierName":"filesToParse"}, "name": "filesToParse" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 49, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":49,"end":64,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":64}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 51, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":51,"end":64,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":64}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 56, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 56 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":56,"end":64,"loc":{"start":{"line":1,"column":56},"end":{"line":1,"column":64}}, "params": [ { "type": "StringTypeAnnotation", - "start": 57, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 63 - } - } + "start":57,"end":63,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":63}} } ] }, "id": { "type": "Identifier", - "start": 51, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 56 - }, - "identifierName": "Array" - }, + "start":51,"end":56,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":56},"identifierName":"Array"}, "name": "Array" } } @@ -303,18 +89,7 @@ ], "body": { "type": "BlockStatement", - "start": 71, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 71 - }, - "end": { - "line": 1, - "column": 73 - } - }, + "start":71,"end":73,"loc":{"start":{"line":1,"column":71},"end":{"line":1,"column":73}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/104/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/104/output.json index 99987bee8e..9449309b7a 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/104/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/104/output.json @@ -1,144 +1,43 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "get" - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"get"}, "name": "get" }, "computed": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8}}, "params": [ { "type": "TypeParameter", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "name": "T", "variance": null } @@ -150,18 +49,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "body": [], "directives": [] } @@ -171,114 +59,35 @@ }, { "type": "ClassDeclaration", - "start": 29, - "end": 56, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":29,"end":56,"loc":{"start":{"line":5,"column":0},"end":{"line":7,"column":1}}, "id": { "type": "Identifier", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 9 - }, - "identifierName": "Bar" - }, + "start":35,"end":38,"loc":{"start":{"line":5,"column":6},"end":{"line":5,"column":9},"identifierName":"Bar"}, "name": "Bar" }, "superClass": null, "body": { "type": "ClassBody", - "start": 39, - "end": 56, - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":39,"end":56,"loc":{"start":{"line":5,"column":10},"end":{"line":7,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 43, - "end": 54, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 13 - } - }, + "start":43,"end":54,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":13}}, "static": false, "key": { "type": "Identifier", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 5 - }, - "identifierName": "set" - }, + "start":43,"end":46,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":5},"identifierName":"set"}, "name": "set" }, "computed": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 8 - } - }, + "start":46,"end":49,"loc":{"start":{"line":6,"column":5},"end":{"line":6,"column":8}}, "params": [ { "type": "TypeParameter", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 7 - } - }, + "start":47,"end":48,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":7}}, "name": "T", "variance": null } @@ -290,18 +99,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 52, - "end": 54, - "loc": { - "start": { - "line": 6, - "column": 11 - }, - "end": { - "line": 6, - "column": 13 - } - }, + "start":52,"end":54,"loc":{"start":{"line":6,"column":11},"end":{"line":6,"column":13}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/105/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/105/output.json index 06cbe65fd5..73530e6d3b 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/105/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/105/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "g" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"g"}, "name": "g" }, "generator": false, @@ -65,79 +20,23 @@ "params": [ { "type": "AssignmentPattern", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21}}, "left": { "type": "Identifier", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "a" - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 12, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":12,"end":19,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":19}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}} } } }, "right": { "type": "NumericLiteral", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "extra": { "rawValue": 1, "raw": "1" @@ -147,79 +46,23 @@ }, { "type": "AssignmentPattern", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":23,"end":33,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":33}}, "left": { "type": "Identifier", - "start": 23, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "e" - }, + "start":23,"end":31,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":31},"identifierName":"e"}, "name": "e", "typeAnnotation": { "type": "TypeAnnotation", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":25,"end":31,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":31}} } } }, "right": { "type": "NumericLiteral", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33}}, "extra": { "rawValue": 1, "raw": "1" @@ -230,18 +73,7 @@ ], "body": { "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":35,"end":37,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":37}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/107/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/107/output.json index c5506a0fe9..8623c7e1db 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/107/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/107/output.json @@ -1,176 +1,52 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":4,"end":35,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":35}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "x" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"x"}, "name": "x" }, "init": { "type": "ArrowFunctionExpression", - "start": 8, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":8,"end":35,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":35}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 9, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":9,"end":28,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":28}}, "left": { "type": "ObjectPattern", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":9,"end":20,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":20}}, "properties": [ { "type": "ObjectProperty", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a" }, "extra": { @@ -180,49 +56,16 @@ ], "typeAnnotation": { "type": "TypeAnnotation", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "typeAnnotation": { "type": "AnyTypeAnnotation", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}} } } }, "right": { "type": "StringLiteral", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "extra": { "rawValue": "foo", "raw": "'foo'" @@ -233,18 +76,7 @@ ], "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/108/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/108/output.json index a3e8ba642b..ea9d3a2119 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/108/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/108/output.json @@ -1,138 +1,37 @@ { "type": "File", - "start": 0, - "end": 320, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 92 - } - }, + "start":0,"end":320,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":92}}, "program": { "type": "Program", - "start": 0, - "end": 320, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 92 - } - }, + "start":0,"end":320,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":92}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":4,"end":55,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":55}}, "id": { "type": "Identifier", - "start": 4, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "a" - }, + "start":4,"end":34,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":34},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":6,"end":34,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":34}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 8, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":8,"end":34,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":34}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20}}, "key": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "static": false, @@ -141,51 +40,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31}}, "key": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "y" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"y"}, "name": "y" }, "static": false, @@ -194,18 +59,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":25,"end":31,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":31}} }, "variance": null, "optional": false @@ -220,67 +74,22 @@ }, "init": { "type": "ObjectExpression", - "start": 37, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":37,"end":55,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":55}}, "properties": [ { "type": "ObjectProperty", - "start": 39, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":39,"end":43,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":43}}, "method": false, "key": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "x" - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43}}, "extra": { "rawValue": 0, "raw": "0" @@ -290,52 +99,18 @@ }, { "type": "ObjectProperty", - "start": 45, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":45,"end":53,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":53}}, "method": false, "key": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "y" - }, + "start":45,"end":46,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":46},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 48, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":48,"end":53,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":53}}, "extra": { "rawValue": "foo", "raw": "'foo'" @@ -351,108 +126,29 @@ }, { "type": "VariableDeclaration", - "start": 57, - "end": 114, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 57 - } - }, + "start":57,"end":114,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":57}}, "declarations": [ { "type": "VariableDeclarator", - "start": 61, - "end": 113, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 56 - } - }, + "start":61,"end":113,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":56}}, "id": { "type": "Identifier", - "start": 61, - "end": 92, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 35 - }, - "identifierName": "b" - }, + "start":61,"end":92,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":35},"identifierName":"b"}, "name": "b", "typeAnnotation": { "type": "TypeAnnotation", - "start": 63, - "end": 92, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":63,"end":92,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":35}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 65, - "end": 92, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":65,"end":92,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":35}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 68, - "end": 77, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":68,"end":77,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":20}}, "key": { "type": "Identifier", - "start": 68, - "end": 69, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "x" - }, + "start":68,"end":69,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"x"}, "name": "x" }, "static": false, @@ -461,51 +157,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 71, - "end": 77, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 20 - } - } + "start":71,"end":77,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":20}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 79, - "end": 88, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":79,"end":88,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":31}}, "key": { "type": "Identifier", - "start": 79, - "end": 80, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "y" - }, + "start":79,"end":80,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":23},"identifierName":"y"}, "name": "y" }, "static": false, @@ -514,18 +176,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 82, - "end": 88, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 31 - } - } + "start":82,"end":88,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":31}} }, "variance": null, "optional": false @@ -540,67 +191,22 @@ }, "init": { "type": "ObjectExpression", - "start": 95, - "end": 113, - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 2, - "column": 56 - } - }, + "start":95,"end":113,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":56}}, "properties": [ { "type": "ObjectProperty", - "start": 97, - "end": 101, - "loc": { - "start": { - "line": 2, - "column": 40 - }, - "end": { - "line": 2, - "column": 44 - } - }, + "start":97,"end":101,"loc":{"start":{"line":2,"column":40},"end":{"line":2,"column":44}}, "method": false, "key": { "type": "Identifier", - "start": 97, - "end": 98, - "loc": { - "start": { - "line": 2, - "column": 40 - }, - "end": { - "line": 2, - "column": 41 - }, - "identifierName": "x" - }, + "start":97,"end":98,"loc":{"start":{"line":2,"column":40},"end":{"line":2,"column":41},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 100, - "end": 101, - "loc": { - "start": { - "line": 2, - "column": 43 - }, - "end": { - "line": 2, - "column": 44 - } - }, + "start":100,"end":101,"loc":{"start":{"line":2,"column":43},"end":{"line":2,"column":44}}, "extra": { "rawValue": 0, "raw": "0" @@ -610,52 +216,18 @@ }, { "type": "ObjectProperty", - "start": 103, - "end": 111, - "loc": { - "start": { - "line": 2, - "column": 46 - }, - "end": { - "line": 2, - "column": 54 - } - }, + "start":103,"end":111,"loc":{"start":{"line":2,"column":46},"end":{"line":2,"column":54}}, "method": false, "key": { "type": "Identifier", - "start": 103, - "end": 104, - "loc": { - "start": { - "line": 2, - "column": 46 - }, - "end": { - "line": 2, - "column": 47 - }, - "identifierName": "y" - }, + "start":103,"end":104,"loc":{"start":{"line":2,"column":46},"end":{"line":2,"column":47},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 106, - "end": 111, - "loc": { - "start": { - "line": 2, - "column": 49 - }, - "end": { - "line": 2, - "column": 54 - } - }, + "start":106,"end":111,"loc":{"start":{"line":2,"column":49},"end":{"line":2,"column":54}}, "extra": { "rawValue": "foo", "raw": "'foo'" @@ -671,77 +243,21 @@ }, { "type": "VariableDeclaration", - "start": 115, - "end": 134, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":115,"end":134,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 119, - "end": 133, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":119,"end":133,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":18}}, "id": { "type": "Identifier", - "start": 119, - "end": 128, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "c" - }, + "start":119,"end":128,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13},"identifierName":"c"}, "name": "c", "typeAnnotation": { "type": "TypeAnnotation", - "start": 121, - "end": 128, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":121,"end":128,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":13}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 123, - "end": 128, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":123,"end":128,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":13}}, "callProperties": [], "properties": [], "indexers": [], @@ -753,18 +269,7 @@ }, "init": { "type": "ObjectExpression", - "start": 131, - "end": 133, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":131,"end":133,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":18}}, "properties": [] } } @@ -773,108 +278,29 @@ }, { "type": "VariableDeclaration", - "start": 135, - "end": 227, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 92 - } - }, + "start":135,"end":227,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":92}}, "declarations": [ { "type": "VariableDeclarator", - "start": 139, - "end": 226, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 91 - } - }, + "start":139,"end":226,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":91}}, "id": { "type": "Identifier", - "start": 139, - "end": 188, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 53 - }, - "identifierName": "d" - }, + "start":139,"end":188,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":53},"identifierName":"d"}, "name": "d", "typeAnnotation": { "type": "TypeAnnotation", - "start": 141, - "end": 188, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 53 - } - }, + "start":141,"end":188,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":53}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 143, - "end": 188, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 53 - } - }, + "start":143,"end":188,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":53}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 145, - "end": 174, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 39 - } - }, + "start":145,"end":174,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":39}}, "key": { "type": "Identifier", - "start": 145, - "end": 146, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 11 - }, - "identifierName": "a" - }, + "start":145,"end":146,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":11},"identifierName":"a"}, "name": "a" }, "static": false, @@ -883,49 +309,15 @@ "method": false, "value": { "type": "ObjectTypeAnnotation", - "start": 148, - "end": 174, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 39 - } - }, + "start":148,"end":174,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":39}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 151, - "end": 160, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":151,"end":160,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":25}}, "key": { "type": "Identifier", - "start": 151, - "end": 152, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 17 - }, - "identifierName": "x" - }, + "start":151,"end":152,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":17},"identifierName":"x"}, "name": "x" }, "static": false, @@ -934,51 +326,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 154, - "end": 160, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 25 - } - } + "start":154,"end":160,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":25}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 162, - "end": 171, - "loc": { - "start": { - "line": 4, - "column": 27 - }, - "end": { - "line": 4, - "column": 36 - } - }, + "start":162,"end":171,"loc":{"start":{"line":4,"column":27},"end":{"line":4,"column":36}}, "key": { "type": "Identifier", - "start": 162, - "end": 163, - "loc": { - "start": { - "line": 4, - "column": 27 - }, - "end": { - "line": 4, - "column": 28 - }, - "identifierName": "y" - }, + "start":162,"end":163,"loc":{"start":{"line":4,"column":27},"end":{"line":4,"column":28},"identifierName":"y"}, "name": "y" }, "static": false, @@ -987,18 +345,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 165, - "end": 171, - "loc": { - "start": { - "line": 4, - "column": 30 - }, - "end": { - "line": 4, - "column": 36 - } - } + "start":165,"end":171,"loc":{"start":{"line":4,"column":30},"end":{"line":4,"column":36}} }, "variance": null, "optional": false @@ -1014,33 +361,10 @@ }, { "type": "ObjectTypeProperty", - "start": 176, - "end": 186, - "loc": { - "start": { - "line": 4, - "column": 41 - }, - "end": { - "line": 4, - "column": 51 - } - }, + "start":176,"end":186,"loc":{"start":{"line":4,"column":41},"end":{"line":4,"column":51}}, "key": { "type": "Identifier", - "start": 176, - "end": 177, - "loc": { - "start": { - "line": 4, - "column": 41 - }, - "end": { - "line": 4, - "column": 42 - }, - "identifierName": "b" - }, + "start":176,"end":177,"loc":{"start":{"line":4,"column":41},"end":{"line":4,"column":42},"identifierName":"b"}, "name": "b" }, "static": false, @@ -1049,18 +373,7 @@ "method": false, "value": { "type": "BooleanTypeAnnotation", - "start": 179, - "end": 186, - "loc": { - "start": { - "line": 4, - "column": 44 - }, - "end": { - "line": 4, - "column": 51 - } - } + "start":179,"end":186,"loc":{"start":{"line":4,"column":44},"end":{"line":4,"column":51}} }, "variance": null, "optional": false @@ -1075,116 +388,37 @@ }, "init": { "type": "ObjectExpression", - "start": 191, - "end": 226, - "loc": { - "start": { - "line": 4, - "column": 56 - }, - "end": { - "line": 4, - "column": 91 - } - }, + "start":191,"end":226,"loc":{"start":{"line":4,"column":56},"end":{"line":4,"column":91}}, "properties": [ { "type": "ObjectProperty", - "start": 193, - "end": 214, - "loc": { - "start": { - "line": 4, - "column": 58 - }, - "end": { - "line": 4, - "column": 79 - } - }, + "start":193,"end":214,"loc":{"start":{"line":4,"column":58},"end":{"line":4,"column":79}}, "method": false, "key": { "type": "Identifier", - "start": 193, - "end": 194, - "loc": { - "start": { - "line": 4, - "column": 58 - }, - "end": { - "line": 4, - "column": 59 - }, - "identifierName": "a" - }, + "start":193,"end":194,"loc":{"start":{"line":4,"column":58},"end":{"line":4,"column":59},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ObjectExpression", - "start": 196, - "end": 214, - "loc": { - "start": { - "line": 4, - "column": 61 - }, - "end": { - "line": 4, - "column": 79 - } - }, + "start":196,"end":214,"loc":{"start":{"line":4,"column":61},"end":{"line":4,"column":79}}, "properties": [ { "type": "ObjectProperty", - "start": 198, - "end": 202, - "loc": { - "start": { - "line": 4, - "column": 63 - }, - "end": { - "line": 4, - "column": 67 - } - }, + "start":198,"end":202,"loc":{"start":{"line":4,"column":63},"end":{"line":4,"column":67}}, "method": false, "key": { "type": "Identifier", - "start": 198, - "end": 199, - "loc": { - "start": { - "line": 4, - "column": 63 - }, - "end": { - "line": 4, - "column": 64 - }, - "identifierName": "x" - }, + "start":198,"end":199,"loc":{"start":{"line":4,"column":63},"end":{"line":4,"column":64},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 201, - "end": 202, - "loc": { - "start": { - "line": 4, - "column": 66 - }, - "end": { - "line": 4, - "column": 67 - } - }, + "start":201,"end":202,"loc":{"start":{"line":4,"column":66},"end":{"line":4,"column":67}}, "extra": { "rawValue": 0, "raw": "0" @@ -1194,52 +428,18 @@ }, { "type": "ObjectProperty", - "start": 204, - "end": 212, - "loc": { - "start": { - "line": 4, - "column": 69 - }, - "end": { - "line": 4, - "column": 77 - } - }, + "start":204,"end":212,"loc":{"start":{"line":4,"column":69},"end":{"line":4,"column":77}}, "method": false, "key": { "type": "Identifier", - "start": 204, - "end": 205, - "loc": { - "start": { - "line": 4, - "column": 69 - }, - "end": { - "line": 4, - "column": 70 - }, - "identifierName": "y" - }, + "start":204,"end":205,"loc":{"start":{"line":4,"column":69},"end":{"line":4,"column":70},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 207, - "end": 212, - "loc": { - "start": { - "line": 4, - "column": 72 - }, - "end": { - "line": 4, - "column": 77 - } - }, + "start":207,"end":212,"loc":{"start":{"line":4,"column":72},"end":{"line":4,"column":77}}, "extra": { "rawValue": "foo", "raw": "'foo'" @@ -1252,52 +452,18 @@ }, { "type": "ObjectProperty", - "start": 216, - "end": 224, - "loc": { - "start": { - "line": 4, - "column": 81 - }, - "end": { - "line": 4, - "column": 89 - } - }, + "start":216,"end":224,"loc":{"start":{"line":4,"column":81},"end":{"line":4,"column":89}}, "method": false, "key": { "type": "Identifier", - "start": 216, - "end": 217, - "loc": { - "start": { - "line": 4, - "column": 81 - }, - "end": { - "line": 4, - "column": 82 - }, - "identifierName": "b" - }, + "start":216,"end":217,"loc":{"start":{"line":4,"column":81},"end":{"line":4,"column":82},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "BooleanLiteral", - "start": 219, - "end": 224, - "loc": { - "start": { - "line": 4, - "column": 84 - }, - "end": { - "line": 4, - "column": 89 - } - }, + "start":219,"end":224,"loc":{"start":{"line":4,"column":84},"end":{"line":4,"column":89}}, "value": false } } @@ -1309,108 +475,29 @@ }, { "type": "VariableDeclaration", - "start": 228, - "end": 320, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 92 - } - }, + "start":228,"end":320,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":92}}, "declarations": [ { "type": "VariableDeclarator", - "start": 232, - "end": 319, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 91 - } - }, + "start":232,"end":319,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":91}}, "id": { "type": "Identifier", - "start": 232, - "end": 281, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 53 - }, - "identifierName": "e" - }, + "start":232,"end":281,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":53},"identifierName":"e"}, "name": "e", "typeAnnotation": { "type": "TypeAnnotation", - "start": 234, - "end": 281, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 53 - } - }, + "start":234,"end":281,"loc":{"start":{"line":5,"column":6},"end":{"line":5,"column":53}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 236, - "end": 281, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 53 - } - }, + "start":236,"end":281,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":53}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 239, - "end": 266, - "loc": { - "start": { - "line": 5, - "column": 11 - }, - "end": { - "line": 5, - "column": 38 - } - }, + "start":239,"end":266,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":38}}, "key": { "type": "Identifier", - "start": 239, - "end": 240, - "loc": { - "start": { - "line": 5, - "column": 11 - }, - "end": { - "line": 5, - "column": 12 - }, - "identifierName": "a" - }, + "start":239,"end":240,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":12},"identifierName":"a"}, "name": "a" }, "static": false, @@ -1419,49 +506,15 @@ "method": false, "value": { "type": "ObjectTypeAnnotation", - "start": 242, - "end": 266, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 38 - } - }, + "start":242,"end":266,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":38}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 244, - "end": 253, - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 5, - "column": 25 - } - }, + "start":244,"end":253,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":25}}, "key": { "type": "Identifier", - "start": 244, - "end": 245, - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 5, - "column": 17 - }, - "identifierName": "x" - }, + "start":244,"end":245,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":17},"identifierName":"x"}, "name": "x" }, "static": false, @@ -1470,51 +523,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 247, - "end": 253, - "loc": { - "start": { - "line": 5, - "column": 19 - }, - "end": { - "line": 5, - "column": 25 - } - } + "start":247,"end":253,"loc":{"start":{"line":5,"column":19},"end":{"line":5,"column":25}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 255, - "end": 264, - "loc": { - "start": { - "line": 5, - "column": 27 - }, - "end": { - "line": 5, - "column": 36 - } - }, + "start":255,"end":264,"loc":{"start":{"line":5,"column":27},"end":{"line":5,"column":36}}, "key": { "type": "Identifier", - "start": 255, - "end": 256, - "loc": { - "start": { - "line": 5, - "column": 27 - }, - "end": { - "line": 5, - "column": 28 - }, - "identifierName": "y" - }, + "start":255,"end":256,"loc":{"start":{"line":5,"column":27},"end":{"line":5,"column":28},"identifierName":"y"}, "name": "y" }, "static": false, @@ -1523,18 +542,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 258, - "end": 264, - "loc": { - "start": { - "line": 5, - "column": 30 - }, - "end": { - "line": 5, - "column": 36 - } - } + "start":258,"end":264,"loc":{"start":{"line":5,"column":30},"end":{"line":5,"column":36}} }, "variance": null, "optional": false @@ -1550,33 +558,10 @@ }, { "type": "ObjectTypeProperty", - "start": 268, - "end": 278, - "loc": { - "start": { - "line": 5, - "column": 40 - }, - "end": { - "line": 5, - "column": 50 - } - }, + "start":268,"end":278,"loc":{"start":{"line":5,"column":40},"end":{"line":5,"column":50}}, "key": { "type": "Identifier", - "start": 268, - "end": 269, - "loc": { - "start": { - "line": 5, - "column": 40 - }, - "end": { - "line": 5, - "column": 41 - }, - "identifierName": "b" - }, + "start":268,"end":269,"loc":{"start":{"line":5,"column":40},"end":{"line":5,"column":41},"identifierName":"b"}, "name": "b" }, "static": false, @@ -1585,18 +570,7 @@ "method": false, "value": { "type": "BooleanTypeAnnotation", - "start": 271, - "end": 278, - "loc": { - "start": { - "line": 5, - "column": 43 - }, - "end": { - "line": 5, - "column": 50 - } - } + "start":271,"end":278,"loc":{"start":{"line":5,"column":43},"end":{"line":5,"column":50}} }, "variance": null, "optional": false @@ -1611,116 +585,37 @@ }, "init": { "type": "ObjectExpression", - "start": 284, - "end": 319, - "loc": { - "start": { - "line": 5, - "column": 56 - }, - "end": { - "line": 5, - "column": 91 - } - }, + "start":284,"end":319,"loc":{"start":{"line":5,"column":56},"end":{"line":5,"column":91}}, "properties": [ { "type": "ObjectProperty", - "start": 286, - "end": 307, - "loc": { - "start": { - "line": 5, - "column": 58 - }, - "end": { - "line": 5, - "column": 79 - } - }, + "start":286,"end":307,"loc":{"start":{"line":5,"column":58},"end":{"line":5,"column":79}}, "method": false, "key": { "type": "Identifier", - "start": 286, - "end": 287, - "loc": { - "start": { - "line": 5, - "column": 58 - }, - "end": { - "line": 5, - "column": 59 - }, - "identifierName": "a" - }, + "start":286,"end":287,"loc":{"start":{"line":5,"column":58},"end":{"line":5,"column":59},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ObjectExpression", - "start": 289, - "end": 307, - "loc": { - "start": { - "line": 5, - "column": 61 - }, - "end": { - "line": 5, - "column": 79 - } - }, + "start":289,"end":307,"loc":{"start":{"line":5,"column":61},"end":{"line":5,"column":79}}, "properties": [ { "type": "ObjectProperty", - "start": 291, - "end": 295, - "loc": { - "start": { - "line": 5, - "column": 63 - }, - "end": { - "line": 5, - "column": 67 - } - }, + "start":291,"end":295,"loc":{"start":{"line":5,"column":63},"end":{"line":5,"column":67}}, "method": false, "key": { "type": "Identifier", - "start": 291, - "end": 292, - "loc": { - "start": { - "line": 5, - "column": 63 - }, - "end": { - "line": 5, - "column": 64 - }, - "identifierName": "x" - }, + "start":291,"end":292,"loc":{"start":{"line":5,"column":63},"end":{"line":5,"column":64},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 294, - "end": 295, - "loc": { - "start": { - "line": 5, - "column": 66 - }, - "end": { - "line": 5, - "column": 67 - } - }, + "start":294,"end":295,"loc":{"start":{"line":5,"column":66},"end":{"line":5,"column":67}}, "extra": { "rawValue": 0, "raw": "0" @@ -1730,52 +625,18 @@ }, { "type": "ObjectProperty", - "start": 297, - "end": 305, - "loc": { - "start": { - "line": 5, - "column": 69 - }, - "end": { - "line": 5, - "column": 77 - } - }, + "start":297,"end":305,"loc":{"start":{"line":5,"column":69},"end":{"line":5,"column":77}}, "method": false, "key": { "type": "Identifier", - "start": 297, - "end": 298, - "loc": { - "start": { - "line": 5, - "column": 69 - }, - "end": { - "line": 5, - "column": 70 - }, - "identifierName": "y" - }, + "start":297,"end":298,"loc":{"start":{"line":5,"column":69},"end":{"line":5,"column":70},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 300, - "end": 305, - "loc": { - "start": { - "line": 5, - "column": 72 - }, - "end": { - "line": 5, - "column": 77 - } - }, + "start":300,"end":305,"loc":{"start":{"line":5,"column":72},"end":{"line":5,"column":77}}, "extra": { "rawValue": "foo", "raw": "'foo'" @@ -1788,52 +649,18 @@ }, { "type": "ObjectProperty", - "start": 309, - "end": 317, - "loc": { - "start": { - "line": 5, - "column": 81 - }, - "end": { - "line": 5, - "column": 89 - } - }, + "start":309,"end":317,"loc":{"start":{"line":5,"column":81},"end":{"line":5,"column":89}}, "method": false, "key": { "type": "Identifier", - "start": 309, - "end": 310, - "loc": { - "start": { - "line": 5, - "column": 81 - }, - "end": { - "line": 5, - "column": 82 - }, - "identifierName": "b" - }, + "start":309,"end":310,"loc":{"start":{"line":5,"column":81},"end":{"line":5,"column":82},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "BooleanLiteral", - "start": 312, - "end": 317, - "loc": { - "start": { - "line": 5, - "column": 84 - }, - "end": { - "line": 5, - "column": 89 - } - }, + "start":312,"end":317,"loc":{"start":{"line":5,"column":84},"end":{"line":5,"column":89}}, "value": false } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/11/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/11/output.json index 9ae1b33f36..eff1cf78a2 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/11/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/11/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 67 - } - }, + "start":0,"end":67,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":67}}, "program": { "type": "Program", - "start": 0, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 67 - } - }, + "start":0,"end":67,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":67}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 67 - } - }, + "start":0,"end":67,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":67}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,209 +20,62 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 64 - }, - "identifierName": "callback" - }, + "start":13,"end":64,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":64},"identifierName":"callback"}, "name": "callback", "typeAnnotation": { "type": "TypeAnnotation", - "start": 21, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":21,"end":64,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":64}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 23, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":23,"end":64,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":64}}, "params": [ { "type": "FunctionTypeParam", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}}, "name": { "type": "Identifier", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "_1" - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26},"identifierName":"_1"}, "name": "_1" }, "optional": false, "typeAnnotation": { "type": "BooleanTypeAnnotation", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31}} } } ], "rest": { "type": "FunctionTypeParam", - "start": 36, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":36,"end":53,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":53}}, "name": { "type": "Identifier", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "foo" - }, + "start":36,"end":39,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":39},"identifierName":"foo"}, "name": "foo" }, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 40, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":40,"end":53,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":53}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 45, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":45,"end":53,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":53}}, "params": [ { "type": "NumberTypeAnnotation", - "start": 46, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 52 - } - } + "start":46,"end":52,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":52}} } ] }, "id": { "type": "Identifier", - "start": 40, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "Array" - }, + "start":40,"end":45,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":45},"identifierName":"Array"}, "name": "Array" } } }, "returnType": { "type": "NumberTypeAnnotation", - "start": 58, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 58 - }, - "end": { - "line": 1, - "column": 64 - } - } + "start":58,"end":64,"loc":{"start":{"line":1,"column":58},"end":{"line":1,"column":64}} }, "typeParameters": null } @@ -276,18 +84,7 @@ ], "body": { "type": "BlockStatement", - "start": 65, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 65 - }, - "end": { - "line": 1, - "column": 67 - } - }, + "start":65,"end":67,"loc":{"start":{"line":1,"column":65},"end":{"line":1,"column":67}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/110/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/110/output.json index 4b3587d4c8..ea777b7cf1 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/110/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/110/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "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" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "key": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "p" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"p"}, "name": "p" }, "static": false, @@ -114,51 +35,17 @@ "method": false, "value": { "type": "GenericTypeAnnotation", - "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}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"T"}, "name": "T" } }, "variance": { "type": "Variance", - "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}}, "kind": "plus" }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/111/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/111/output.json index ec02ec5739..0f8f2401a3 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/111/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/111/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "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" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "key": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "p" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"p"}, "name": "p" }, "static": false, @@ -114,51 +35,17 @@ "method": false, "value": { "type": "GenericTypeAnnotation", - "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}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"T"}, "name": "T" } }, "variance": { "type": "Variance", - "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}}, "kind": "minus" }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/114/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/114/output.json index ed63013702..6014c379ad 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/114/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/114/output.json @@ -1,195 +1,59 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "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" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19}}, "callProperties": [], "properties": [], "indexers": [ { "type": "ObjectTypeIndexer", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":10,"end":18,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":18}}, "static": false, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "k" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"k"}, "name": "k" }, "key": { "type": "GenericTypeAnnotation", - "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}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "K" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"K"}, "name": "K" } }, "value": { "type": "GenericTypeAnnotation", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "V" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"V"}, "name": "V" } }, "variance": { "type": "Variance", - "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}}, "kind": "plus" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/115/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/115/output.json index df1f40c306..d2b53a6402 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/115/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/115/output.json @@ -1,195 +1,59 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "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" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19}}, "callProperties": [], "properties": [], "indexers": [ { "type": "ObjectTypeIndexer", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":10,"end":18,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":18}}, "static": false, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "k" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"k"}, "name": "k" }, "key": { "type": "GenericTypeAnnotation", - "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}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "K" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"K"}, "name": "K" } }, "value": { "type": "GenericTypeAnnotation", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "V" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"V"}, "name": "V" } }, "variance": { "type": "Variance", - "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}}, "kind": "minus" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/118/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/118/output.json index d5d9f7533f..19cd5a6c08 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/118/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/118/output.json @@ -1,174 +1,50 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}}, "body": [ { "type": "ClassProperty", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "static": false, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "p" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"p"}, "name": "p" }, "computed": false, "variance": { "type": "Variance", - "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}}, "kind": "plus" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "T" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/119/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/119/output.json index 8db7e41bee..8b942e9bdc 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/119/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/119/output.json @@ -1,174 +1,50 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}}, "body": [ { "type": "ClassProperty", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "static": false, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "p" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"p"}, "name": "p" }, "computed": false, "variance": { "type": "Variance", - "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}}, "kind": "minus" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "T" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/12/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/12/output.json index 65c1d50573..57e141cfd7 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/12/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/12/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -66,48 +21,15 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 14, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":14,"end":21,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}} } }, "body": { "type": "BlockStatement", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/127/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/127/output.json index 165aac2e4c..a68703eb4f 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/127/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/127/output.json @@ -1,128 +1,39 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":9,"end":29,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":29}}, "callProperties": [], "properties": [], "indexers": [ { "type": "ObjectTypeIndexer", - "start": 11, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":11,"end":27,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":27}}, "static": false, "id": null, "key": { "type": "StringTypeAnnotation", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}} }, "value": { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} }, "variance": null } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/128/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/128/output.json index 345675c7e1..696aa6b4a2 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/128/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/128/output.json @@ -1,160 +1,49 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":9,"end":39,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":39}}, "callProperties": [], "properties": [], "indexers": [ { "type": "ObjectTypeIndexer", - "start": 11, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":11,"end":37,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":37}}, "static": false, "id": null, "key": { "type": "UnionTypeAnnotation", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":12,"end":28,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":28}}, "types": [ { "type": "StringTypeAnnotation", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}} }, { "type": "BooleanTypeAnnotation", - "start": 21, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":21,"end":28,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":28}} } ] }, "value": { "type": "NumberTypeAnnotation", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":31,"end":37,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":37}} }, "variance": null } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/129/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/129/output.json index 572fa8af86..5388de3eda 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/129/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/129/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 4 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 4 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":4}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 4 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":4}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":4,"column":3}}, "id": { "type": "Identifier", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "x" - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":3,"column":4},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":3,"column":4}}, "typeAnnotation": { "type": "UnionTypeAnnotation", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":8,"end":16,"loc":{"start":{"line":2,"column":1},"end":{"line":3,"column":4}}, "types": [ { "type": "NumberLiteralTypeAnnotation", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":10,"end":11,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4}}, "extra": { "rawValue": 1, "raw": "1" @@ -125,18 +36,7 @@ }, { "type": "NumberLiteralTypeAnnotation", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":15,"end":16,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4}}, "extra": { "rawValue": 2, "raw": "2" @@ -149,18 +49,7 @@ }, "init": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":19,"end":20,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":3}}, "extra": { "rawValue": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/13/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/13/output.json index e6f9bcabf3..fe45c3c0e5 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/13/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/13/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -66,66 +21,22 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":14,"end":25,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":25}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":15,"end":25,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":25}}, "params": [], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 21, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":21,"end":25,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":25}} }, "typeParameters": null } }, "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/130/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/130/output.json index 1b1c02e675..a9fe749cb3 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/130/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/130/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -65,63 +20,18 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "a" - }, + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 12, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":12,"end":21,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "UnionTypeAnnotation", - "start": 14, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":14,"end":21,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":21}}, "types": [ { "type": "NumberLiteralTypeAnnotation", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 1, "raw": "1" @@ -130,18 +40,7 @@ }, { "type": "NumberLiteralTypeAnnotation", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "extra": { "rawValue": 2, "raw": "2" @@ -154,63 +53,18 @@ }, { "type": "Identifier", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "b" - }, + "start":23,"end":33,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":33},"identifierName":"b"}, "name": "b", "typeAnnotation": { "type": "TypeAnnotation", - "start": 24, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":24,"end":33,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":33}}, "typeAnnotation": { "type": "IntersectionTypeAnnotation", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":26,"end":33,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":33}}, "types": [ { "type": "NumberLiteralTypeAnnotation", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29}}, "extra": { "rawValue": 3, "raw": "3" @@ -219,18 +73,7 @@ }, { "type": "NumberLiteralTypeAnnotation", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33}}, "extra": { "rawValue": 4, "raw": "4" @@ -245,48 +88,15 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 34, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":34,"end":42,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":42}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } - } + "start":36,"end":42,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":42}} } }, "body": { "type": "BlockStatement", - "start": 43, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":43,"end":45,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":45}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/131/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/131/output.json index ef2bc17e2d..bd280f5d14 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/131/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/131/output.json @@ -1,83 +1,27 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Cannot overwrite reserved type number (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "number" - }, + "start":5,"end":11,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":11},"identifierName":"number"}, "name": "number" }, "typeParameters": null, "right": { "type": "StringTypeAnnotation", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}} } } ], diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json index 042dd3afd3..a9ad9925ad 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/132/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "errors": [ "SyntaxError: Unexpected reserved type number (1:9)" ], "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "id": { "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" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "params": [ { "type": "TypeParameter", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "name": "number", "variance": null } @@ -99,18 +32,7 @@ }, "right": { "type": "StringTypeAnnotation", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}} } } ], diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json index 08cb55525e..4ffc897161 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/133/output.json @@ -1,99 +1,32 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Unexpected reserved type string (1:11)" ], "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, "generator": false, "async": false, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":10,"end":18,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":18}}, "params": [ { "type": "TypeParameter", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "name": "string", "variance": null } @@ -102,48 +35,14 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "x" - }, + "start":19,"end":28,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":28},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":22,"end":28,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":28}} } } } @@ -151,78 +50,22 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 29, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":29,"end":37,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":37}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":31,"end":37,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":37}} } }, "body": { "type": "BlockStatement", - "start": 38, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":38,"end":53,"loc":{"start":{"line":1,"column":38},"end":{"line":3,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 42, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":42,"end":51,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":11}}, "argument": { "type": "Identifier", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "x" - }, + "start":49,"end":50,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/134/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/134/output.json index c88abb4a58..6f5bb81982 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/134/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/134/output.json @@ -1,83 +1,27 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: Cannot overwrite reserved type bool (1:13)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareTypeAlias", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "bool" - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17},"identifierName":"bool"}, "name": "bool" }, "typeParameters": null, "right": { "type": "AnyTypeAnnotation", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23}} } } ], diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/135/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/135/output.json index ce7e04fe78..977bff7113 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/135/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/135/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":3,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeSpreadProperty", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":12,"end":18,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":7}}, "argument": { "type": "AnyTypeAnnotation", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - } + "start":15,"end":18,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}} } } ], diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/136/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/136/output.json index bdd81eaa2c..fcd59e9c91 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/136/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/136/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":9,"end":28,"loc":{"start":{"line":1,"column":9},"end":{"line":4,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":12,"end":17,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":6}}, "key": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 2 - }, - "identifierName": "p" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":2},"identifierName":"p"}, "name": "p" }, "static": false, @@ -114,18 +35,7 @@ "method": false, "value": { "type": "ObjectTypeAnnotation", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":15,"end":17,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "callProperties": [], "properties": [], "indexers": [], @@ -138,32 +48,10 @@ }, { "type": "ObjectTypeSpreadProperty", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":20,"end":25,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":6}}, "argument": { "type": "ObjectTypeAnnotation", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":23,"end":25,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":6}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/137/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/137/output.json index 2e33b31f6c..1c70bbf4c4 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/137/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/137/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "errors": [ "SyntaxError: Spread operator cannot appear in class or interface definitions (2:1)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "typeParameters": null, @@ -69,48 +24,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeSpreadProperty", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":15,"end":21,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":7}}, "argument": { "type": "AnyTypeAnnotation", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - } + "start":18,"end":21,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}} } } ], @@ -121,18 +43,7 @@ }, { "type": "EmptyStatement", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 2 - } - } + "start":24,"end":25,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":2}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/138/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/138/output.json index 6e48beeb05..85b02bb6fd 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/138/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/138/output.json @@ -1,272 +1,80 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "body": [] } }, { "type": "ClassDeclaration", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":11,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "B" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"B"}, "name": "B" }, "superClass": null, "body": { "type": "ClassBody", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":10}}, "body": [] } }, { "type": "TypeAlias", - "start": 22, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":22,"end":43,"loc":{"start":{"line":3,"column":0},"end":{"line":5,"column":2}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "C" - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":6},"identifierName":"C"}, "name": "C" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 31, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":31,"end":42,"loc":{"start":{"line":3,"column":9},"end":{"line":5,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeSpreadProperty", - "start": 34, - "end": 40, - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":34,"end":40,"loc":{"start":{"line":4,"column":1},"end":{"line":4,"column":7}}, "argument": { "type": "IntersectionTypeAnnotation", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":37,"end":40,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":7}}, "types": [ { "type": "GenericTypeAnnotation", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":37,"end":38,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":5}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "A" - }, + "start":37,"end":38,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":5},"identifierName":"A"}, "name": "A" } }, { "type": "GenericTypeAnnotation", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":39,"end":40,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":7}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "B" - }, + "start":39,"end":40,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":7},"identifierName":"B"}, "name": "B" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/139/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/139/output.json index 6d1756ac62..f3000dfc44 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/139/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/139/output.json @@ -1,178 +1,54 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "errors": [ "SyntaxError: Spread properties cannot have variance (3:1)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "body": [] } }, { "type": "TypeAlias", - "start": 11, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":11,"end":31,"loc":{"start":{"line":2,"column":0},"end":{"line":4,"column":2}}, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "C" - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"C"}, "name": "C" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":20,"end":30,"loc":{"start":{"line":2,"column":9},"end":{"line":4,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeSpreadProperty", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":23,"end":28,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":6}}, "argument": { "type": "GenericTypeAnnotation", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":6}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "A" - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":6},"identifierName":"A"}, "name": "A" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/14/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/14/output.json index f3c78da12e..9360adf64e 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/14/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/14/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -66,115 +21,37 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 14, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":14,"end":33,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":33}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 15, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":15,"end":33,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":33}}, "params": [ { "type": "FunctionTypeParam", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}}, "name": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "_" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"_"}, "name": "_" }, "optional": false, "typeAnnotation": { "type": "BooleanTypeAnnotation", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}} } } ], "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 33 - } - } + "start":27,"end":33,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":33}} }, "typeParameters": null } }, "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/15/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/15/output.json index 6631ac13ba..f744349140 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/15/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/15/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -66,115 +21,37 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 14, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":14,"end":34,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":34}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 15, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":15,"end":34,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":34}}, "params": [ { "type": "FunctionTypeParam", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":16,"end":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23}}, "name": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "_" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"_"}, "name": "_" }, "optional": true, "typeAnnotation": { "type": "BooleanTypeAnnotation", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":19,"end":23,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":23}} } } ], "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 34 - } - } + "start":28,"end":34,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":34}} }, "typeParameters": null } }, "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/16/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/16/output.json index 59fe3a8d36..26c61b4ee1 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/16/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/16/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -66,32 +21,10 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "callProperties": [], "properties": [], "indexers": [], @@ -102,18 +35,7 @@ }, "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/17/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/17/output.json index 9996d286ce..eb1235cabc 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/17/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/17/output.json @@ -1,96 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, "async": false, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15}}, "params": [ { "type": "TypeParameter", - "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}}, "name": "T", "variance": null } @@ -99,18 +32,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/18/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/18/output.json index 3b6ab163af..b897ae7435 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/18/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/18/output.json @@ -1,113 +1,35 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, "async": false, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17}}, "params": [ { "type": "TypeParameter", - "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}}, "name": "T", "variance": null }, { "type": "TypeParameter", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "name": "S", "variance": null } @@ -116,18 +38,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/19/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/19/output.json index e78a8bfedd..79e4e33dcd 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/19/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/19/output.json @@ -1,143 +1,43 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "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" }, "right": { "type": "FunctionExpression", - "start": 2, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":2,"end":20,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":20}}, "id": null, "generator": false, "async": false, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "params": [ { "type": "TypeParameter", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "name": "T", "variance": null }, { "type": "TypeParameter", - "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}}, "name": "S", "variance": null } @@ -146,18 +46,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/2/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/2/output.json index 4dfea64eda..35af6cc8d2 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/2/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,66 +20,21 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "numVal" - }, + "start":13,"end":27,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":27},"identifierName":"numVal"}, "name": "numVal", "typeAnnotation": { "type": "TypeAnnotation", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } } } ], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/20/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/20/output.json index 040ff5318a..82b7ad2a96 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/20/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/20/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "operator": "=", "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" }, "right": { "type": "ObjectExpression", - "start": 2, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":2,"end":31,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":31}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":3,"end":30,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":30}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "fooProp" - }, + "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14},"identifierName":"fooProp"}, "name": "fooProp" }, "computed": false, @@ -131,66 +41,21 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "value" - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TypeAnnotation", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } } } ], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/21/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/21/output.json index 3e1eebe5e6..1ac23f768b 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/21/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/21/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "operator": "=", "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" }, "right": { "type": "ObjectExpression", - "start": 2, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":2,"end":36,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":36}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":3,"end":35,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":35}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "fooProp" - }, + "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14},"identifierName":"fooProp"}, "name": "fooProp" }, "computed": false, @@ -131,48 +41,14 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "value" - }, + "start":15,"end":27,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":27},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TypeAnnotation", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } } } @@ -180,48 +56,15 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33}}, "typeAnnotation": { "type": "VoidTypeAnnotation", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 33 - } - } + "start":29,"end":33,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":33}} } }, "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/22/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/22/output.json index c6dd81472c..d9e9cf0243 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/22/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/22/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "operator": "=", "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" }, "right": { "type": "ObjectExpression", - "start": 2, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":2,"end":26,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":26}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":3,"end":25,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":25}}, "method": false, "key": { "type": "Identifier", - "start": 7, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "fooProp" - }, + "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14},"identifierName":"fooProp"}, "name": "fooProp" }, "computed": false, @@ -132,48 +42,15 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":16,"end":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} } }, "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/23/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/23/output.json index fdb2eedcb0..802ad5904c 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/23/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/23/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "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" }, "right": { "type": "ObjectExpression", - "start": 2, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":2,"end":21,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":21}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":3,"end":20,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":20}}, "method": true, "key": { "type": "Identifier", - "start": 3, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "id" - }, + "start":3,"end":5,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":5},"identifierName":"id"}, "name": "id" }, "computed": false, @@ -130,64 +40,18 @@ "params": [ { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "T" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"T"}, "name": "T" } } @@ -197,98 +61,31 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "T" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"T"}, "name": "T" } } }, "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "params": [ { "type": "TypeParameter", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "name": "T", "variance": null } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/24/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/24/output.json index 243a1e66ff..af9300c4a2 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/24/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/24/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "operator": "=", "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" }, "right": { "type": "ObjectExpression", - "start": 2, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":2,"end":22,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":3,"end":21,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":21}}, "method": true, "key": { "type": "Identifier", - "start": 4, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "id" - }, + "start":4,"end":6,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":6},"identifierName":"id"}, "name": "id" }, "computed": false, @@ -130,64 +40,18 @@ "params": [ { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "x" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "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}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"T"}, "name": "T" } } @@ -197,98 +61,31 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "T" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"T"}, "name": "T" } } }, "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9}}, "params": [ { "type": "TypeParameter", - "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}}, "name": "T", "variance": null } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/25/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/25/output.json index 1a1c2f0c3a..960cfe4635 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/25/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/25/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "operator": "=", "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" }, "right": { "type": "ObjectExpression", - "start": 2, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":2,"end":27,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":27}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":3,"end":26,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":26}}, "method": true, "key": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "id" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"id"}, "name": "id" }, "computed": false, @@ -130,64 +40,18 @@ "params": [ { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "x" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "T" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"T"}, "name": "T" } } @@ -197,98 +61,31 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "T" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"T"}, "name": "T" } } }, "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "params": [ { "type": "TypeParameter", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "name": "T", "variance": null } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/26/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/26/output.json index b71853c1e1..910ef40401 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/26/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/26/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "operator": "=", "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" }, "right": { "type": "ObjectExpression", - "start": 2, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":2,"end":22,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectMethod", - "start": 3, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":3,"end":21,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":21}}, "method": true, "key": { "type": "NumericLiteral", - "start": 3, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":3,"end":6,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":6}}, "extra": { "rawValue": 123, "raw": "123" @@ -133,64 +44,18 @@ "params": [ { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "x" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "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}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"T"}, "name": "T" } } @@ -200,98 +65,31 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "T" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"T"}, "name": "T" } } }, "body": { "type": "BlockStatement", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [], "directives": [] }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9}}, "params": [ { "type": "TypeParameter", - "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}}, "name": "T", "variance": null } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/27/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/27/output.json index d69487e11e..a4834c4fa0 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/27/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/27/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":10,"end":39,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":39}}, "body": [ { "type": "ClassMethod", - "start": 11, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":11,"end":38,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":38}}, "static": false, "key": { "type": "Identifier", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "fooProp" - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22},"identifierName":"fooProp"}, "name": "fooProp" }, "computed": false, @@ -116,66 +37,21 @@ "params": [ { "type": "Identifier", - "start": 23, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "value" - }, + "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TypeAnnotation", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":29,"end":35,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":35}} } } } ], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/28/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/28/output.json index 6ba209d0a6..4d69f59496 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/28/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/28/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":10,"end":44,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":44}}, "body": [ { "type": "ClassMethod", - "start": 11, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":11,"end":43,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":43}}, "static": false, "key": { "type": "Identifier", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "fooProp" - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22},"identifierName":"fooProp"}, "name": "fooProp" }, "computed": false, @@ -116,48 +37,14 @@ "params": [ { "type": "Identifier", - "start": 23, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "value" - }, + "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TypeAnnotation", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":29,"end":35,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":35}} } } } @@ -165,48 +52,15 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 36, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":36,"end":41,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":41}}, "typeAnnotation": { "type": "VoidTypeAnnotation", - "start": 37, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 41 - } - } + "start":37,"end":41,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":41}} } }, "body": { "type": "BlockStatement", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":41,"end":43,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":43}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/29/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/29/output.json index f57534e022..c1a395b6a5 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/29/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/29/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":10,"end":34,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":34}}, "body": [ { "type": "ClassMethod", - "start": 11, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":11,"end":33,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":33}}, "static": false, "key": { "type": "Identifier", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "fooProp" - }, + "start":15,"end":22,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":22},"identifierName":"fooProp"}, "name": "fooProp" }, "computed": false, @@ -117,48 +38,15 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":25,"end":31,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":31}} } }, "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/3/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/3/output.json index d38270441c..8eb0e2fe68 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/3/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,113 +20,34 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "numVal" - }, + "start":13,"end":27,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":27},"identifierName":"numVal"}, "name": "numVal", "typeAnnotation": { "type": "TypeAnnotation", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } } }, { "type": "Identifier", - "start": 29, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "strVal" - }, + "start":29,"end":43,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":43},"identifierName":"strVal"}, "name": "strVal", "typeAnnotation": { "type": "TypeAnnotation", - "start": 35, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":35,"end":43,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":43}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - } + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43}} } } } ], "body": { "type": "BlockStatement", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":44,"end":46,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":46}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/30/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/30/output.json index 3a14103ed5..d4c417b0e4 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/30/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/30/output.json @@ -1,107 +1,29 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "numVal" - }, + "start":4,"end":17,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":17},"identifierName":"numVal"}, "name": "numVal", "typeAnnotation": { "type": "TypeAnnotation", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}} } } }, diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/31/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/31/output.json index 17fdd74e26..60092a40b6 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/31/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/31/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":4,"end":31,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 4, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "numVal" - }, + "start":4,"end":17,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":17},"identifierName":"numVal"}, "name": "numVal", "typeAnnotation": { "type": "TypeAnnotation", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}} } } }, "init": { "type": "Identifier", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "otherNumVal" - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31},"identifierName":"otherNumVal"}, "name": "otherNumVal" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/32/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/32/output.json index 70cbbd4fef..928d31152f 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/32/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/32/output.json @@ -1,138 +1,37 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":4,"end":23,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 4, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "a" - }, + "start":4,"end":23,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":23},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":5,"end":23,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 7, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":7,"end":23,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":23}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":22}}, "key": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "numVal" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"numVal"}, "name": "numVal" }, "static": false, @@ -141,18 +40,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} }, "variance": null, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/33/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/33/output.json index 1ef29b3b8b..c60afd7b1e 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/33/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/33/output.json @@ -1,138 +1,37 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "a" - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":5,"end":24,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":24}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 7, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":24}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":22}}, "key": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "numVal" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"numVal"}, "name": "numVal" }, "static": false, @@ -141,18 +40,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} }, "variance": null, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/34/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/34/output.json index b389c49201..d77d9d0337 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/34/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/34/output.json @@ -1,138 +1,37 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":4,"end":50,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":50}}, "id": { "type": "Identifier", - "start": 4, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 50 - }, - "identifierName": "a" - }, + "start":4,"end":50,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":50},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":5,"end":50,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":50}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 7, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":7,"end":50,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":50}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":22}}, "key": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "numVal" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"numVal"}, "name": "numVal" }, "static": false, @@ -141,18 +40,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} }, "variance": null, "optional": false @@ -161,65 +49,20 @@ "indexers": [ { "type": "ObjectTypeIndexer", - "start": 24, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":24,"end":49,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":49}}, "static": false, "id": { "type": "Identifier", - "start": 25, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "indexer" - }, + "start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32},"identifierName":"indexer"}, "name": "indexer" }, "key": { "type": "StringTypeAnnotation", - "start": 34, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 40 - } - } + "start":34,"end":40,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":40}} }, "value": { "type": "NumberTypeAnnotation", - "start": 43, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 49 - } - } + "start":43,"end":49,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":49}} }, "variance": null } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/35/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/35/output.json index cc227490d3..841e2e0c04 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/35/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/35/output.json @@ -1,152 +1,40 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "a" - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":5,"end":24,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":24}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 7, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":24}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 8, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":8,"end":24,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":24}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "key": { "type": "Identifier", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "numVal" - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15},"identifierName":"numVal"}, "name": "numVal" }, "static": false, @@ -155,18 +43,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} }, "variance": null, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/36/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/36/output.json index 431aa501bc..7420828cc8 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/36/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/36/output.json @@ -1,138 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":4,"end":39,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":39}}, "id": { "type": "Identifier", - "start": 4, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "a" - }, + "start":4,"end":39,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":39},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":5,"end":39,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":39}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 7, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":7,"end":39,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":39}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":22}}, "key": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "numVal" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"numVal"}, "name": "numVal" }, "static": false, @@ -141,51 +40,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 24, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":24,"end":38,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":38}}, "key": { "type": "Identifier", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "strVal" - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30},"identifierName":"strVal"}, "name": "strVal" }, "static": false, @@ -194,18 +59,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - } + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}} }, "variance": null, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/37/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/37/output.json index 428bb08cb9..3b3472e5d1 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/37/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/37/output.json @@ -1,138 +1,37 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":4,"end":33,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 4, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "a" - }, + "start":4,"end":33,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":33},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":5,"end":33,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":33}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 7, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":7,"end":33,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":33}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 8, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":8,"end":32,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":32}}, "key": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "subObj" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"subObj"}, "name": "subObj" }, "static": false, @@ -141,49 +40,15 @@ "method": false, "value": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":16,"end":32,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":32}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 17, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":17,"end":31,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":31}}, "key": { "type": "Identifier", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "strVal" - }, + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23},"identifierName":"strVal"}, "name": "strVal" }, "static": false, @@ -192,18 +57,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":25,"end":31,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":31}} }, "variance": null, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/38/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/38/output.json index 0e133ba1cf..cd5d4d6e48 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/38/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/38/output.json @@ -1,138 +1,37 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":4,"end":34,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 4, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "a" - }, + "start":4,"end":34,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":34},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":5,"end":34,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":34}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 7, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":7,"end":34,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":34}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 8, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":8,"end":33,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":33}}, "key": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "subObj" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"subObj"}, "name": "subObj" }, "static": false, @@ -141,63 +40,18 @@ "method": false, "value": { "type": "NullableTypeAnnotation", - "start": 16, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":16,"end":33,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":33}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 17, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":17,"end":33,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":33}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "key": { "type": "Identifier", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "strVal" - }, + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24},"identifierName":"strVal"}, "name": "strVal" }, "static": false, @@ -206,18 +60,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - } + "start":26,"end":32,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":32}} }, "variance": null, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/39/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/39/output.json index 03cc703ab8..5d8ef8f03b 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/39/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/39/output.json @@ -1,138 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":4,"end":39,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":39}}, "id": { "type": "Identifier", - "start": 4, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "a" - }, + "start":4,"end":39,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":39},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":5,"end":39,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":39}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 7, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":7,"end":39,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":39}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":22}}, "key": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "param1" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"param1"}, "name": "param1" }, "static": false, @@ -141,51 +40,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 24, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":24,"end":38,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":38}}, "key": { "type": "Identifier", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "param2" - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30},"identifierName":"param2"}, "name": "param2" }, "static": false, @@ -194,18 +59,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - } + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}} }, "variance": null, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/4/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/4/output.json index 961fcf35dc..3b1f45e1a9 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/4/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,83 +20,26 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "numVal" - }, + "start":13,"end":27,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":27},"identifierName":"numVal"}, "name": "numVal", "typeAnnotation": { "type": "TypeAnnotation", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } } }, { "type": "Identifier", - "start": 29, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "untypedVal" - }, + "start":29,"end":39,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":39},"identifierName":"untypedVal"}, "name": "untypedVal" } ], "body": { "type": "BlockStatement", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":40,"end":42,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":42}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/40/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/40/output.json index 2cfc8de959..817f27b399 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/40/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/40/output.json @@ -1,138 +1,37 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":4,"end":40,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":40}}, "id": { "type": "Identifier", - "start": 4, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "a" - }, + "start":4,"end":40,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":40},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":5,"end":40,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":40}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 7, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":7,"end":40,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":40}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":8,"end":22,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":22}}, "key": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "param1" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"param1"}, "name": "param1" }, "static": false, @@ -141,51 +40,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 24, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":24,"end":39,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":39}}, "key": { "type": "Identifier", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "param2" - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30},"identifierName":"param2"}, "name": "param2" }, "static": false, @@ -194,18 +59,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - } + "start":33,"end":39,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":39}} }, "variance": null, "optional": true diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/41/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/41/output.json index 2f073e822e..7bdf8b2190 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/41/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/41/output.json @@ -1,235 +1,67 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":4,"end":52,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":52}}, "id": { "type": "Identifier", - "start": 4, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 52 - }, - "identifierName": "a" - }, + "start":4,"end":52,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":52},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":5,"end":52,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":52}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 7, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":7,"end":52,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":52}}, "callProperties": [], "properties": [], "indexers": [ { "type": "ObjectTypeIndexer", - "start": 9, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":9,"end":28,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":28}}, "static": false, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a" }, "key": { "type": "NumberTypeAnnotation", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}} }, "value": { "type": "StringTypeAnnotation", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":22,"end":28,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":28}} }, "variance": null }, { "type": "ObjectTypeIndexer", - "start": 30, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":30,"end":49,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":49}}, "static": false, "id": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "b" - }, + "start":31,"end":32,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":32},"identifierName":"b"}, "name": "b" }, "key": { "type": "NumberTypeAnnotation", - "start": 34, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 40 - } - } + "start":34,"end":40,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":40}} }, "value": { "type": "StringTypeAnnotation", - "start": 43, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 49 - } - } + "start":43,"end":49,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":49}} }, "variance": null } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/42/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/42/output.json index b918a1e51b..3e4e5b0900 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/42/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/42/output.json @@ -1,138 +1,37 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":4,"end":48,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":48}}, "id": { "type": "Identifier", - "start": 4, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "a" - }, + "start":4,"end":48,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":48},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":5,"end":48,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":48}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 7, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":7,"end":48,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":48}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 8, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":8,"end":47,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":47}}, "key": { "type": "Identifier", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "add" - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11},"identifierName":"add"}, "name": "add" }, "static": false, @@ -141,161 +40,48 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 8, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":8,"end":47,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":47}}, "params": [ { "type": "FunctionTypeParam", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "name": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" }, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}} } } ], "rest": { "type": "FunctionTypeParam", - "start": 25, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":25,"end":40,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":40}}, "name": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "y" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"y"}, "name": "y" }, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 27, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":27,"end":40,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":40}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 32, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":32,"end":40,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":40}}, "params": [ { "type": "StringTypeAnnotation", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - } + "start":33,"end":39,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":39}} } ] }, "id": { "type": "Identifier", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "Array" - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32},"identifierName":"Array"}, "name": "Array" } } @@ -303,18 +89,7 @@ "typeParameters": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 43, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 47 - } - } + "start":43,"end":47,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":47}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/43/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/43/output.json index 05ff2466b9..049308dd2a 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/43/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/43/output.json @@ -1,138 +1,37 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":4,"end":26,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":26}}, "id": { "type": "Identifier", - "start": 4, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "a" - }, + "start":4,"end":26,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":26},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":5,"end":26,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":26}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 7, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":7,"end":26,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":26}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "key": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "id" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"id"}, "name": "id" }, "static": false, @@ -141,81 +40,24 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "params": [ { "type": "FunctionTypeParam", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19}}, "name": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "x" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"x"}, "name": "x" }, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "T" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"T"}, "name": "T" } } @@ -224,33 +66,11 @@ "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "params": [ { "type": "TypeParameter", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "name": "T", "variance": null } @@ -258,34 +78,11 @@ }, "returnType": { "type": "GenericTypeAnnotation", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "T" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/44/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/44/output.json index 90d3059923..1e24e55010 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/44/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/44/output.json @@ -1,154 +1,42 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":4,"end":31,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "a" - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":5,"end":19,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":19}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 6, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":6,"end":19,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":19}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19}}, "params": [ { "type": "NumberTypeAnnotation", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}} } ] }, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "Array" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"Array"}, "name": "Array" } } @@ -156,33 +44,11 @@ }, "init": { "type": "ArrayExpression", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31}}, "elements": [ { "type": "NumericLiteral", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "extra": { "rawValue": 1, "raw": "1" @@ -191,18 +57,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": 2, "raw": "2" @@ -211,18 +66,7 @@ }, { "type": "NumericLiteral", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30}}, "extra": { "rawValue": 3, "raw": "3" diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/45/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/45/output.json index 37ca8f2e16..5eafd0af6f 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/45/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/45/output.json @@ -1,140 +1,39 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "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" }, "right": { "type": "ClassExpression", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "Foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"Foo"}, "name": "Foo" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16}}, "params": [ { "type": "TypeParameter", - "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}}, "name": "T", "variance": null } @@ -143,18 +42,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/46/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/46/output.json index 90645ea051..0c2248fd3c 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/46/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/46/output.json @@ -1,140 +1,39 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "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" }, "right": { "type": "ClassExpression", - "start": 4, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":4,"end":35,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":35}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "Foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"Foo"}, "name": "Foo" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16}}, "params": [ { "type": "TypeParameter", - "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}}, "name": "T", "variance": null } @@ -142,66 +41,20 @@ }, "superClass": { "type": "Identifier", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "Bar" - }, + "start":25,"end":28,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":28},"identifierName":"Bar"}, "name": "Bar" }, "superTypeParameters": { "type": "TypeParameterInstantiation", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":28,"end":31,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":31}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "T" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"T"}, "name": "T" } } @@ -209,18 +62,7 @@ }, "body": { "type": "ClassBody", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":32,"end":35,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":35}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/47/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/47/output.json index 25f26298f0..0a761b0f74 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/47/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/47/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "params": [ { "type": "TypeParameter", - "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}}, "name": "T", "variance": null } @@ -97,18 +30,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/48/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/48/output.json index 70f45659a6..6609f33d45 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/48/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/48/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "id": { "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" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "params": [ { "type": "TypeParameter", - "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}}, "name": "T", "variance": null } @@ -96,66 +29,20 @@ }, "superClass": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "Bar" - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24},"identifierName":"Bar"}, "name": "Bar" }, "superTypeParameters": { "type": "TypeParameterInstantiation", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "T" - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26},"identifierName":"T"}, "name": "T" } } @@ -163,18 +50,7 @@ }, "body": { "type": "ClassBody", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":28,"end":31,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":31}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/49/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/49/output.json index 2696706022..a0425a4573 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/49/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/49/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "params": [ { "type": "TypeParameter", - "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}}, "name": "T", "variance": null } @@ -96,69 +29,23 @@ }, "superClass": { "type": "CallExpression", - "start": 21, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":21,"end":31,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":31}}, "callee": { "type": "Identifier", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "mixin" - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26},"identifierName":"mixin"}, "name": "mixin" }, "arguments": [ { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "Bar" - }, + "start":27,"end":30,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":30},"identifierName":"Bar"}, "name": "Bar" } ] }, "body": { "type": "ClassBody", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":32,"end":35,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":35}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/5/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/5/output.json index 775ca31fcb..08ad1d80a7 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/5/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/5/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,83 +20,26 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "untypedVal" - }, + "start":13,"end":23,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":23},"identifierName":"untypedVal"}, "name": "untypedVal" }, { "type": "Identifier", - "start": 25, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "numVal" - }, + "start":25,"end":39,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":39},"identifierName":"numVal"}, "name": "numVal", "typeAnnotation": { "type": "TypeAnnotation", - "start": 31, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":31,"end":39,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":39}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - } + "start":33,"end":39,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":39}} } } } ], "body": { "type": "BlockStatement", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":40,"end":42,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":42}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/50/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/50/output.json index 27ee33be5e..5d7bbfd9f0 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/50/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/50/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "params": [ { "type": "TypeParameter", - "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}}, "name": "T", "variance": null } @@ -97,82 +30,26 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 13, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":13,"end":46,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":46}}, "body": [ { "type": "ClassMethod", - "start": 15, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":15,"end":45,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":45}}, "static": false, "key": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "bar" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"bar"}, "name": "bar" }, "computed": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "params": [ { "type": "TypeParameter", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "name": "U", "variance": null } @@ -185,77 +62,22 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 23, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":23,"end":30,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":30}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}} } }, "body": { "type": "BlockStatement", - "start": 31, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":31,"end":45,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":45}}, "body": [ { "type": "ReturnStatement", - "start": 33, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":33,"end":43,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":43}}, "argument": { "type": "NumericLiteral", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":40,"end":42,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":42}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/51/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/51/output.json index 30bfca7bc1..49eecab002 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/51/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/51/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":10,"end":28,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":28}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":12,"end":26,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":26}}, "static": false, "key": { "type": "StringLiteral", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" @@ -115,33 +37,11 @@ "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "params": [ { "type": "TypeParameter", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "name": "T", "variance": null } @@ -153,18 +53,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":23,"end":26,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":26}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/52/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/52/output.json index 8bab5ed802..34692af685 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/52/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/52/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,54 +20,19 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "requiredParam" - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26},"identifierName":"requiredParam"}, "name": "requiredParam" }, { "type": "Identifier", - "start": 28, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "optParam" - }, + "start":28,"end":37,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":37},"identifierName":"optParam"}, "name": "optParam", "optional": true } ], "body": { "type": "BlockStatement", - "start": 39, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":39,"end":41,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":41}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/53/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/53/output.json index 97967a24ad..5115a9a3f1 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/53/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/53/output.json @@ -1,209 +1,63 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":10,"end":41,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":41}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":12,"end":25,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":25}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "prop1" - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17},"identifierName":"prop1"}, "name": "prop1" }, "computed": false, "variance": null, "typeAnnotation": { "type": "TypeAnnotation", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}} } }, "value": null }, { "type": "ClassProperty", - "start": 26, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":26,"end":39,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":39}}, "static": false, "key": { "type": "Identifier", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "prop2" - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31},"identifierName":"prop2"}, "name": "prop2" }, "computed": false, "variance": null, "typeAnnotation": { "type": "TypeAnnotation", - "start": 31, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":31,"end":38,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":38}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - } + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}} } }, "value": null diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/54/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/54/output.json index 9d7ab3c84a..7ce1b31f8b 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/54/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/54/output.json @@ -1,209 +1,63 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":10,"end":48,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":48}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":12,"end":32,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":32}}, "static": true, "key": { "type": "Identifier", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "prop1" - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24},"identifierName":"prop1"}, "name": "prop1" }, "computed": false, "variance": null, "typeAnnotation": { "type": "TypeAnnotation", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":25,"end":31,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":31}} } }, "value": null }, { "type": "ClassProperty", - "start": 33, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":33,"end":46,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":46}}, "static": false, "key": { "type": "Identifier", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "prop2" - }, + "start":33,"end":38,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":38},"identifierName":"prop2"}, "name": "prop2" }, "computed": false, "variance": null, "typeAnnotation": { "type": "TypeAnnotation", - "start": 38, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":38,"end":45,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":45}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 39, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 45 - } - } + "start":39,"end":45,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":45}} } }, "value": null diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/55/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/55/output.json index 723428d1e0..eff3ad308a 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/55/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/55/output.json @@ -1,137 +1,37 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 4, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "x" - }, + "start":4,"end":23,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":23},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":6,"end":23,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "UnionTypeAnnotation", - "start": 8, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":8,"end":23,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":23}}, "types": [ { "type": "NumberTypeAnnotation", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}} }, { "type": "StringTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} } ] } @@ -139,18 +39,7 @@ }, "init": { "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": 4, "raw": "4" diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/56/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/56/output.json index 0008b902d0..60b7295b82 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/56/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/56/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "Array" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"Array"}, "name": "Array" }, "superClass": null, "body": { "type": "ClassBody", - "start": 12, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":12,"end":49,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":49}}, "body": [ { "type": "ClassMethod", - "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}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "concat" - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20},"identifierName":"concat"}, "name": "concat" }, "computed": false, @@ -116,78 +37,22 @@ "params": [ { "type": "Identifier", - "start": 21, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "items" - }, + "start":21,"end":42,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":42},"identifierName":"items"}, "name": "items", "typeAnnotation": { "type": "TypeAnnotation", - "start": 26, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":26,"end":42,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":42}}, "typeAnnotation": { "type": "UnionTypeAnnotation", - "start": 27, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":27,"end":42,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":42}}, "types": [ { "type": "NumberTypeAnnotation", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 33 - } - } + "start":27,"end":33,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":33}} }, { "type": "StringTypeAnnotation", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } - } + "start":36,"end":42,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":42}} } ] } @@ -196,18 +61,7 @@ ], "body": { "type": "BlockStatement", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":44,"end":46,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":46}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/57/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/57/output.json index 6ae0568ada..b19b04b972 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/57/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/57/output.json @@ -1,169 +1,47 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":4,"end":40,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":40}}, "id": { "type": "Identifier", - "start": 4, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "x" - }, + "start":4,"end":35,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":35},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":6,"end":35,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":35}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 8, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":8,"end":35,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":35}}, "params": [], "rest": null, "returnType": { "type": "UnionTypeAnnotation", - "start": 14, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":14,"end":35,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":35}}, "types": [ { "type": "NumberTypeAnnotation", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}} }, { "type": "FunctionTypeAnnotation", - "start": 23, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, "params": [], "rest": null, "returnType": { "type": "StringTypeAnnotation", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":29,"end":35,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":35}} }, "typeParameters": null } @@ -175,19 +53,7 @@ }, "init": { "type": "Identifier", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "fn" - }, + "start":38,"end":40,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":40},"identifierName":"fn"}, "name": "fn" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/58/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/58/output.json index 01df1e9622..a675fbe305 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/58/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/58/output.json @@ -1,137 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 4, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":4,"end":15,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":5,"end":15,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":15}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "argument": { "type": "GenericTypeAnnotation", - "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}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "Y" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"Y"}, "name": "Y" } } @@ -140,19 +39,7 @@ }, "init": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "Y" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"Y"}, "name": "Y" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/59/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/59/output.json index 946010a4c0..50bf337b38 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/59/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/59/output.json @@ -1,170 +1,47 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":4,"end":28,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "x" - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":5,"end":24,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":24}}, "typeAnnotation": { "type": "UnionTypeAnnotation", - "start": 7, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":24}}, "types": [ { "type": "TypeofTypeAnnotation", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "argument": { "type": "GenericTypeAnnotation", - "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}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "Y" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"Y"}, "name": "Y" } } }, { "type": "NumberTypeAnnotation", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}} } ] } @@ -172,19 +49,7 @@ }, "init": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "Y" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"Y"}, "name": "Y" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/6/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/6/output.json index 13e6d6b9d2..998d6746f5 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/6/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/6/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,62 +20,17 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "nullableNum" - }, + "start":13,"end":33,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":33},"identifierName":"nullableNum"}, "name": "nullableNum", "typeAnnotation": { "type": "TypeAnnotation", - "start": 24, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":24,"end":33,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":33}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":26,"end":33,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":33}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 33 - } - } + "start":27,"end":33,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":33}} } } } @@ -128,18 +38,7 @@ ], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/60/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/60/output.json index cfa5f6db54..cd0f73c910 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/60/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/60/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":4,"end":39,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":39}}, "id": { "type": "ObjectPattern", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "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" }, "extra": { @@ -131,63 +41,18 @@ ], "typeAnnotation": { "type": "TypeAnnotation", - "start": 7, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":7,"end":22,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":22}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 10, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19}}, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" }, "static": false, @@ -196,18 +61,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}} }, "variance": null, "optional": false @@ -222,67 +76,22 @@ }, "init": { "type": "ObjectExpression", - "start": 25, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":25,"end":39,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":39}}, "properties": [ { "type": "ObjectProperty", - "start": 27, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":27,"end":37,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":37}}, "method": false, "key": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "x" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "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": "hello", "raw": "\"hello\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/61/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/61/output.json index 25d46071b8..1d30c09879 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/61/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/61/output.json @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":4,"end":38,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":38}}, "id": { "type": "ObjectPattern", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":4,"end":21,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":21}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "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" }, "computed": false, "shorthand": true, "value": { "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" }, "extra": { @@ -131,63 +41,18 @@ ], "typeAnnotation": { "type": "TypeAnnotation", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":21}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 10, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19}}, "key": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" }, "static": false, @@ -196,18 +61,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}} }, "variance": null, "optional": false @@ -222,67 +76,22 @@ }, "init": { "type": "ObjectExpression", - "start": 24, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":24,"end":38,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":38}}, "properties": [ { "type": "ObjectProperty", - "start": 26, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":26,"end":36,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":36}}, "method": false, "key": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "x" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 29, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":29,"end":36,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":36}}, "extra": { "rawValue": "hello", "raw": "\"hello\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/62/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/62/output.json index ab167c1f81..f53f696781 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/62/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/62/output.json @@ -1,171 +1,48 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36}}, "id": { "type": "ArrayPattern", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "elements": [ { "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" } ], "typeAnnotation": { "type": "TypeAnnotation", - "start": 7, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":7,"end":22,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":22}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":14,"end":22,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":22}}, "params": [ { "type": "StringTypeAnnotation", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}} } ] }, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "Array" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"Array"}, "name": "Array" } } @@ -173,33 +50,11 @@ }, "init": { "type": "ArrayExpression", - "start": 25, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":25,"end":36,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":36}}, "elements": [ { "type": "StringLiteral", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34}}, "extra": { "rawValue": "hello", "raw": "\"hello\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/63/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/63/output.json index e9fb827b5b..2c7c6e3282 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/63/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/63/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,68 +20,22 @@ "params": [ { "type": "ObjectPattern", - "start": 13, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":13,"end":32,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":32}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" }, "extra": { @@ -136,63 +45,18 @@ ], "typeAnnotation": { "type": "TypeAnnotation", - "start": 16, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":16,"end":32,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":32}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":20,"end":29,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":29}}, "key": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"x"}, "name": "x" }, "static": false, @@ -201,18 +65,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - } - } + "start":23,"end":29,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":29}} }, "variance": null, "optional": false @@ -228,18 +81,7 @@ ], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/64/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/64/output.json index 0a9b33366f..d03e6ea7e4 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/64/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/64/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,112 +20,33 @@ "params": [ { "type": "ArrayPattern", - "start": 13, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":13,"end":31,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":31}}, "elements": [ { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x" } ], "typeAnnotation": { "type": "TypeAnnotation", - "start": 16, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":16,"end":31,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":31}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":18,"end":31,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":31}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 23, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":23,"end":31,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":31}}, "params": [ { "type": "StringTypeAnnotation", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}} } ] }, "id": { "type": "Identifier", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "Array" - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23},"identifierName":"Array"}, "name": "Array" } } @@ -179,18 +55,7 @@ ], "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/65/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/65/output.json index ffa3d31494..4b9e6ec20f 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/65/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/65/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,110 +20,31 @@ "params": [ { "type": "RestElement", - "start": 13, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":13,"end":35,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":35}}, "argument": { "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "rest" - }, + "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"rest"}, "name": "rest" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 20, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":20,"end":35,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":35}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":22,"end":35,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":35}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 27, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":27,"end":35,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":35}}, "params": [ { "type": "NumberTypeAnnotation", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 34 - } - } + "start":28,"end":34,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":34}} } ] }, "id": { "type": "Identifier", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "Array" - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27},"identifierName":"Array"}, "name": "Array" } } @@ -177,18 +53,7 @@ ], "body": { "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":37,"end":39,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":39}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/66/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/66/output.json index 5585c51d80..d8f6311f03 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/66/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/66/output.json @@ -1,172 +1,49 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "FunctionExpression", - "start": 1, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":1,"end":37,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":37}}, "id": null, "generator": false, "async": false, "params": [ { "type": "RestElement", - "start": 11, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":11,"end":33,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":33}}, "argument": { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "rest" - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"rest"}, "name": "rest" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 18, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":18,"end":33,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":33}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":20,"end":33,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":33}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 25, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":25,"end":33,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":33}}, "params": [ { "type": "NumberTypeAnnotation", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - } + "start":26,"end":32,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":32}} } ] }, "id": { "type": "Identifier", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "Array" - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"Array"}, "name": "Array" } } @@ -175,18 +52,7 @@ ], "body": { "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":35,"end":37,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":37}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/67/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/67/output.json index 867c7ca376..ebd6fd0fe1 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/67/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/67/output.json @@ -1,123 +1,34 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":10,"end":27,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":27}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}} } }, "id": null, @@ -126,19 +37,7 @@ "params": [], "body": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "bar" - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/68/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/68/output.json index e0b6a7e063..23c2533a8a 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/68/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/68/output.json @@ -1,123 +1,34 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":4,"end":30,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":30}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":10,"end":30,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":30}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} } }, "id": null, @@ -126,37 +37,13 @@ "params": [ { "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" } ], "body": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "bar" - }, + "start":27,"end":30,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":30},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/69/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/69/output.json index 9d9ac56c78..faebb38ba0 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/69/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/69/output.json @@ -1,158 +1,45 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":4,"end":42,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":42}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":10,"end":42,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":42}}, "id": null, "generator": false, "async": true, "params": [ { "type": "Identifier", - "start": 17, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "foo" - }, + "start":17,"end":25,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":25},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TypeAnnotation", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "bar" - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25},"identifierName":"bar"}, "name": "bar" } } @@ -160,64 +47,18 @@ }, { "type": "Identifier", - "start": 27, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "bar" - }, + "start":27,"end":35,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":35},"identifierName":"bar"}, "name": "bar", "typeAnnotation": { "type": "TypeAnnotation", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":32,"end":35,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":35}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "foo" - }, + "start":32,"end":35,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":35},"identifierName":"foo"}, "name": "foo" } } @@ -226,18 +67,7 @@ ], "body": { "type": "BlockStatement", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":40,"end":42,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":42}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/7/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/7/output.json index 04a418e70d..b49204c7f0 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/7/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/7/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,64 +20,19 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "callback" - }, + "start":13,"end":33,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":33},"identifierName":"callback"}, "name": "callback", "typeAnnotation": { "type": "TypeAnnotation", - "start": 21, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":21,"end":33,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":33}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":23,"end":33,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":33}}, "params": [], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 33 - } - } + "start":29,"end":33,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":33}} }, "typeParameters": null } @@ -131,18 +41,7 @@ ], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/70/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/70/output.json index 92c2e5e166..791438f7b7 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/70/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/70/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":4,"end":33,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":33}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":10,"end":33,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":33}}, "returnType": { "type": "TypeAnnotation", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - } + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26}} } }, "id": null, @@ -125,19 +36,7 @@ "params": [], "body": { "type": "Identifier", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "bar" - }, + "start":30,"end":33,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":33},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/71/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/71/output.json index e7baf1080c..0f66616e39 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/71/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/71/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":10,"end":36,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":36}}, "returnType": { "type": "TypeAnnotation", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - } - } + "start":23,"end":29,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":29}} } }, "id": null, @@ -125,37 +36,13 @@ "params": [ { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "bar" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"bar"}, "name": "bar" } ], "body": { "type": "Identifier", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "bar" - }, + "start":33,"end":36,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":36},"identifierName":"bar"}, "name": "bar" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/72/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/72/output.json index 605f524387..36bd9e3456 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/72/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/72/output.json @@ -1,123 +1,34 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":4,"end":29,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":29}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 11, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":11,"end":28,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":28}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}} } }, "id": null, @@ -126,19 +37,7 @@ "params": [], "body": { "type": "Identifier", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "bar" - }, + "start":25,"end":28,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":28},"identifierName":"bar"}, "name": "bar" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/73/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/73/output.json index 566e2fa3f5..910d7c4938 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/73/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/73/output.json @@ -1,123 +1,34 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":4,"end":32,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":32}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 11, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":11,"end":31,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":31}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 16, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":16,"end":24,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":24}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}} } }, "id": null, @@ -126,37 +37,13 @@ "params": [ { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "bar" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"bar"}, "name": "bar" } ], "body": { "type": "Identifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "bar" - }, + "start":28,"end":31,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":31},"identifierName":"bar"}, "name": "bar" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/74/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/74/output.json index 419b2b79b7..cb52b23baf 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/74/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/74/output.json @@ -1,137 +1,37 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":4,"end":42,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":42}}, "id": { "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" }, "init": { "type": "TypeCastExpression", - "start": 11, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":11,"end":41,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":41}}, "expression": { "type": "ArrowFunctionExpression", - "start": 12, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":12,"end":32,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":32}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 17, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":17,"end":25,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":25}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}} } }, "id": null, @@ -140,37 +40,13 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "bar" - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16},"identifierName":"bar"}, "name": "bar" } ], "body": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "bar" - }, + "start":29,"end":32,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":32},"identifierName":"bar"}, "name": "bar" }, "extra": { @@ -180,32 +56,10 @@ }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 33, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":33,"end":41,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":41}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - } - } + "start":35,"end":41,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":41}} } }, "extra": { diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/75/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/75/output.json index 6645958060..82bd2b624f 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/75/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/75/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":4,"end":35,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":35}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 11, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":11,"end":34,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":34}}, "returnType": { "type": "TypeAnnotation", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } }, "id": null, @@ -125,19 +36,7 @@ "params": [], "body": { "type": "Identifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "bar" - }, + "start":31,"end":34,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":34},"identifierName":"bar"}, "name": "bar" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/76/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/76/output.json index 584b5db6d3..fd87323be2 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/76/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/76/output.json @@ -1,122 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":4,"end":38,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":38}}, "id": { "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" }, "init": { "type": "ArrowFunctionExpression", - "start": 11, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":11,"end":37,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":37}}, "returnType": { "type": "TypeAnnotation", - "start": 22, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":22,"end":30,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":30}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}} } }, "id": null, @@ -125,37 +36,13 @@ "params": [ { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "bar" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"bar"}, "name": "bar" } ], "body": { "type": "Identifier", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "bar" - }, + "start":34,"end":37,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":37},"identifierName":"bar"}, "name": "bar" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/77/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/77/output.json index 7437eddc1e..34302acdb3 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/77/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/77/output.json @@ -1,136 +1,36 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":4,"end":48,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":48}}, "id": { "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" }, "init": { "type": "TypeCastExpression", - "start": 11, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":11,"end":47,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":47}}, "expression": { "type": "ArrowFunctionExpression", - "start": 12, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":12,"end":38,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":38}}, "returnType": { "type": "TypeAnnotation", - "start": 23, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":23,"end":31,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":31}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":25,"end":31,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":31}} } }, "id": null, @@ -139,37 +39,13 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "bar" - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22},"identifierName":"bar"}, "name": "bar" } ], "body": { "type": "Identifier", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "bar" - }, + "start":35,"end":38,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":38},"identifierName":"bar"}, "name": "bar" }, "extra": { @@ -179,32 +55,10 @@ }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 39, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":39,"end":47,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":47}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 41, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 47 - } - } + "start":41,"end":47,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":47}} } }, "extra": { diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/78/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/78/output.json index b2e8a95b4e..75b43c1f70 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/78/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/78/output.json @@ -1,126 +1,35 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":4,"end":30,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":30}}, "id": { "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" }, "init": { "type": "ConditionalExpression", - "start": 10, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":10,"end":30,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":30}}, "test": { "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" }, "consequent": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"foo"}, "name": "foo", "extra": { "parenthesized": true, @@ -129,19 +38,7 @@ }, "alternate": { "type": "Identifier", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "number" - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30},"identifierName":"number"}, "name": "number" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/79/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/79/output.json index 1fc7746138..b416d00df4 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/79/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/79/output.json @@ -1,154 +1,42 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":4,"end":42,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":42}}, "id": { "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" }, "init": { "type": "ConditionalExpression", - "start": 10, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":10,"end":42,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":42}}, "test": { "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" }, "consequent": { "type": "ArrowFunctionExpression", - "start": 16, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":16,"end":36,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":36}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 22, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":22,"end":30,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":30}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}} } }, "id": null, @@ -157,55 +45,20 @@ "params": [ { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"foo"}, "name": "foo" } ], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "body": [], "directives": [] } }, "alternate": { "type": "Identifier", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "baz" - }, + "start":39,"end":42,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":42},"identifierName":"baz"}, "name": "baz" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/8/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/8/output.json index fe6af71168..cbfbdd5166 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/8/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/8/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,64 +20,19 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "callback" - }, + "start":13,"end":35,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":35},"identifierName":"callback"}, "name": "callback", "typeAnnotation": { "type": "TypeAnnotation", - "start": 21, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":21,"end":35,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":35}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 23, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":23,"end":35,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":35}}, "params": [], "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":29,"end":35,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":35}} }, "typeParameters": null } @@ -131,18 +41,7 @@ ], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/80/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/80/output.json index c093290d0c..8750bcb379 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/80/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/80/output.json @@ -1,172 +1,49 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "expression": { "type": "ArrowFunctionExpression", - "start": 1, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":1,"end":33,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":33}}, "id": null, "generator": false, "async": false, "params": [ { "type": "RestElement", - "start": 2, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":2,"end":24,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":24}}, "argument": { "type": "Identifier", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "rest" - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9},"identifierName":"rest"}, "name": "rest" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 11, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":11,"end":24,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":24}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 16, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":16,"end":24,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":24}}, "params": [ { "type": "NumberTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} } ] }, "id": { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "Array" - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"Array"}, "name": "Array" } } @@ -175,19 +52,7 @@ ], "body": { "type": "Identifier", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "rest" - }, + "start":29,"end":33,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":33},"identifierName":"rest"}, "name": "rest" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/81/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/81/output.json index f9f9e396da..ec686f8401 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/81/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/81/output.json @@ -1,198 +1,53 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":4,"end":34,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 4, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "a" - }, + "start":4,"end":34,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":34},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":5,"end":34,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":34}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 7, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":7,"end":34,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":34}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 10, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":10,"end":34,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":34}}, "params": [ { "type": "StringTypeAnnotation", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}} }, { "type": "GenericTypeAnnotation", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":24,"end":32,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":32}}, "params": [ { "type": "StringTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":25,"end":31,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":31}} } ] }, "id": { "type": "Identifier", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "Array" - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24},"identifierName":"Array"}, "name": "Array" } } @@ -200,19 +55,7 @@ }, "id": { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "Map" - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"Map"}, "name": "Map" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/82/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/82/output.json index 910e0c6bfa..bd719a79fb 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/82/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/82/output.json @@ -1,198 +1,53 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":4,"end":33,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 4, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "a" - }, + "start":4,"end":33,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":33},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":5,"end":33,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":33}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 7, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":7,"end":33,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":33}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 10, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":10,"end":33,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":33}}, "params": [ { "type": "StringTypeAnnotation", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}} }, { "type": "GenericTypeAnnotation", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":19,"end":32,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":32}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":24,"end":32,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":32}}, "params": [ { "type": "StringTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":25,"end":31,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":31}} } ] }, "id": { "type": "Identifier", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "Array" - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24},"identifierName":"Array"}, "name": "Array" } } @@ -200,19 +55,7 @@ }, "id": { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "Map" - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"Map"}, "name": "Map" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/83/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/83/output.json index 06d26c8e36..fd6dd628c9 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/83/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/83/output.json @@ -1,121 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "a" - }, + "start":4,"end":15,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":15},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":5,"end":15,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":15}}, "typeAnnotation": { "type": "ArrayTypeAnnotation", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "elementType": { "type": "NumberTypeAnnotation", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/84/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/84/output.json index 3a08e3a099..ec4c620812 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/84/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/84/output.json @@ -1,135 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 4, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "a" - }, + "start":4,"end":16,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":16},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 7, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":7,"end":16,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":16}}, "typeAnnotation": { "type": "ArrayTypeAnnotation", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "elementType": { "type": "StringTypeAnnotation", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/85/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/85/output.json index e973dbacf6..8a1a9a3dd0 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/85/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/85/output.json @@ -1,168 +1,45 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "a" - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":5,"end":22,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":22}}, "typeAnnotation": { "type": "ArrayTypeAnnotation", - "start": 7, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":7,"end":22,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":22}}, "elementType": { "type": "GenericTypeAnnotation", - "start": 7, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":7,"end":20,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":20}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}}, "params": [ { "type": "BooleanTypeAnnotation", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19}} } ] }, "id": { "type": "Identifier", - "start": 7, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "Promise" - }, + "start":7,"end":14,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":14},"identifierName":"Promise"}, "name": "Promise" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/86/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/86/output.json index 508ef355a3..3f525d3603 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/86/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/86/output.json @@ -1,219 +1,62 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":4,"end":39,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":39}}, "id": { "type": "Identifier", - "start": 4, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "a" - }, + "start":4,"end":39,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":39},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":5,"end":39,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":39}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 6, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":6,"end":39,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":39}}, "params": [], "rest": { "type": "FunctionTypeParam", - "start": 10, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":10,"end":28,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":28}}, "name": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "rest" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"rest"}, "name": "rest" }, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":15,"end":28,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":28}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "params": [ { "type": "NumberTypeAnnotation", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } ] }, "id": { "type": "Identifier", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "Array" - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"Array"}, "name": "Array" } } }, "returnType": { "type": "NumberTypeAnnotation", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - } + "start":33,"end":39,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":39}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/87/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/87/output.json index d5d5e221c1..30d0d42c5f 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/87/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/87/output.json @@ -1,136 +1,36 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":4,"end":28,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 4, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "identity" - }, + "start":4,"end":28,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":28},"identifierName":"identity"}, "name": "identity", "typeAnnotation": { "type": "TypeAnnotation", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":12,"end":28,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":28}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 14, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":14,"end":28,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":28}}, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "params": [ { "type": "TypeParameter", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "name": "T", "variance": null } @@ -139,66 +39,20 @@ "params": [ { "type": "FunctionTypeParam", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "name": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"x"}, "name": "x" }, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "T" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"T"}, "name": "T" } } @@ -207,34 +61,11 @@ "rest": null, "returnType": { "type": "GenericTypeAnnotation", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "T" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/88/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/88/output.json index 669b435ac2..1b22c73f74 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/88/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/88/output.json @@ -1,136 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":4,"end":38,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":38}}, "id": { "type": "Identifier", - "start": 4, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "identity" - }, + "start":4,"end":38,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":38},"identifierName":"identity"}, "name": "identity", "typeAnnotation": { "type": "TypeAnnotation", - "start": 12, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":12,"end":38,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":38}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 14, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":14,"end":38,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":38}}, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "params": [ { "type": "TypeParameter", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "name": "T", "variance": null } @@ -139,66 +39,20 @@ "params": [ { "type": "FunctionTypeParam", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":18,"end":22,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":22}}, "name": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"x"}, "name": "x" }, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "T" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"T"}, "name": "T" } } @@ -206,80 +60,23 @@ ], "rest": { "type": "FunctionTypeParam", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32}}, "name": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "y" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"y"}, "name": "y" }, "optional": false, "typeAnnotation": { "type": "ArrayTypeAnnotation", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":29,"end":32,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":32}}, "elementType": { "type": "GenericTypeAnnotation", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "T" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"T"}, "name": "T" } } @@ -287,34 +84,11 @@ }, "returnType": { "type": "GenericTypeAnnotation", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":37,"end":38,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":38}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "T" - }, + "start":37,"end":38,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":38},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/9/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/9/output.json index ec5e4b479b..7cb400a2d9 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/9/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/9/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,113 +20,34 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "callback" - }, + "start":13,"end":41,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":41},"identifierName":"callback"}, "name": "callback", "typeAnnotation": { "type": "TypeAnnotation", - "start": 21, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":21,"end":41,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":41}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 23, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":23,"end":41,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":41}}, "params": [ { "type": "FunctionTypeParam", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}}, "name": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "_" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"_"}, "name": "_" }, "optional": false, "typeAnnotation": { "type": "BooleanTypeAnnotation", - "start": 26, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":26,"end":30,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":30}} } } ], "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - } - } + "start":35,"end":41,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":41}} }, "typeParameters": null } @@ -180,18 +56,7 @@ ], "body": { "type": "BlockStatement", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":42,"end":44,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":44}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/97/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/97/output.json index 3bbbf6d80d..a3f6ad7100 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/97/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/97/output.json @@ -1,143 +1,43 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":1,"end":23,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":23}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":2,"end":22,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":22}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "f" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"f"}, "name": "f" }, "computed": false, "shorthand": false, "value": { "type": "FunctionExpression", - "start": 5, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":5,"end":22,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":22}}, "id": null, "generator": false, "async": false, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "params": [ { "type": "TypeParameter", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "name": "T", "variance": null } @@ -146,18 +46,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/98/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/98/output.json index 6a24cf2f1e..051aff7dcd 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/98/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/98/output.json @@ -1,138 +1,37 @@ { "type": "File", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "program": { "type": "Program", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":4,"end":57,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":57}}, "id": { "type": "Identifier", - "start": 4, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 57 - }, - "identifierName": "a" - }, + "start":4,"end":57,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":57},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":5,"end":57,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":57}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 7, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":7,"end":57,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":57}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 8, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":8,"end":23,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":23}}, "key": { "type": "Identifier", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "param1" - }, + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14},"identifierName":"param1"}, "name": "param1" }, "static": false, @@ -141,51 +40,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} }, "variance": null, "optional": true }, { "type": "ObjectTypeProperty", - "start": 25, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":25,"end":39,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":39}}, "key": { "type": "Identifier", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "param2" - }, + "start":25,"end":31,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":31},"identifierName":"param2"}, "name": "param2" }, "static": false, @@ -194,51 +59,17 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - } + "start":33,"end":39,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":39}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 41, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":41,"end":55,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":55}}, "key": { "type": "Identifier", - "start": 41, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "param3" - }, + "start":41,"end":47,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":47},"identifierName":"param3"}, "name": "param3" }, "static": false, @@ -247,18 +78,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 49, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 55 - } - } + "start":49,"end":55,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":55}} }, "variance": null, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/99/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/99/output.json index b728bb8e6f..92a30707f5 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/99/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/99/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "z" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"z"}, "name": "z" } } @@ -112,53 +34,18 @@ "params": [ { "type": "Identifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "foo" - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"foo"}, "name": "foo" }, { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "bar" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"bar"}, "name": "bar" } ], "body": { "type": "NullLiteral", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/arrow-func-return-newline/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/arrow-func-return-newline/output.json index 39903f16b1..a727d87002 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/arrow-func-return-newline/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/arrow-func-return-newline/output.json @@ -1,123 +1,34 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":6,"end":38,"loc":{"start":{"line":1,"column":6},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":10,"end":38,"loc":{"start":{"line":1,"column":10},"end":{"line":2,"column":14}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":24,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - } - } + "start":26,"end":32,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8}} } }, "id": null, @@ -126,66 +37,21 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "foo" - }, + "start":11,"end":22,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":22},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TypeAnnotation", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":14,"end":22,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":22}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} } } } ], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":36,"end":38,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/builtin/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/builtin/output.json index 9b31791722..af55784168 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/builtin/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/builtin/output.json @@ -1,602 +1,185 @@ { "type": "File", - "start": 0, - "end": 265, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 16, - "column": 17 - } - }, + "start":0,"end":265,"loc":{"start":{"line":1,"column":0},"end":{"line":16,"column":17}}, "program": { "type": "Program", - "start": 0, - "end": 265, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 16, - "column": 17 - } - }, + "start":0,"end":265,"loc":{"start":{"line":1,"column":0},"end":{"line":16,"column":17}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 10, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":10,"end":24,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "T1" - }, + "start":15,"end":17,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":7},"identifierName":"T1"}, "name": "T1" }, "typeParameters": null, "right": { "type": "AnyTypeAnnotation", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - } - } + "start":20,"end":23,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13}} }, "leadingComments": [ { "type": "CommentLine", "value": " bounds", - "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}} } ] }, { "type": "TypeAlias", - "start": 25, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":25,"end":41,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":16}}, "id": { "type": "Identifier", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "T2" - }, + "start":30,"end":32,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":7},"identifierName":"T2"}, "name": "T2" }, "typeParameters": null, "right": { "type": "MixedTypeAnnotation", - "start": 35, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 15 - } - } + "start":35,"end":40,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":15}} } }, { "type": "TypeAlias", - "start": 42, - "end": 58, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 16 - } - }, + "start":42,"end":58,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":16}}, "id": { "type": "Identifier", - "start": 47, - "end": 49, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "T3" - }, + "start":47,"end":49,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":7},"identifierName":"T3"}, "name": "T3" }, "typeParameters": null, "right": { "type": "EmptyTypeAnnotation", - "start": 52, - "end": 57, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 15 - } - } + "start":52,"end":57,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":15}} }, "trailingComments": [ { "type": "CommentLine", "value": " builtins", - "start": 59, - "end": 70, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - } + "start":59,"end":70,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":11}} } ] }, { "type": "TypeAlias", - "start": 71, - "end": 86, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 15 - } - }, + "start":71,"end":86,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":15}}, "id": { "type": "Identifier", - "start": 76, - "end": 78, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 7 - }, - "identifierName": "T4" - }, + "start":76,"end":78,"loc":{"start":{"line":6,"column":5},"end":{"line":6,"column":7},"identifierName":"T4"}, "name": "T4" }, "typeParameters": null, "right": { "type": "VoidTypeAnnotation", - "start": 81, - "end": 85, - "loc": { - "start": { - "line": 6, - "column": 10 - }, - "end": { - "line": 6, - "column": 14 - } - } + "start":81,"end":85,"loc":{"start":{"line":6,"column":10},"end":{"line":6,"column":14}} }, "leadingComments": [ { "type": "CommentLine", "value": " builtins", - "start": 59, - "end": 70, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - } + "start":59,"end":70,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":11}} } ] }, { "type": "TypeAlias", - "start": 87, - "end": 104, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 17 - } - }, + "start":87,"end":104,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":17}}, "id": { "type": "Identifier", - "start": 92, - "end": 94, - "loc": { - "start": { - "line": 7, - "column": 5 - }, - "end": { - "line": 7, - "column": 7 - }, - "identifierName": "T5" - }, + "start":92,"end":94,"loc":{"start":{"line":7,"column":5},"end":{"line":7,"column":7},"identifierName":"T5"}, "name": "T5" }, "typeParameters": null, "right": { "type": "NumberTypeAnnotation", - "start": 97, - "end": 103, - "loc": { - "start": { - "line": 7, - "column": 10 - }, - "end": { - "line": 7, - "column": 16 - } - } + "start":97,"end":103,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":16}} } }, { "type": "TypeAlias", - "start": 105, - "end": 122, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 17 - } - }, + "start":105,"end":122,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":17}}, "id": { "type": "Identifier", - "start": 110, - "end": 112, - "loc": { - "start": { - "line": 8, - "column": 5 - }, - "end": { - "line": 8, - "column": 7 - }, - "identifierName": "T6" - }, + "start":110,"end":112,"loc":{"start":{"line":8,"column":5},"end":{"line":8,"column":7},"identifierName":"T6"}, "name": "T6" }, "typeParameters": null, "right": { "type": "StringTypeAnnotation", - "start": 115, - "end": 121, - "loc": { - "start": { - "line": 8, - "column": 10 - }, - "end": { - "line": 8, - "column": 16 - } - } + "start":115,"end":121,"loc":{"start":{"line":8,"column":10},"end":{"line":8,"column":16}} } }, { "type": "TypeAlias", - "start": 123, - "end": 138, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 15 - } - }, + "start":123,"end":138,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":15}}, "id": { "type": "Identifier", - "start": 128, - "end": 130, - "loc": { - "start": { - "line": 9, - "column": 5 - }, - "end": { - "line": 9, - "column": 7 - }, - "identifierName": "T7" - }, + "start":128,"end":130,"loc":{"start":{"line":9,"column":5},"end":{"line":9,"column":7},"identifierName":"T7"}, "name": "T7" }, "typeParameters": null, "right": { "type": "BooleanTypeAnnotation", - "start": 133, - "end": 137, - "loc": { - "start": { - "line": 9, - "column": 10 - }, - "end": { - "line": 9, - "column": 14 - } - } + "start":133,"end":137,"loc":{"start":{"line":9,"column":10},"end":{"line":9,"column":14}} } }, { "type": "TypeAlias", - "start": 139, - "end": 157, - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 10, - "column": 18 - } - }, + "start":139,"end":157,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":18}}, "id": { "type": "Identifier", - "start": 144, - "end": 146, - "loc": { - "start": { - "line": 10, - "column": 5 - }, - "end": { - "line": 10, - "column": 7 - }, - "identifierName": "T8" - }, + "start":144,"end":146,"loc":{"start":{"line":10,"column":5},"end":{"line":10,"column":7},"identifierName":"T8"}, "name": "T8" }, "typeParameters": null, "right": { "type": "BooleanTypeAnnotation", - "start": 149, - "end": 156, - "loc": { - "start": { - "line": 10, - "column": 10 - }, - "end": { - "line": 10, - "column": 17 - } - } + "start":149,"end":156,"loc":{"start":{"line":10,"column":10},"end":{"line":10,"column":17}} }, "trailingComments": [ { "type": "CommentLine", "value": " literal type annotations", - "start": 158, - "end": 185, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 27 - } - } + "start":158,"end":185,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":27}} } ] }, { "type": "TypeAlias", - "start": 186, - "end": 201, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 15 - } - }, + "start":186,"end":201,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":15}}, "id": { "type": "Identifier", - "start": 191, - "end": 193, - "loc": { - "start": { - "line": 12, - "column": 5 - }, - "end": { - "line": 12, - "column": 7 - }, - "identifierName": "T9" - }, + "start":191,"end":193,"loc":{"start":{"line":12,"column":5},"end":{"line":12,"column":7},"identifierName":"T9"}, "name": "T9" }, "typeParameters": null, "right": { "type": "NullLiteralTypeAnnotation", - "start": 196, - "end": 200, - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 14 - } - } + "start":196,"end":200,"loc":{"start":{"line":12,"column":10},"end":{"line":12,"column":14}} }, "leadingComments": [ { "type": "CommentLine", "value": " literal type annotations", - "start": 158, - "end": 185, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 27 - } - } + "start":158,"end":185,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":27}} } ] }, { "type": "TypeAlias", - "start": 202, - "end": 216, - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 13, - "column": 14 - } - }, + "start":202,"end":216,"loc":{"start":{"line":13,"column":0},"end":{"line":13,"column":14}}, "id": { "type": "Identifier", - "start": 207, - "end": 210, - "loc": { - "start": { - "line": 13, - "column": 5 - }, - "end": { - "line": 13, - "column": 8 - }, - "identifierName": "T10" - }, + "start":207,"end":210,"loc":{"start":{"line":13,"column":5},"end":{"line":13,"column":8},"identifierName":"T10"}, "name": "T10" }, "typeParameters": null, "right": { "type": "StringLiteralTypeAnnotation", - "start": 213, - "end": 215, - "loc": { - "start": { - "line": 13, - "column": 11 - }, - "end": { - "line": 13, - "column": 13 - } - }, + "start":213,"end":215,"loc":{"start":{"line":13,"column":11},"end":{"line":13,"column":13}}, "extra": { "rawValue": "", "raw": "\"\"" @@ -606,50 +189,16 @@ }, { "type": "TypeAlias", - "start": 217, - "end": 230, - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 13 - } - }, + "start":217,"end":230,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":13}}, "id": { "type": "Identifier", - "start": 222, - "end": 225, - "loc": { - "start": { - "line": 14, - "column": 5 - }, - "end": { - "line": 14, - "column": 8 - }, - "identifierName": "T11" - }, + "start":222,"end":225,"loc":{"start":{"line":14,"column":5},"end":{"line":14,"column":8},"identifierName":"T11"}, "name": "T11" }, "typeParameters": null, "right": { "type": "NumberLiteralTypeAnnotation", - "start": 228, - "end": 229, - "loc": { - "start": { - "line": 14, - "column": 11 - }, - "end": { - "line": 14, - "column": 12 - } - }, + "start":228,"end":229,"loc":{"start":{"line":14,"column":11},"end":{"line":14,"column":12}}, "extra": { "rawValue": 0, "raw": "0" @@ -659,99 +208,31 @@ }, { "type": "TypeAlias", - "start": 231, - "end": 247, - "loc": { - "start": { - "line": 15, - "column": 0 - }, - "end": { - "line": 15, - "column": 16 - } - }, + "start":231,"end":247,"loc":{"start":{"line":15,"column":0},"end":{"line":15,"column":16}}, "id": { "type": "Identifier", - "start": 236, - "end": 239, - "loc": { - "start": { - "line": 15, - "column": 5 - }, - "end": { - "line": 15, - "column": 8 - }, - "identifierName": "T12" - }, + "start":236,"end":239,"loc":{"start":{"line":15,"column":5},"end":{"line":15,"column":8},"identifierName":"T12"}, "name": "T12" }, "typeParameters": null, "right": { "type": "BooleanLiteralTypeAnnotation", - "start": 242, - "end": 246, - "loc": { - "start": { - "line": 15, - "column": 11 - }, - "end": { - "line": 15, - "column": 15 - } - }, + "start":242,"end":246,"loc":{"start":{"line":15,"column":11},"end":{"line":15,"column":15}}, "value": true } }, { "type": "TypeAlias", - "start": 248, - "end": 265, - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 16, - "column": 17 - } - }, + "start":248,"end":265,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":17}}, "id": { "type": "Identifier", - "start": 253, - "end": 256, - "loc": { - "start": { - "line": 16, - "column": 5 - }, - "end": { - "line": 16, - "column": 8 - }, - "identifierName": "T13" - }, + "start":253,"end":256,"loc":{"start":{"line":16,"column":5},"end":{"line":16,"column":8},"identifierName":"T13"}, "name": "T13" }, "typeParameters": null, "right": { "type": "BooleanLiteralTypeAnnotation", - "start": 259, - "end": 264, - "loc": { - "start": { - "line": 16, - "column": 11 - }, - "end": { - "line": 16, - "column": 16 - } - }, + "start":259,"end":264,"loc":{"start":{"line":16,"column":11},"end":{"line":16,"column":16}}, "value": false } } @@ -762,50 +243,17 @@ { "type": "CommentLine", "value": " bounds", - "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}} }, { "type": "CommentLine", "value": " builtins", - "start": 59, - "end": 70, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - } + "start":59,"end":70,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":11}} }, { "type": "CommentLine", "value": " literal type annotations", - "start": 158, - "end": 185, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 27 - } - } + "start":158,"end":185,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":27}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/existential-type-param-2/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/existential-type-param-2/output.json index c6ffbdecd4..54e622f199 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/existential-type-param-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/existential-type-param-2/output.json @@ -1,153 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":4,"end":38,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":38}}, "id": { "type": "Identifier", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "f" - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9},"identifierName":"f"}, "name": "f", "typeAnnotation": { "type": "TypeAnnotation", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9}}, "typeAnnotation": { "type": "ExistsTypeAnnotation", - "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}} } } }, "init": { "type": "ArrowFunctionExpression", - "start": 12, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":12,"end":38,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":38}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32}}, "typeAnnotation": { "type": "ExistsTypeAnnotation", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31}} } }, "id": null, @@ -156,78 +45,22 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "x" - }, + "start":13,"end":25,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":25},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":15,"end":25,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":25}}, "typeAnnotation": { "type": "UnionTypeAnnotation", - "start": 17, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":17,"end":25,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":25}}, "types": [ { "type": "NullLiteralTypeAnnotation", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21}} }, { "type": "ExistsTypeAnnotation", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}} } ] } @@ -236,18 +69,7 @@ ], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/existential-type-param/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/existential-type-param/output.json index 10d818ccb5..bd76acce91 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/existential-type-param/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/existential-type-param/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "Maybe" - }, + "start":5,"end":10,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":10},"identifierName":"Maybe"}, "name": "Maybe" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "params": [ { "type": "TypeParameter", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "name": "T", "variance": null } @@ -96,98 +29,30 @@ }, "right": { "type": "GenericTypeAnnotation", - "start": 16, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":16,"end":28,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":28}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":22,"end":28,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":28}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "T" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"T"}, "name": "T" } }, { "type": "ExistsTypeAnnotation", - "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}} } ] }, "id": { "type": "Identifier", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "_Maybe" - }, + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22},"identifierName":"_Maybe"}, "name": "_Maybe" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/function-expression-inside-jsx-attr/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/function-expression-inside-jsx-attr/output.json index 6f52323d16..d53d3303ef 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/function-expression-inside-jsx-attr/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/function-expression-inside-jsx-attr/output.json @@ -1,251 +1,78 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "expression": { "type": "JSXElement", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, + "name": { + "type": "JSXIdentifier", + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, + "name": "bar" }, "attributes": [ { "type": "JSXAttribute", - "start": 5, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":5,"end":39,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":39}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "x" }, "value": { "type": "JSXExpressionContainer", - "start": 7, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":7,"end":39,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":39}}, "expression": { "type": "FunctionExpression", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":8,"end":38,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":38}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"x"}, "name": "x" } ], "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 20, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":20,"end":35,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":35}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 22, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":22,"end":35,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":35}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 27, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":27,"end":35,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":35}}, "params": [ { "type": "StringTypeAnnotation", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 34 - } - } + "start":28,"end":34,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":34}} } ] }, "id": { "type": "Identifier", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "Array" - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27},"identifierName":"Array"}, "name": "Array" } } }, "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38}}, "body": [], "directives": [] } @@ -253,22 +80,6 @@ } } ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "name": "bar" - }, "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/function-is-valid-type/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/function-is-valid-type/output.json index 056dc7de7b..43c601b765 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/function-is-valid-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/function-is-valid-type/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,49 +20,14 @@ "params": [ { "type": "Identifier", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "a" - }, + "start":13,"end":23,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":23},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "Identifier", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "function" - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23},"identifierName":"function"}, "name": "function" } } @@ -115,18 +35,7 @@ ], "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [], "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 78be0c8ba0..37c944d36f 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 @@ -1,95 +1,28 @@ { "type": "File", - "start": 0, - "end": 110, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 12, - "column": 19 - } - }, + "start":0,"end":110,"loc":{"start":{"line":1,"column":0},"end":{"line":12,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 110, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 12, - "column": 19 - } - }, + "start":0,"end":110,"loc":{"start":{"line":1,"column":0},"end":{"line":12,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 18, - "end": 60, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 8, - "column": 6 - } - }, + "start":18,"end":60,"loc":{"start":{"line":5,"column":0},"end":{"line":8,"column":6}}, "id": { "type": "Identifier", - "start": 23, - "end": 38, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 20 - }, - "identifierName": "DirectionVector" - }, + "start":23,"end":38,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":20},"identifierName":"DirectionVector"}, "name": "DirectionVector" }, "typeParameters": null, "right": { "type": "UnionTypeAnnotation", - "start": 43, - "end": 59, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 8, - "column": 5 - } - }, + "start":43,"end":59,"loc":{"start":{"line":6,"column":2},"end":{"line":8,"column":5}}, "types": [ { "type": "NumberLiteralTypeAnnotation", - "start": 45, - "end": 47, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 6 - } - }, + "start":45,"end":47,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":6}}, "extra": { "rawValue": -1, "raw": "-1" @@ -98,18 +31,7 @@ }, { "type": "NumberLiteralTypeAnnotation", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 5 - } - }, + "start":52,"end":53,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":5}}, "extra": { "rawValue": 0, "raw": "0" @@ -118,18 +40,7 @@ }, { "type": "NumberLiteralTypeAnnotation", - "start": 58, - "end": 59, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 5 - } - }, + "start":58,"end":59,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":5}}, "extra": { "rawValue": 1, "raw": "1" @@ -142,110 +53,31 @@ { "type": "CommentBlock", "value": "*\n * @flow\n ", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - } + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":3}} } ] }, { "type": "VariableDeclaration", - "start": 63, - "end": 90, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 27 - } - }, + "start":63,"end":90,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 67, - "end": 89, - "loc": { - "start": { - "line": 11, - "column": 4 - }, - "end": { - "line": 11, - "column": 26 - } - }, + "start":67,"end":89,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":26}}, "id": { "type": "Identifier", - "start": 67, - "end": 84, - "loc": { - "start": { - "line": 11, - "column": 4 - }, - "end": { - "line": 11, - "column": 21 - }, - "identifierName": "x" - }, + "start":67,"end":84,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":21},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 68, - "end": 84, - "loc": { - "start": { - "line": 11, - "column": 5 - }, - "end": { - "line": 11, - "column": 21 - } - }, + "start":68,"end":84,"loc":{"start":{"line":11,"column":5},"end":{"line":11,"column":21}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 69, - "end": 84, - "loc": { - "start": { - "line": 11, - "column": 6 - }, - "end": { - "line": 11, - "column": 21 - } - }, + "start":69,"end":84,"loc":{"start":{"line":11,"column":6},"end":{"line":11,"column":21}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 69, - "end": 84, - "loc": { - "start": { - "line": 11, - "column": 6 - }, - "end": { - "line": 11, - "column": 21 - }, - "identifierName": "DirectionVector" - }, + "start":69,"end":84,"loc":{"start":{"line":11,"column":6},"end":{"line":11,"column":21},"identifierName":"DirectionVector"}, "name": "DirectionVector" } } @@ -253,34 +85,12 @@ }, "init": { "type": "UnaryExpression", - "start": 87, - "end": 89, - "loc": { - "start": { - "line": 11, - "column": 24 - }, - "end": { - "line": 11, - "column": 26 - } - }, + "start":87,"end":89,"loc":{"start":{"line":11,"column":24},"end":{"line":11,"column":26}}, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 88, - "end": 89, - "loc": { - "start": { - "line": 11, - "column": 25 - }, - "end": { - "line": 11, - "column": 26 - } - }, + "start":88,"end":89,"loc":{"start":{"line":11,"column":25},"end":{"line":11,"column":26}}, "extra": { "rawValue": 1, "raw": "1" @@ -294,78 +104,21 @@ }, { "type": "ExpressionStatement", - "start": 91, - "end": 110, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 19 - } - }, + "start":91,"end":110,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":19}}, "expression": { "type": "CallExpression", - "start": 91, - "end": 109, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 18 - } - }, + "start":91,"end":109,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":18}}, "callee": { "type": "MemberExpression", - "start": 91, - "end": 102, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 11 - } - }, + "start":91,"end":102,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":11}}, "object": { "type": "Identifier", - "start": 91, - "end": 98, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 7 - }, - "identifierName": "console" - }, + "start":91,"end":98,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":7},"identifierName":"console"}, "name": "console" }, "property": { "type": "Identifier", - "start": 99, - "end": 102, - "loc": { - "start": { - "line": 12, - "column": 8 - }, - "end": { - "line": 12, - "column": 11 - }, - "identifierName": "log" - }, + "start":99,"end":102,"loc":{"start":{"line":12,"column":8},"end":{"line":12,"column":11},"identifierName":"log"}, "name": "log" }, "computed": false @@ -373,18 +126,7 @@ "arguments": [ { "type": "StringLiteral", - "start": 103, - "end": 108, - "loc": { - "start": { - "line": 12, - "column": 12 - }, - "end": { - "line": 12, - "column": 17 - } - }, + "start":103,"end":108,"loc":{"start":{"line":12,"column":12},"end":{"line":12,"column":17}}, "extra": { "rawValue": "foo", "raw": "'foo'" @@ -401,18 +143,7 @@ { "type": "CommentBlock", "value": "*\n * @flow\n ", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - } + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":3}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/object-type-method/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/object-type-method/output.json index 49fb1b3a7b..b8e1ad4ce0 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/object-type-method/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/object-type-method/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 323, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 12, - "column": 38 - } - }, + "start":0,"end":323,"loc":{"start":{"line":1,"column":0},"end":{"line":12,"column":38}}, "program": { "type": "Program", - "start": 0, - "end": 323, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 12, - "column": 38 - } - }, + "start":0,"end":323,"loc":{"start":{"line":1,"column":0},"end":{"line":12,"column":38}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "T" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":9,"end":26,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":26}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 11, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":11,"end":24,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":24}}, "key": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a" }, "static": false, @@ -114,34 +35,12 @@ "method": false, "value": { "type": "FunctionTypeAnnotation", - "start": 14, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":14,"end":24,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":24}}, "params": [], "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 20, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":20,"end":24,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":24}} }, "typeParameters": null }, @@ -157,81 +56,24 @@ }, { "type": "TypeAlias", - "start": 28, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":28,"end":59,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}}, "id": { "type": "Identifier", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "T1" - }, + "start":33,"end":35,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":7},"identifierName":"T1"}, "name": "T1" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 38, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":38,"end":58,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":30}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 40, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":40,"end":56,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":28}}, "key": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "a" - }, + "start":40,"end":41,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"a"}, "name": "a" }, "static": false, @@ -240,47 +82,14 @@ "method": false, "value": { "type": "FunctionTypeAnnotation", - "start": 43, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":43,"end":56,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":28}}, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":43,"end":46,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, "params": [ { "type": "TypeParameter", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":44,"end":45,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17}}, "name": "T", "variance": null } @@ -290,18 +99,7 @@ "rest": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 52, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 28 - } - } + "start":52,"end":56,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":28}} } }, "variance": null, @@ -316,81 +114,24 @@ }, { "type": "TypeAlias", - "start": 60, - "end": 84, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":60,"end":84,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":24}}, "id": { "type": "Identifier", - "start": 65, - "end": 67, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "T2" - }, + "start":65,"end":67,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":7},"identifierName":"T2"}, "name": "T2" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 70, - "end": 83, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":70,"end":83,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":23}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 72, - "end": 81, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":72,"end":81,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":21}}, "key": { "type": "Identifier", - "start": 72, - "end": 73, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "a" - }, + "start":72,"end":73,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13},"identifierName":"a"}, "name": "a" }, "static": false, @@ -399,35 +140,13 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 72, - "end": 81, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":72,"end":81,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":21}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "VoidTypeAnnotation", - "start": 77, - "end": 81, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 21 - } - } + "start":77,"end":81,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":21}} } }, "optional": false @@ -441,81 +160,24 @@ }, { "type": "TypeAlias", - "start": 85, - "end": 112, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 27 - } - }, + "start":85,"end":112,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":27}}, "id": { "type": "Identifier", - "start": 90, - "end": 92, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "T3" - }, + "start":90,"end":92,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":7},"identifierName":"T3"}, "name": "T3" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 95, - "end": 111, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 26 - } - }, + "start":95,"end":111,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":26}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 97, - "end": 109, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 24 - } - }, + "start":97,"end":109,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":24}}, "key": { "type": "Identifier", - "start": 97, - "end": 98, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 13 - }, - "identifierName": "a" - }, + "start":97,"end":98,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":13},"identifierName":"a"}, "name": "a" }, "static": false, @@ -524,49 +186,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 97, - "end": 109, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 24 - } - }, + "start":97,"end":109,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":24}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 98, - "end": 101, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 16 - } - }, + "start":98,"end":101,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":16}}, "params": [ { "type": "TypeParameter", - "start": 99, - "end": 100, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":99,"end":100,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":15}}, "name": "T", "variance": null } @@ -574,18 +203,7 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 105, - "end": 109, - "loc": { - "start": { - "line": 4, - "column": 20 - }, - "end": { - "line": 4, - "column": 24 - } - } + "start":105,"end":109,"loc":{"start":{"line":4,"column":20},"end":{"line":4,"column":24}} } }, "optional": false @@ -599,97 +217,30 @@ }, { "type": "TypeAlias", - "start": 114, - "end": 139, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 25 - } - }, + "start":114,"end":139,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":25}}, "id": { "type": "Identifier", - "start": 119, - "end": 121, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 7 - }, - "identifierName": "T4" - }, + "start":119,"end":121,"loc":{"start":{"line":6,"column":5},"end":{"line":6,"column":7},"identifierName":"T4"}, "name": "T4" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 124, - "end": 138, - "loc": { - "start": { - "line": 6, - "column": 10 - }, - "end": { - "line": 6, - "column": 24 - } - }, + "start":124,"end":138,"loc":{"start":{"line":6,"column":10},"end":{"line":6,"column":24}}, "callProperties": [ { "type": "ObjectTypeCallProperty", - "start": 126, - "end": 136, - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 22 - } - }, + "start":126,"end":136,"loc":{"start":{"line":6,"column":12},"end":{"line":6,"column":22}}, "static": false, "value": { "type": "FunctionTypeAnnotation", - "start": 126, - "end": 136, - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 22 - } - }, + "start":126,"end":136,"loc":{"start":{"line":6,"column":12},"end":{"line":6,"column":22}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 130, - "end": 136, - "loc": { - "start": { - "line": 6, - "column": 16 - }, - "end": { - "line": 6, - "column": 22 - } - } + "start":130,"end":136,"loc":{"start":{"line":6,"column":16},"end":{"line":6,"column":22}} } } } @@ -703,143 +254,41 @@ }, { "type": "TypeAlias", - "start": 140, - "end": 172, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 32 - } - }, + "start":140,"end":172,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":32}}, "id": { "type": "Identifier", - "start": 145, - "end": 147, - "loc": { - "start": { - "line": 7, - "column": 5 - }, - "end": { - "line": 7, - "column": 7 - }, - "identifierName": "T5" - }, + "start":145,"end":147,"loc":{"start":{"line":7,"column":5},"end":{"line":7,"column":7},"identifierName":"T5"}, "name": "T5" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 150, - "end": 172, - "loc": { - "start": { - "line": 7, - "column": 10 - }, - "end": { - "line": 7, - "column": 32 - } - }, + "start":150,"end":172,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":32}}, "callProperties": [ { "type": "ObjectTypeCallProperty", - "start": 152, - "end": 169, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 29 - } - }, + "start":152,"end":169,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":29}}, "static": false, "value": { "type": "FunctionTypeAnnotation", - "start": 152, - "end": 169, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 29 - } - }, + "start":152,"end":169,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":29}}, "params": [ { "type": "FunctionTypeParam", - "start": 156, - "end": 160, - "loc": { - "start": { - "line": 7, - "column": 16 - }, - "end": { - "line": 7, - "column": 20 - } - }, + "start":156,"end":160,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":20}}, "name": { "type": "Identifier", - "start": 156, - "end": 157, - "loc": { - "start": { - "line": 7, - "column": 16 - }, - "end": { - "line": 7, - "column": 17 - }, - "identifierName": "x" - }, + "start":156,"end":157,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":17},"identifierName":"x"}, "name": "x" }, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 159, - "end": 160, - "loc": { - "start": { - "line": 7, - "column": 19 - }, - "end": { - "line": 7, - "column": 20 - } - }, + "start":159,"end":160,"loc":{"start":{"line":7,"column":19},"end":{"line":7,"column":20}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 159, - "end": 160, - "loc": { - "start": { - "line": 7, - "column": 19 - }, - "end": { - "line": 7, - "column": 20 - }, - "identifierName": "T" - }, + "start":159,"end":160,"loc":{"start":{"line":7,"column":19},"end":{"line":7,"column":20},"identifierName":"T"}, "name": "T" } } @@ -848,33 +297,11 @@ "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 152, - "end": 155, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 15 - } - }, + "start":152,"end":155,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":15}}, "params": [ { "type": "TypeParameter", - "start": 153, - "end": 154, - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 14 - } - }, + "start":153,"end":154,"loc":{"start":{"line":7,"column":13},"end":{"line":7,"column":14}}, "name": "T", "variance": null } @@ -882,18 +309,7 @@ }, "returnType": { "type": "NumberTypeAnnotation", - "start": 163, - "end": 169, - "loc": { - "start": { - "line": 7, - "column": 23 - }, - "end": { - "line": 7, - "column": 29 - } - } + "start":163,"end":169,"loc":{"start":{"line":7,"column":23},"end":{"line":7,"column":29}} } } } @@ -907,33 +323,10 @@ }, { "type": "DeclareClass", - "start": 174, - "end": 209, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 35 - } - }, + "start":174,"end":209,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":35}}, "id": { "type": "Identifier", - "start": 188, - "end": 190, - "loc": { - "start": { - "line": 9, - "column": 14 - }, - "end": { - "line": 9, - "column": 16 - }, - "identifierName": "T6" - }, + "start":188,"end":190,"loc":{"start":{"line":9,"column":14},"end":{"line":9,"column":16},"identifierName":"T6"}, "name": "T6" }, "typeParameters": null, @@ -942,49 +335,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 191, - "end": 209, - "loc": { - "start": { - "line": 9, - "column": 17 - }, - "end": { - "line": 9, - "column": 35 - } - }, + "start":191,"end":209,"loc":{"start":{"line":9,"column":17},"end":{"line":9,"column":35}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 193, - "end": 206, - "loc": { - "start": { - "line": 9, - "column": 19 - }, - "end": { - "line": 9, - "column": 32 - } - }, + "start":193,"end":206,"loc":{"start":{"line":9,"column":19},"end":{"line":9,"column":32}}, "key": { "type": "Identifier", - "start": 193, - "end": 196, - "loc": { - "start": { - "line": 9, - "column": 19 - }, - "end": { - "line": 9, - "column": 22 - }, - "identifierName": "foo" - }, + "start":193,"end":196,"loc":{"start":{"line":9,"column":19},"end":{"line":9,"column":22},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -993,35 +352,13 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 193, - "end": 206, - "loc": { - "start": { - "line": 9, - "column": 19 - }, - "end": { - "line": 9, - "column": 32 - } - }, + "start":193,"end":206,"loc":{"start":{"line":9,"column":19},"end":{"line":9,"column":32}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 200, - "end": 206, - "loc": { - "start": { - "line": 9, - "column": 26 - }, - "end": { - "line": 9, - "column": 32 - } - } + "start":200,"end":206,"loc":{"start":{"line":9,"column":26},"end":{"line":9,"column":32}} } }, "optional": false @@ -1034,33 +371,10 @@ }, { "type": "DeclareClass", - "start": 210, - "end": 252, - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 10, - "column": 42 - } - }, + "start":210,"end":252,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":42}}, "id": { "type": "Identifier", - "start": 224, - "end": 226, - "loc": { - "start": { - "line": 10, - "column": 14 - }, - "end": { - "line": 10, - "column": 16 - }, - "identifierName": "T7" - }, + "start":224,"end":226,"loc":{"start":{"line":10,"column":14},"end":{"line":10,"column":16},"identifierName":"T7"}, "name": "T7" }, "typeParameters": null, @@ -1069,49 +383,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 227, - "end": 252, - "loc": { - "start": { - "line": 10, - "column": 17 - }, - "end": { - "line": 10, - "column": 42 - } - }, + "start":227,"end":252,"loc":{"start":{"line":10,"column":17},"end":{"line":10,"column":42}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 229, - "end": 249, - "loc": { - "start": { - "line": 10, - "column": 19 - }, - "end": { - "line": 10, - "column": 39 - } - }, + "start":229,"end":249,"loc":{"start":{"line":10,"column":19},"end":{"line":10,"column":39}}, "key": { "type": "Identifier", - "start": 236, - "end": 239, - "loc": { - "start": { - "line": 10, - "column": 26 - }, - "end": { - "line": 10, - "column": 29 - }, - "identifierName": "foo" - }, + "start":236,"end":239,"loc":{"start":{"line":10,"column":26},"end":{"line":10,"column":29},"identifierName":"foo"}, "name": "foo" }, "static": true, @@ -1120,35 +400,13 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 229, - "end": 249, - "loc": { - "start": { - "line": 10, - "column": 19 - }, - "end": { - "line": 10, - "column": 39 - } - }, + "start":229,"end":249,"loc":{"start":{"line":10,"column":19},"end":{"line":10,"column":39}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 243, - "end": 249, - "loc": { - "start": { - "line": 10, - "column": 33 - }, - "end": { - "line": 10, - "column": 39 - } - } + "start":243,"end":249,"loc":{"start":{"line":10,"column":33},"end":{"line":10,"column":39}} } }, "optional": false @@ -1161,33 +419,10 @@ }, { "type": "DeclareClass", - "start": 253, - "end": 284, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 31 - } - }, + "start":253,"end":284,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":31}}, "id": { "type": "Identifier", - "start": 267, - "end": 269, - "loc": { - "start": { - "line": 11, - "column": 14 - }, - "end": { - "line": 11, - "column": 16 - }, - "identifierName": "T8" - }, + "start":267,"end":269,"loc":{"start":{"line":11,"column":14},"end":{"line":11,"column":16},"identifierName":"T8"}, "name": "T8" }, "typeParameters": null, @@ -1196,65 +431,21 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 270, - "end": 284, - "loc": { - "start": { - "line": 11, - "column": 17 - }, - "end": { - "line": 11, - "column": 31 - } - }, + "start":270,"end":284,"loc":{"start":{"line":11,"column":17},"end":{"line":11,"column":31}}, "callProperties": [ { "type": "ObjectTypeCallProperty", - "start": 272, - "end": 282, - "loc": { - "start": { - "line": 11, - "column": 19 - }, - "end": { - "line": 11, - "column": 29 - } - }, + "start":272,"end":282,"loc":{"start":{"line":11,"column":19},"end":{"line":11,"column":29}}, "static": false, "value": { "type": "FunctionTypeAnnotation", - "start": 272, - "end": 282, - "loc": { - "start": { - "line": 11, - "column": 19 - }, - "end": { - "line": 11, - "column": 29 - } - }, + "start":272,"end":282,"loc":{"start":{"line":11,"column":19},"end":{"line":11,"column":29}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 276, - "end": 282, - "loc": { - "start": { - "line": 11, - "column": 23 - }, - "end": { - "line": 11, - "column": 29 - } - } + "start":276,"end":282,"loc":{"start":{"line":11,"column":23},"end":{"line":11,"column":29}} } } } @@ -1267,33 +458,10 @@ }, { "type": "DeclareClass", - "start": 285, - "end": 323, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 38 - } - }, + "start":285,"end":323,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":38}}, "id": { "type": "Identifier", - "start": 299, - "end": 301, - "loc": { - "start": { - "line": 12, - "column": 14 - }, - "end": { - "line": 12, - "column": 16 - }, - "identifierName": "T9" - }, + "start":299,"end":301,"loc":{"start":{"line":12,"column":14},"end":{"line":12,"column":16},"identifierName":"T9"}, "name": "T9" }, "typeParameters": null, @@ -1302,65 +470,21 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 302, - "end": 323, - "loc": { - "start": { - "line": 12, - "column": 17 - }, - "end": { - "line": 12, - "column": 38 - } - }, + "start":302,"end":323,"loc":{"start":{"line":12,"column":17},"end":{"line":12,"column":38}}, "callProperties": [ { "type": "ObjectTypeCallProperty", - "start": 304, - "end": 321, - "loc": { - "start": { - "line": 12, - "column": 19 - }, - "end": { - "line": 12, - "column": 36 - } - }, + "start":304,"end":321,"loc":{"start":{"line":12,"column":19},"end":{"line":12,"column":36}}, "static": true, "value": { "type": "FunctionTypeAnnotation", - "start": 311, - "end": 321, - "loc": { - "start": { - "line": 12, - "column": 26 - }, - "end": { - "line": 12, - "column": 36 - } - }, + "start":311,"end":321,"loc":{"start":{"line":12,"column":26},"end":{"line":12,"column":36}}, "params": [], "rest": null, "typeParameters": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 315, - "end": 321, - "loc": { - "start": { - "line": 12, - "column": 30 - }, - "end": { - "line": 12, - "column": 36 - } - } + "start":315,"end":321,"loc":{"start":{"line":12,"column":30},"end":{"line":12,"column":36}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/symbol/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/symbol/output.json index cc436b3b05..08f7373de7 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/symbol/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/symbol/output.json @@ -1,139 +1,38 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":6,"end":26,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":26}}, "id": { "type": "Identifier", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "typeAnnotation": { "type": "SymbolTypeAnnotation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } } }, "init": { "type": "CallExpression", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "callee": { "type": "Identifier", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "Symbol" - }, + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24},"identifierName":"Symbol"}, "name": "Symbol" }, "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 58a7471e98..9822fae01d 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 @@ -1,171 +1,47 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":38}}, "errors": [ "SyntaxError: Unexpected reserved type interface (2:21)" ], "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":38}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 9, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":9,"end":47,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":38}}, "declarations": [ { "type": "VariableDeclarator", - "start": 15, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":15,"end":46,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":37}}, "id": { "type": "Identifier", - "start": 15, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 30 - }, - "identifierName": "x" - }, + "start":15,"end":39,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":30},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 16, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":16,"end":39,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":30}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 18, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":18,"end":39,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":30}}, "argument": { "type": "GenericTypeAnnotation", - "start": 25, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":25,"end":39,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":30}}, "typeParameters": null, "id": { "type": "QualifiedTypeIdentifier", - "start": 25, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":25,"end":39,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":30}}, "qualification": { "type": "Identifier", - "start": 25, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "type" - }, + "start":25,"end":29,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":20},"identifierName":"type"}, "name": "type" }, "id": { "type": "Identifier", - "start": 30, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 30 - }, - "identifierName": "interface" - }, + "start":30,"end":39,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":30},"identifierName":"interface"}, "name": "interface" } } @@ -175,18 +51,7 @@ }, "init": { "type": "StringLiteral", - "start": 42, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 33 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":42,"end":46,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":37}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -200,18 +65,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -222,18 +76,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file 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 8b8eb4bb5a..f719b76ee8 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 @@ -1,171 +1,47 @@ { "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":36}}, "errors": [ "SyntaxError: Unexpected reserved type number (2:22)" ], "program": { "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 9, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":9,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":36}}, "declarations": [ { "type": "VariableDeclarator", - "start": 15, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":15,"end":44,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":35}}, "id": { "type": "Identifier", - "start": 15, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 28 - }, - "identifierName": "x" - }, + "start":15,"end":37,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":28},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 16, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":16,"end":37,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":28}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 18, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":18,"end":37,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":28}}, "argument": { "type": "GenericTypeAnnotation", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":25,"end":37,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":28}}, "typeParameters": null, "id": { "type": "QualifiedTypeIdentifier", - "start": 25, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":25,"end":37,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":28}}, "qualification": { "type": "Identifier", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 21 - }, - "identifierName": "stuff" - }, + "start":25,"end":30,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":21},"identifierName":"stuff"}, "name": "stuff" }, "id": { "type": "Identifier", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 28 - }, - "identifierName": "number" - }, + "start":31,"end":37,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":28},"identifierName":"number"}, "name": "number" } } @@ -175,18 +51,7 @@ }, "init": { "type": "StringLiteral", - "start": 40, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 31 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":40,"end":44,"loc":{"start":{"line":2,"column":31},"end":{"line":2,"column":35}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -200,18 +65,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -222,18 +76,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file 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 9236c950f3..0335f33501 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 @@ -1,140 +1,39 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":30}}, "errors": [ "SyntaxError: Unexpected reserved word 'static' (2:16)" ], "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 9, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":9,"end":39,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":30}}, "declarations": [ { "type": "VariableDeclarator", - "start": 15, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":15,"end":38,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":29}}, "id": { "type": "Identifier", - "start": 15, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "x" - }, + "start":15,"end":31,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":22},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 16, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":16,"end":31,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":22}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 18, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":18,"end":31,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":22}}, "argument": { "type": "GenericTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":25,"end":31,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":22}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "static" - }, + "start":25,"end":31,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":22},"identifierName":"static"}, "name": "static" } } @@ -143,18 +42,7 @@ }, "init": { "type": "StringLiteral", - "start": 34, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":34,"end":38,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":29}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -168,18 +56,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -190,18 +67,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file 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 25467cae1b..6a21871a82 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 @@ -1,171 +1,47 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":40}}, "errors": [ "SyntaxError: Unexpected reserved type interface (2:18)" ], "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":40}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 9, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":9,"end":49,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":40}}, "declarations": [ { "type": "VariableDeclarator", - "start": 15, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 39 - } - }, + "start":15,"end":48,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":39}}, "id": { "type": "Identifier", - "start": 15, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 32 - }, - "identifierName": "x" - }, + "start":15,"end":41,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":32},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 16, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":16,"end":41,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":32}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 18, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":18,"end":41,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":32}}, "argument": { "type": "GenericTypeAnnotation", - "start": 25, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":25,"end":41,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":32}}, "typeParameters": null, "id": { "type": "QualifiedTypeIdentifier", - "start": 25, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":25,"end":41,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":32}}, "qualification": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "d" - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"d"}, "name": "d" }, "id": { "type": "Identifier", - "start": 27, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 32 - }, - "identifierName": "interface" - }, + "start":27,"end":41,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":32},"identifierName":"interface"}, "name": "interface" } } @@ -175,18 +51,7 @@ }, "init": { "type": "StringLiteral", - "start": 44, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 39 - } - }, + "start":44,"end":48,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":39}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -200,18 +65,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -222,18 +76,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-valid/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-valid/output.json index 5ef43efe2b..fe16d11775 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-valid/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/typeof-reserved-valid/output.json @@ -1,122 +1,32 @@ { "type": "File", - "start": 0, - "end": 407, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 15, - "column": 28 - } - }, + "start":0,"end":407,"loc":{"start":{"line":1,"column":0},"end":{"line":15,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 407, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 15, - "column": 28 - } - }, + "start":0,"end":407,"loc":{"start":{"line":1,"column":0},"end":{"line":15,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 9, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":9,"end":40,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}}, "declarations": [ { "type": "VariableDeclarator", - "start": 15, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":15,"end":39,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":30}}, "id": { "type": "Identifier", - "start": 15, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "a" - }, + "start":15,"end":32,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":23},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 16, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":16,"end":32,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":23}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":18,"end":32,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":23}}, "argument": { "type": "Identifier", - "start": 25, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "default" - }, + "start":25,"end":32,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":23},"identifierName":"default"}, "name": "default" } } @@ -124,18 +34,7 @@ }, "init": { "type": "StringLiteral", - "start": 35, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":35,"end":39,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":30}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -149,155 +48,42 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] }, { "type": "VariableDeclaration", - "start": 41, - "end": 78, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 37 - } - }, + "start":41,"end":78,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":37}}, "declarations": [ { "type": "VariableDeclarator", - "start": 47, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":47,"end":77,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":36}}, "id": { "type": "Identifier", - "start": 47, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 29 - }, - "identifierName": "b" - }, + "start":47,"end":70,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":29},"identifierName":"b"}, "name": "b", "typeAnnotation": { "type": "TypeAnnotation", - "start": 48, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":48,"end":70,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":29}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 50, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":50,"end":70,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":29}}, "argument": { "type": "GenericTypeAnnotation", - "start": 57, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":57,"end":70,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":29}}, "typeParameters": null, "id": { "type": "QualifiedTypeIdentifier", - "start": 57, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":57,"end":70,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":29}}, "qualification": { "type": "Identifier", - "start": 57, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 21 - }, - "identifierName": "stuff" - }, + "start":57,"end":62,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":21},"identifierName":"stuff"}, "name": "stuff" }, "id": { "type": "Identifier", - "start": 63, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 29 - }, - "identifierName": "default" - }, + "start":63,"end":70,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":29},"identifierName":"default"}, "name": "default" } } @@ -307,18 +93,7 @@ }, "init": { "type": "StringLiteral", - "start": 73, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":73,"end":77,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":36}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -331,109 +106,31 @@ }, { "type": "VariableDeclaration", - "start": 80, - "end": 107, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 27 - } - }, + "start":80,"end":107,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 86, - "end": 106, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 26 - } - }, + "start":86,"end":106,"loc":{"start":{"line":5,"column":6},"end":{"line":5,"column":26}}, "id": { "type": "Identifier", - "start": 86, - "end": 99, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 19 - }, - "identifierName": "c" - }, + "start":86,"end":99,"loc":{"start":{"line":5,"column":6},"end":{"line":5,"column":19},"identifierName":"c"}, "name": "c", "typeAnnotation": { "type": "TypeAnnotation", - "start": 87, - "end": 99, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 19 - } - }, + "start":87,"end":99,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":19}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 89, - "end": 99, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 19 - } - }, + "start":89,"end":99,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":19}}, "argument": { "type": "AnyTypeAnnotation", - "start": 96, - "end": 99, - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 5, - "column": 19 - } - } + "start":96,"end":99,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":19}} } } } }, "init": { "type": "StringLiteral", - "start": 102, - "end": 106, - "loc": { - "start": { - "line": 5, - "column": 22 - }, - "end": { - "line": 5, - "column": 26 - } - }, + "start":102,"end":106,"loc":{"start":{"line":5,"column":22},"end":{"line":5,"column":26}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -446,109 +143,31 @@ }, { "type": "VariableDeclaration", - "start": 108, - "end": 136, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 28 - } - }, + "start":108,"end":136,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 114, - "end": 135, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 27 - } - }, + "start":114,"end":135,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":27}}, "id": { "type": "Identifier", - "start": 114, - "end": 128, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 20 - }, - "identifierName": "d" - }, + "start":114,"end":128,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":20},"identifierName":"d"}, "name": "d", "typeAnnotation": { "type": "TypeAnnotation", - "start": 115, - "end": 128, - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 20 - } - }, + "start":115,"end":128,"loc":{"start":{"line":6,"column":7},"end":{"line":6,"column":20}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 117, - "end": 128, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 20 - } - }, + "start":117,"end":128,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":20}}, "argument": { "type": "BooleanTypeAnnotation", - "start": 124, - "end": 128, - "loc": { - "start": { - "line": 6, - "column": 16 - }, - "end": { - "line": 6, - "column": 20 - } - } + "start":124,"end":128,"loc":{"start":{"line":6,"column":16},"end":{"line":6,"column":20}} } } } }, "init": { "type": "StringLiteral", - "start": 131, - "end": 135, - "loc": { - "start": { - "line": 6, - "column": 23 - }, - "end": { - "line": 6, - "column": 27 - } - }, + "start":131,"end":135,"loc":{"start":{"line":6,"column":23},"end":{"line":6,"column":27}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -561,109 +180,31 @@ }, { "type": "VariableDeclaration", - "start": 137, - "end": 168, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 31 - } - }, + "start":137,"end":168,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":31}}, "declarations": [ { "type": "VariableDeclarator", - "start": 143, - "end": 167, - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 30 - } - }, + "start":143,"end":167,"loc":{"start":{"line":7,"column":6},"end":{"line":7,"column":30}}, "id": { "type": "Identifier", - "start": 143, - "end": 160, - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 23 - }, - "identifierName": "e" - }, + "start":143,"end":160,"loc":{"start":{"line":7,"column":6},"end":{"line":7,"column":23},"identifierName":"e"}, "name": "e", "typeAnnotation": { "type": "TypeAnnotation", - "start": 144, - "end": 160, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 23 - } - }, + "start":144,"end":160,"loc":{"start":{"line":7,"column":7},"end":{"line":7,"column":23}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 146, - "end": 160, - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 23 - } - }, + "start":146,"end":160,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":23}}, "argument": { "type": "BooleanTypeAnnotation", - "start": 153, - "end": 160, - "loc": { - "start": { - "line": 7, - "column": 16 - }, - "end": { - "line": 7, - "column": 23 - } - } + "start":153,"end":160,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":23}} } } } }, "init": { "type": "StringLiteral", - "start": 163, - "end": 167, - "loc": { - "start": { - "line": 7, - "column": 26 - }, - "end": { - "line": 7, - "column": 30 - } - }, + "start":163,"end":167,"loc":{"start":{"line":7,"column":26},"end":{"line":7,"column":30}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -676,109 +217,31 @@ }, { "type": "VariableDeclaration", - "start": 169, - "end": 198, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 29 - } - }, + "start":169,"end":198,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":29}}, "declarations": [ { "type": "VariableDeclarator", - "start": 175, - "end": 197, - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 28 - } - }, + "start":175,"end":197,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":28}}, "id": { "type": "Identifier", - "start": 175, - "end": 190, - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 21 - }, - "identifierName": "f" - }, + "start":175,"end":190,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":21},"identifierName":"f"}, "name": "f", "typeAnnotation": { "type": "TypeAnnotation", - "start": 176, - "end": 190, - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 21 - } - }, + "start":176,"end":190,"loc":{"start":{"line":8,"column":7},"end":{"line":8,"column":21}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 178, - "end": 190, - "loc": { - "start": { - "line": 8, - "column": 9 - }, - "end": { - "line": 8, - "column": 21 - } - }, + "start":178,"end":190,"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":21}}, "argument": { "type": "EmptyTypeAnnotation", - "start": 185, - "end": 190, - "loc": { - "start": { - "line": 8, - "column": 16 - }, - "end": { - "line": 8, - "column": 21 - } - } + "start":185,"end":190,"loc":{"start":{"line":8,"column":16},"end":{"line":8,"column":21}} } } } }, "init": { "type": "StringLiteral", - "start": 193, - "end": 197, - "loc": { - "start": { - "line": 8, - "column": 24 - }, - "end": { - "line": 8, - "column": 28 - } - }, + "start":193,"end":197,"loc":{"start":{"line":8,"column":24},"end":{"line":8,"column":28}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -791,91 +254,24 @@ }, { "type": "VariableDeclaration", - "start": 199, - "end": 228, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 29 - } - }, + "start":199,"end":228,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":29}}, "declarations": [ { "type": "VariableDeclarator", - "start": 205, - "end": 227, - "loc": { - "start": { - "line": 9, - "column": 6 - }, - "end": { - "line": 9, - "column": 28 - } - }, + "start":205,"end":227,"loc":{"start":{"line":9,"column":6},"end":{"line":9,"column":28}}, "id": { "type": "Identifier", - "start": 205, - "end": 220, - "loc": { - "start": { - "line": 9, - "column": 6 - }, - "end": { - "line": 9, - "column": 21 - }, - "identifierName": "g" - }, + "start":205,"end":220,"loc":{"start":{"line":9,"column":6},"end":{"line":9,"column":21},"identifierName":"g"}, "name": "g", "typeAnnotation": { "type": "TypeAnnotation", - "start": 206, - "end": 220, - "loc": { - "start": { - "line": 9, - "column": 7 - }, - "end": { - "line": 9, - "column": 21 - } - }, + "start":206,"end":220,"loc":{"start":{"line":9,"column":7},"end":{"line":9,"column":21}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 208, - "end": 220, - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 9, - "column": 21 - } - }, + "start":208,"end":220,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":21}}, "argument": { "type": "BooleanLiteralTypeAnnotation", - "start": 215, - "end": 220, - "loc": { - "start": { - "line": 9, - "column": 16 - }, - "end": { - "line": 9, - "column": 21 - } - }, + "start":215,"end":220,"loc":{"start":{"line":9,"column":16},"end":{"line":9,"column":21}}, "value": false } } @@ -883,18 +279,7 @@ }, "init": { "type": "StringLiteral", - "start": 223, - "end": 227, - "loc": { - "start": { - "line": 9, - "column": 24 - }, - "end": { - "line": 9, - "column": 28 - } - }, + "start":223,"end":227,"loc":{"start":{"line":9,"column":24},"end":{"line":9,"column":28}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -907,109 +292,31 @@ }, { "type": "VariableDeclaration", - "start": 229, - "end": 258, - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 10, - "column": 29 - } - }, + "start":229,"end":258,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":29}}, "declarations": [ { "type": "VariableDeclarator", - "start": 235, - "end": 257, - "loc": { - "start": { - "line": 10, - "column": 6 - }, - "end": { - "line": 10, - "column": 28 - } - }, + "start":235,"end":257,"loc":{"start":{"line":10,"column":6},"end":{"line":10,"column":28}}, "id": { "type": "Identifier", - "start": 235, - "end": 250, - "loc": { - "start": { - "line": 10, - "column": 6 - }, - "end": { - "line": 10, - "column": 21 - }, - "identifierName": "h" - }, + "start":235,"end":250,"loc":{"start":{"line":10,"column":6},"end":{"line":10,"column":21},"identifierName":"h"}, "name": "h", "typeAnnotation": { "type": "TypeAnnotation", - "start": 236, - "end": 250, - "loc": { - "start": { - "line": 10, - "column": 7 - }, - "end": { - "line": 10, - "column": 21 - } - }, + "start":236,"end":250,"loc":{"start":{"line":10,"column":7},"end":{"line":10,"column":21}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 238, - "end": 250, - "loc": { - "start": { - "line": 10, - "column": 9 - }, - "end": { - "line": 10, - "column": 21 - } - }, + "start":238,"end":250,"loc":{"start":{"line":10,"column":9},"end":{"line":10,"column":21}}, "argument": { "type": "MixedTypeAnnotation", - "start": 245, - "end": 250, - "loc": { - "start": { - "line": 10, - "column": 16 - }, - "end": { - "line": 10, - "column": 21 - } - } + "start":245,"end":250,"loc":{"start":{"line":10,"column":16},"end":{"line":10,"column":21}} } } } }, "init": { "type": "StringLiteral", - "start": 253, - "end": 257, - "loc": { - "start": { - "line": 10, - "column": 24 - }, - "end": { - "line": 10, - "column": 28 - } - }, + "start":253,"end":257,"loc":{"start":{"line":10,"column":24},"end":{"line":10,"column":28}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -1022,109 +329,31 @@ }, { "type": "VariableDeclaration", - "start": 259, - "end": 287, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 28 - } - }, + "start":259,"end":287,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 265, - "end": 286, - "loc": { - "start": { - "line": 11, - "column": 6 - }, - "end": { - "line": 11, - "column": 27 - } - }, + "start":265,"end":286,"loc":{"start":{"line":11,"column":6},"end":{"line":11,"column":27}}, "id": { "type": "Identifier", - "start": 265, - "end": 279, - "loc": { - "start": { - "line": 11, - "column": 6 - }, - "end": { - "line": 11, - "column": 20 - }, - "identifierName": "i" - }, + "start":265,"end":279,"loc":{"start":{"line":11,"column":6},"end":{"line":11,"column":20},"identifierName":"i"}, "name": "i", "typeAnnotation": { "type": "TypeAnnotation", - "start": 266, - "end": 279, - "loc": { - "start": { - "line": 11, - "column": 7 - }, - "end": { - "line": 11, - "column": 20 - } - }, + "start":266,"end":279,"loc":{"start":{"line":11,"column":7},"end":{"line":11,"column":20}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 268, - "end": 279, - "loc": { - "start": { - "line": 11, - "column": 9 - }, - "end": { - "line": 11, - "column": 20 - } - }, + "start":268,"end":279,"loc":{"start":{"line":11,"column":9},"end":{"line":11,"column":20}}, "argument": { "type": "NullLiteralTypeAnnotation", - "start": 275, - "end": 279, - "loc": { - "start": { - "line": 11, - "column": 16 - }, - "end": { - "line": 11, - "column": 20 - } - } + "start":275,"end":279,"loc":{"start":{"line":11,"column":16},"end":{"line":11,"column":20}} } } } }, "init": { "type": "StringLiteral", - "start": 282, - "end": 286, - "loc": { - "start": { - "line": 11, - "column": 23 - }, - "end": { - "line": 11, - "column": 27 - } - }, + "start":282,"end":286,"loc":{"start":{"line":11,"column":23},"end":{"line":11,"column":27}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -1137,109 +366,31 @@ }, { "type": "VariableDeclaration", - "start": 288, - "end": 318, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 30 - } - }, + "start":288,"end":318,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":30}}, "declarations": [ { "type": "VariableDeclarator", - "start": 294, - "end": 317, - "loc": { - "start": { - "line": 12, - "column": 6 - }, - "end": { - "line": 12, - "column": 29 - } - }, + "start":294,"end":317,"loc":{"start":{"line":12,"column":6},"end":{"line":12,"column":29}}, "id": { "type": "Identifier", - "start": 294, - "end": 310, - "loc": { - "start": { - "line": 12, - "column": 6 - }, - "end": { - "line": 12, - "column": 22 - }, - "identifierName": "j" - }, + "start":294,"end":310,"loc":{"start":{"line":12,"column":6},"end":{"line":12,"column":22},"identifierName":"j"}, "name": "j", "typeAnnotation": { "type": "TypeAnnotation", - "start": 295, - "end": 310, - "loc": { - "start": { - "line": 12, - "column": 7 - }, - "end": { - "line": 12, - "column": 22 - } - }, + "start":295,"end":310,"loc":{"start":{"line":12,"column":7},"end":{"line":12,"column":22}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 297, - "end": 310, - "loc": { - "start": { - "line": 12, - "column": 9 - }, - "end": { - "line": 12, - "column": 22 - } - }, + "start":297,"end":310,"loc":{"start":{"line":12,"column":9},"end":{"line":12,"column":22}}, "argument": { "type": "NumberTypeAnnotation", - "start": 304, - "end": 310, - "loc": { - "start": { - "line": 12, - "column": 16 - }, - "end": { - "line": 12, - "column": 22 - } - } + "start":304,"end":310,"loc":{"start":{"line":12,"column":16},"end":{"line":12,"column":22}} } } } }, "init": { "type": "StringLiteral", - "start": 313, - "end": 317, - "loc": { - "start": { - "line": 12, - "column": 25 - }, - "end": { - "line": 12, - "column": 29 - } - }, + "start":313,"end":317,"loc":{"start":{"line":12,"column":25},"end":{"line":12,"column":29}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -1252,109 +403,31 @@ }, { "type": "VariableDeclaration", - "start": 319, - "end": 349, - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 13, - "column": 30 - } - }, + "start":319,"end":349,"loc":{"start":{"line":13,"column":0},"end":{"line":13,"column":30}}, "declarations": [ { "type": "VariableDeclarator", - "start": 325, - "end": 348, - "loc": { - "start": { - "line": 13, - "column": 6 - }, - "end": { - "line": 13, - "column": 29 - } - }, + "start":325,"end":348,"loc":{"start":{"line":13,"column":6},"end":{"line":13,"column":29}}, "id": { "type": "Identifier", - "start": 325, - "end": 341, - "loc": { - "start": { - "line": 13, - "column": 6 - }, - "end": { - "line": 13, - "column": 22 - }, - "identifierName": "k" - }, + "start":325,"end":341,"loc":{"start":{"line":13,"column":6},"end":{"line":13,"column":22},"identifierName":"k"}, "name": "k", "typeAnnotation": { "type": "TypeAnnotation", - "start": 326, - "end": 341, - "loc": { - "start": { - "line": 13, - "column": 7 - }, - "end": { - "line": 13, - "column": 22 - } - }, + "start":326,"end":341,"loc":{"start":{"line":13,"column":7},"end":{"line":13,"column":22}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 328, - "end": 341, - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 22 - } - }, + "start":328,"end":341,"loc":{"start":{"line":13,"column":9},"end":{"line":13,"column":22}}, "argument": { "type": "StringTypeAnnotation", - "start": 335, - "end": 341, - "loc": { - "start": { - "line": 13, - "column": 16 - }, - "end": { - "line": 13, - "column": 22 - } - } + "start":335,"end":341,"loc":{"start":{"line":13,"column":16},"end":{"line":13,"column":22}} } } } }, "init": { "type": "StringLiteral", - "start": 344, - "end": 348, - "loc": { - "start": { - "line": 13, - "column": 25 - }, - "end": { - "line": 13, - "column": 29 - } - }, + "start":344,"end":348,"loc":{"start":{"line":13,"column":25},"end":{"line":13,"column":29}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -1367,91 +440,24 @@ }, { "type": "VariableDeclaration", - "start": 350, - "end": 378, - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 28 - } - }, + "start":350,"end":378,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 356, - "end": 377, - "loc": { - "start": { - "line": 14, - "column": 6 - }, - "end": { - "line": 14, - "column": 27 - } - }, + "start":356,"end":377,"loc":{"start":{"line":14,"column":6},"end":{"line":14,"column":27}}, "id": { "type": "Identifier", - "start": 356, - "end": 370, - "loc": { - "start": { - "line": 14, - "column": 6 - }, - "end": { - "line": 14, - "column": 20 - }, - "identifierName": "l" - }, + "start":356,"end":370,"loc":{"start":{"line":14,"column":6},"end":{"line":14,"column":20},"identifierName":"l"}, "name": "l", "typeAnnotation": { "type": "TypeAnnotation", - "start": 357, - "end": 370, - "loc": { - "start": { - "line": 14, - "column": 7 - }, - "end": { - "line": 14, - "column": 20 - } - }, + "start":357,"end":370,"loc":{"start":{"line":14,"column":7},"end":{"line":14,"column":20}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 359, - "end": 370, - "loc": { - "start": { - "line": 14, - "column": 9 - }, - "end": { - "line": 14, - "column": 20 - } - }, + "start":359,"end":370,"loc":{"start":{"line":14,"column":9},"end":{"line":14,"column":20}}, "argument": { "type": "BooleanLiteralTypeAnnotation", - "start": 366, - "end": 370, - "loc": { - "start": { - "line": 14, - "column": 16 - }, - "end": { - "line": 14, - "column": 20 - } - }, + "start":366,"end":370,"loc":{"start":{"line":14,"column":16},"end":{"line":14,"column":20}}, "value": true } } @@ -1459,18 +465,7 @@ }, "init": { "type": "StringLiteral", - "start": 373, - "end": 377, - "loc": { - "start": { - "line": 14, - "column": 23 - }, - "end": { - "line": 14, - "column": 27 - } - }, + "start":373,"end":377,"loc":{"start":{"line":14,"column":23},"end":{"line":14,"column":27}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -1483,109 +478,31 @@ }, { "type": "VariableDeclaration", - "start": 379, - "end": 407, - "loc": { - "start": { - "line": 15, - "column": 0 - }, - "end": { - "line": 15, - "column": 28 - } - }, + "start":379,"end":407,"loc":{"start":{"line":15,"column":0},"end":{"line":15,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 385, - "end": 406, - "loc": { - "start": { - "line": 15, - "column": 6 - }, - "end": { - "line": 15, - "column": 27 - } - }, + "start":385,"end":406,"loc":{"start":{"line":15,"column":6},"end":{"line":15,"column":27}}, "id": { "type": "Identifier", - "start": 385, - "end": 399, - "loc": { - "start": { - "line": 15, - "column": 6 - }, - "end": { - "line": 15, - "column": 20 - }, - "identifierName": "m" - }, + "start":385,"end":399,"loc":{"start":{"line":15,"column":6},"end":{"line":15,"column":20},"identifierName":"m"}, "name": "m", "typeAnnotation": { "type": "TypeAnnotation", - "start": 386, - "end": 399, - "loc": { - "start": { - "line": 15, - "column": 7 - }, - "end": { - "line": 15, - "column": 20 - } - }, + "start":386,"end":399,"loc":{"start":{"line":15,"column":7},"end":{"line":15,"column":20}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 388, - "end": 399, - "loc": { - "start": { - "line": 15, - "column": 9 - }, - "end": { - "line": 15, - "column": 20 - } - }, + "start":388,"end":399,"loc":{"start":{"line":15,"column":9},"end":{"line":15,"column":20}}, "argument": { "type": "VoidTypeAnnotation", - "start": 395, - "end": 399, - "loc": { - "start": { - "line": 15, - "column": 16 - }, - "end": { - "line": 15, - "column": 20 - } - } + "start":395,"end":399,"loc":{"start":{"line":15,"column":16},"end":{"line":15,"column":20}} } } } }, "init": { "type": "StringLiteral", - "start": 402, - "end": 406, - "loc": { - "start": { - "line": 15, - "column": 23 - }, - "end": { - "line": 15, - "column": 27 - } - }, + "start":402,"end":406,"loc":{"start":{"line":15,"column":23},"end":{"line":15,"column":27}}, "extra": { "rawValue": "hi", "raw": "\"hi\"" @@ -1603,18 +520,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/output.json index a08797bcf3..8b2be7f584 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-invalid/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25` (1:20)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -68,49 +23,15 @@ "params": [ { "type": "AssignmentPattern", - "start": 11, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":11,"end":28,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":28}}, "left": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "StringLiteral", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "extra": { "rawValue": "1", "raw": "\"1\"" @@ -119,50 +40,17 @@ }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":22,"end":28,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":28}} } } } ], "body": { "type": "BlockStatement", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":30,"end":32,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":32}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-valid/output.json b/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-valid/output.json index b6326ce6a2..a779d3c652 100644 --- a/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-valid/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-annotations/with-default-valid/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -65,79 +20,23 @@ "params": [ { "type": "AssignmentPattern", - "start": 11, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":11,"end":28,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":28}}, "left": { "type": "Identifier", - "start": 11, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "foo" - }, + "start":11,"end":22,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":22},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TypeAnnotation", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":14,"end":22,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":22}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} } } }, "right": { "type": "StringLiteral", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":25,"end":28,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":28}}, "extra": { "rawValue": "1", "raw": "\"1\"" @@ -148,18 +47,7 @@ ], "body": { "type": "BlockStatement", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":30,"end":32,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":32}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-exports/alias/output.json b/packages/babel-parser/test/fixtures/flow/type-exports/alias/output.json index 8d791a0815..69bcdc69f5 100644 --- a/packages/babel-parser/test/fixtures/flow/type-exports/alias/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-exports/alias/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "specifiers": [], "source": null, "exportKind": "type", "declaration": { "type": "TypeAlias", - "start": 7, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":7,"end":23,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "a" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"a"}, "name": "a" }, "typeParameters": null, "right": { "type": "NumberTypeAnnotation", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/type-exports/interface/output.json b/packages/babel-parser/test/fixtures/flow/type-exports/interface/output.json index 01516efbba..61c9e46c17 100644 --- a/packages/babel-parser/test/fixtures/flow/type-exports/interface/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-exports/interface/output.json @@ -1,80 +1,24 @@ { "type": "File", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "specifiers": [], "source": null, "exportKind": "type", "declaration": { "type": "InterfaceDeclaration", - "start": 7, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":7,"end":34,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"foo"}, "name": "foo" }, "typeParameters": null, @@ -83,49 +27,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 21, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":21,"end":34,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":34}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 23, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":23,"end":32,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":32}}, "key": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "p" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"p"}, "name": "p" }, "static": false, @@ -134,18 +44,7 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - } + "start":26,"end":32,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":32}} }, "variance": null, "optional": false @@ -159,96 +58,29 @@ }, { "type": "EmptyStatement", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35}} }, { "type": "ExportNamedDeclaration", - "start": 36, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":36,"end":68,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":32}}, "specifiers": [], "source": null, "exportKind": "type", "declaration": { "type": "InterfaceDeclaration", - "start": 43, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":43,"end":68,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":32}}, "id": { "type": "Identifier", - "start": 53, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "bar" - }, + "start":53,"end":56,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":20},"identifierName":"bar"}, "name": "bar" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 56, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":56,"end":59,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23}}, "params": [ { "type": "TypeParameter", - "start": 57, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":57,"end":58,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22}}, "name": "T", "variance": null } @@ -259,49 +91,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 60, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":60,"end":68,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":32}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 62, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":62,"end":66,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":30}}, "key": { "type": "Identifier", - "start": 62, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "p" - }, + "start":62,"end":63,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":27},"identifierName":"p"}, "name": "p" }, "static": false, @@ -310,34 +108,11 @@ "method": false, "value": { "type": "GenericTypeAnnotation", - "start": 65, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":65,"end":66,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":30}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 65, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 30 - }, - "identifierName": "T" - }, + "start":65,"end":66,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":30},"identifierName":"T"}, "name": "T" } }, @@ -353,18 +128,7 @@ }, { "type": "EmptyStatement", - "start": 68, - "end": 69, - "loc": { - "start": { - "line": 2, - "column": 32 - }, - "end": { - "line": 2, - "column": 33 - } - } + "start":68,"end":69,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":33}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-exports/specifier-from/output.json b/packages/babel-parser/test/fixtures/flow/type-exports/specifier-from/output.json index 74d1c761b0..aed14419e6 100644 --- a/packages/babel-parser/test/fixtures/flow/type-exports/specifier-from/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-exports/specifier-from/output.json @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "local": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"foo"}, "name": "foo" }, "exported": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"foo"}, "name": "foo" } } ], "source": { "type": "StringLiteral", - "start": 25, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":25,"end":33,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":33}}, "extra": { "rawValue": "foobar", "raw": "\"foobar\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-exports/specifier/output.json b/packages/babel-parser/test/fixtures/flow/type-exports/specifier/output.json index f4d18be825..b562088728 100644 --- a/packages/babel-parser/test/fixtures/flow/type-exports/specifier/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-exports/specifier/output.json @@ -1,78 +1,22 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "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" }, "init": null @@ -82,65 +26,19 @@ }, { "type": "ExportNamedDeclaration", - "start": 9, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":9,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":20}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":23,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17}}, "local": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "foo" - }, + "start":23,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17},"identifierName":"foo"}, "name": "foo" }, "exported": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "foo" - }, + "start":23,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17},"identifierName":"foo"}, "name": "foo" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-exports/star-from/output.json b/packages/babel-parser/test/fixtures/flow/type-exports/star-from/output.json index 64a6f20b34..0a08fa97c4 100644 --- a/packages/babel-parser/test/fixtures/flow/type-exports/star-from/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-exports/star-from/output.json @@ -1,63 +1,19 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportAllDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "exportKind": "type", "source": { "type": "StringLiteral", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-generics/1/output.json b/packages/babel-parser/test/fixtures/flow/type-generics/1/output.json index a93a2ad01c..13f0e7bd7a 100644 --- a/packages/babel-parser/test/fixtures/flow/type-generics/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-generics/1/output.json @@ -1,206 +1,60 @@ { "type": "File", - "start": 0, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 84 - } - }, + "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":84}}, "program": { "type": "Program", - "start": 0, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 84 - } - }, + "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":84}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 84 - } - }, + "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":84}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 83 - } - }, + "start":6,"end":83,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":83}}, "id": { "type": "Identifier", - "start": 6, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "functionReturningIdentityAsAField" - }, + "start":6,"end":39,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":39},"identifierName":"functionReturningIdentityAsAField"}, "name": "functionReturningIdentityAsAField" }, "init": { "type": "ArrowFunctionExpression", - "start": 42, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 83 - } - }, + "start":42,"end":83,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":83}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "ObjectExpression", - "start": 49, - "end": 82, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 82 - } - }, + "start":49,"end":82,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":82}}, "properties": [ { "type": "ObjectProperty", - "start": 51, - "end": 80, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 80 - } - }, + "start":51,"end":80,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":80}}, "method": false, "key": { "type": "Identifier", - "start": 51, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 53 - }, - "identifierName": "id" - }, + "start":51,"end":53,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":53},"identifierName":"id"}, "name": "id" }, "computed": false, "shorthand": false, "value": { "type": "ArrowFunctionExpression", - "start": 55, - "end": 80, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 80 - } - }, + "start":55,"end":80,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":80}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 68, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 68 - }, - "end": { - "line": 1, - "column": 71 - } - }, + "start":68,"end":71,"loc":{"start":{"line":1,"column":68},"end":{"line":1,"column":71}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 70, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 70 - }, - "end": { - "line": 1, - "column": 71 - } - }, + "start":70,"end":71,"loc":{"start":{"line":1,"column":70},"end":{"line":1,"column":71}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 70, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 70 - }, - "end": { - "line": 1, - "column": 71 - }, - "identifierName": "T" - }, + "start":70,"end":71,"loc":{"start":{"line":1,"column":70},"end":{"line":1,"column":71},"identifierName":"T"}, "name": "T" } } @@ -211,64 +65,18 @@ "params": [ { "type": "Identifier", - "start": 59, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 59 - }, - "end": { - "line": 1, - "column": 67 - }, - "identifierName": "value" - }, + "start":59,"end":67,"loc":{"start":{"line":1,"column":59},"end":{"line":1,"column":67},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TypeAnnotation", - "start": 64, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 64 - }, - "end": { - "line": 1, - "column": 67 - } - }, + "start":64,"end":67,"loc":{"start":{"line":1,"column":64},"end":{"line":1,"column":67}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 66, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 66 - }, - "end": { - "line": 1, - "column": 67 - } - }, + "start":66,"end":67,"loc":{"start":{"line":1,"column":66},"end":{"line":1,"column":67}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 66, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 66 - }, - "end": { - "line": 1, - "column": 67 - }, - "identifierName": "T" - }, + "start":66,"end":67,"loc":{"start":{"line":1,"column":66},"end":{"line":1,"column":67},"identifierName":"T"}, "name": "T" } } @@ -277,50 +85,16 @@ ], "body": { "type": "Identifier", - "start": 75, - "end": 80, - "loc": { - "start": { - "line": 1, - "column": 75 - }, - "end": { - "line": 1, - "column": 80 - }, - "identifierName": "value" - }, + "start":75,"end":80,"loc":{"start":{"line":1,"column":75},"end":{"line":1,"column":80},"identifierName":"value"}, "name": "value" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 55, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 58 - } - }, + "start":55,"end":58,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":58}}, "params": [ { "type": "TypeParameter", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 56 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":56,"end":57,"loc":{"start":{"line":1,"column":56},"end":{"line":1,"column":57}}, "name": "T", "variance": null } diff --git a/packages/babel-parser/test/fixtures/flow/type-generics/2/output.json b/packages/babel-parser/test/fixtures/flow/type-generics/2/output.json index 2fd6fbcbc2..60caa7c859 100644 --- a/packages/babel-parser/test/fixtures/flow/type-generics/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-generics/2/output.json @@ -1,139 +1,38 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":6,"end":34,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "identity" - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14},"identifierName":"identity"}, "name": "identity" }, "init": { "type": "ArrowFunctionExpression", - "start": 17, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":17,"end":34,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":34}}, "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "T" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"T"}, "name": "T" } } @@ -144,64 +43,18 @@ "params": [ { "type": "Identifier", - "start": 21, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "t" - }, + "start":21,"end":25,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":25},"identifierName":"t"}, "name": "t", "typeAnnotation": { "type": "TypeAnnotation", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "T" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"T"}, "name": "T" } } @@ -210,50 +63,16 @@ ], "body": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "t" - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"t"}, "name": "t" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}}, "params": [ { "type": "TypeParameter", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "name": "T", "variance": null } @@ -266,64 +85,19 @@ }, { "type": "VariableDeclaration", - "start": 36, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":36,"end":48,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 42, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":42,"end":47,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "a" - }, + "start":42,"end":43,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"a"}, "name": "a" }, "init": { "type": "NumericLiteral", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":46,"end":47,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11}}, "extra": { "rawValue": 1, "raw": "1" 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 cfa41720d8..fa4b9aa787 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 @@ -1,204 +1,57 @@ { "type": "File", - "start": 0, - "end": 167, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 32 - } - }, + "start":0,"end":167,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":32}}, "program": { "type": "Program", - "start": 0, - "end": 167, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 32 - } - }, + "start":0,"end":167,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":32}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "left": { "type": "BinaryExpression", - "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}}, "left": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "async" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"async"}, "name": "async" }, "operator": "<", "right": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "T" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"T"}, "name": "T" } }, "operator": ">", "right": { "type": "TypeCastExpression", - "start": 10, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21}}, "expression": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "fn" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"fn"}, "name": "fn" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 12, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":12,"end":21,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 14, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":14,"end":21,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":21}}, "params": [], "rest": null, "returnType": { "type": "GenericTypeAnnotation", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "T" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"T"}, "name": "T" } }, @@ -215,158 +68,45 @@ { "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 - } - } + "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 - } - } + "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 - } - }, + "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 - } - }, + "start":136,"end":165,"loc":{"start":{"line":5,"column":1},"end":{"line":5,"column":30}}, "expression": { "type": "BinaryExpression", - "start": 136, - "end": 156, - "loc": { - "start": { - "line": 5, - "column": 1 - }, - "end": { - "line": 5, - "column": 21 - } - }, + "start":136,"end":156,"loc":{"start":{"line":5,"column":1},"end":{"line":5,"column":21}}, "left": { "type": "BinaryExpression", - "start": 136, - "end": 148, - "loc": { - "start": { - "line": 5, - "column": 1 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":136,"end":148,"loc":{"start":{"line":5,"column":1},"end":{"line":5,"column":13}}, "left": { "type": "Identifier", - "start": 136, - "end": 141, - "loc": { - "start": { - "line": 5, - "column": 1 - }, - "end": { - "line": 5, - "column": 6 - }, - "identifierName": "async" - }, + "start":136,"end":141,"loc":{"start":{"line":5,"column":1},"end":{"line":5,"column":6},"identifierName":"async"}, "name": "async" }, "operator": "<", "right": { "type": "BinaryExpression", - "start": 143, - "end": 148, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":143,"end":148,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":13}}, "left": { "type": "Identifier", - "start": 143, - "end": 144, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 9 - }, - "identifierName": "T" - }, + "start":143,"end":144,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":9},"identifierName":"T"}, "name": "T" }, "operator": "+", "right": { "type": "Identifier", - "start": 147, - "end": 148, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 13 - }, - "identifierName": "U" - }, + "start":147,"end":148,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":13},"identifierName":"U"}, "name": "U" } } @@ -374,79 +114,22 @@ "operator": ">", "right": { "type": "TypeCastExpression", - "start": 150, - "end": 155, - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 20 - } - }, + "start":150,"end":155,"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":20}}, "expression": { "type": "Identifier", - "start": 150, - "end": 152, - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 17 - }, - "identifierName": "fn" - }, + "start":150,"end":152,"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":17},"identifierName":"fn"}, "name": "fn" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 152, - "end": 155, - "loc": { - "start": { - "line": 5, - "column": 17 - }, - "end": { - "line": 5, - "column": 20 - } - }, + "start":152,"end":155,"loc":{"start":{"line":5,"column":17},"end":{"line":5,"column":20}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 154, - "end": 155, - "loc": { - "start": { - "line": 5, - "column": 19 - }, - "end": { - "line": 5, - "column": 20 - } - }, + "start":154,"end":155,"loc":{"start":{"line":5,"column":19},"end":{"line":5,"column":20}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 154, - "end": 155, - "loc": { - "start": { - "line": 5, - "column": 19 - }, - "end": { - "line": 5, - "column": 20 - }, - "identifierName": "T" - }, + "start":154,"end":155,"loc":{"start":{"line":5,"column":19},"end":{"line":5,"column":20},"identifierName":"T"}, "name": "T" } } @@ -459,79 +142,23 @@ }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 156, - "end": 165, - "loc": { - "start": { - "line": 5, - "column": 21 - }, - "end": { - "line": 5, - "column": 30 - } - }, + "start":156,"end":165,"loc":{"start":{"line":5,"column":21},"end":{"line":5,"column":30}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 158, - "end": 165, - "loc": { - "start": { - "line": 5, - "column": 23 - }, - "end": { - "line": 5, - "column": 30 - } - }, + "start":158,"end":165,"loc":{"start":{"line":5,"column":23},"end":{"line":5,"column":30}}, "params": [ { "type": "FunctionTypeParam", - "start": 158, - "end": 162, - "loc": { - "start": { - "line": 5, - "column": 23 - }, - "end": { - "line": 5, - "column": 27 - } - }, + "start":158,"end":162,"loc":{"start":{"line":5,"column":23},"end":{"line":5,"column":27}}, "name": null, "optional": false, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 158, - "end": 159, - "loc": { - "start": { - "line": 5, - "column": 23 - }, - "end": { - "line": 5, - "column": 24 - } - }, + "start":158,"end":159,"loc":{"start":{"line":5,"column":23},"end":{"line":5,"column":24}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 158, - "end": 159, - "loc": { - "start": { - "line": 5, - "column": 23 - }, - "end": { - "line": 5, - "column": 24 - }, - "identifierName": "T" - }, + "start":158,"end":159,"loc":{"start":{"line":5,"column":23},"end":{"line":5,"column":24},"identifierName":"T"}, "name": "T" } } @@ -540,34 +167,11 @@ "rest": null, "returnType": { "type": "GenericTypeAnnotation", - "start": 163, - "end": 165, - "loc": { - "start": { - "line": 5, - "column": 28 - }, - "end": { - "line": 5, - "column": 30 - } - }, + "start":163,"end":165,"loc":{"start":{"line":5,"column":28},"end":{"line":5,"column":30}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 163, - "end": 165, - "loc": { - "start": { - "line": 5, - "column": 28 - }, - "end": { - "line": 5, - "column": 30 - }, - "identifierName": "fn" - }, + "start":163,"end":165,"loc":{"start":{"line":5,"column":28},"end":{"line":5,"column":30},"identifierName":"fn"}, "name": "fn" } }, @@ -583,34 +187,12 @@ { "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 - } - } + "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 - } - } + "start":96,"end":134,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":38}} } ] } @@ -621,34 +203,12 @@ { "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 - } - } + "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 - } - } + "start":96,"end":134,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":38}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-rest-optional-parameters/output.json b/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-rest-optional-parameters/output.json index f7a9d83482..afd2b79b22 100644 --- a/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-rest-optional-parameters/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-rest-optional-parameters/output.json @@ -1,144 +1,44 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": null, "generator": false, "async": true, "params": [ { "type": "RestElement", - "start": 7, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":7,"end":20,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":20}}, "argument": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "args" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"args"}, "name": "args" }, "optional": true, "typeAnnotation": { "type": "TypeAnnotation", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "typeAnnotation": { "type": "AnyTypeAnnotation", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}} } } } ], "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-rest/output.json b/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-rest/output.json index 52961a4c61..aa6840c310 100644 --- a/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-rest/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow-rest/output.json @@ -1,143 +1,43 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "id": null, "generator": false, "async": true, "params": [ { "type": "RestElement", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "argument": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "args" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"args"}, "name": "args" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19}}, "typeAnnotation": { "type": "AnyTypeAnnotation", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}} } } } ], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow/output.json b/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow/output.json index e423abed1e..3a4d934f13 100644 --- a/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-generics/async-arrow/output.json @@ -1,91 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9}}, "params": [ { "type": "TypeParameter", - "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}}, "name": "T", "variance": null } @@ -94,80 +28,23 @@ "params": [ { "type": "Identifier", - "start": 10, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "fn" - }, + "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21},"identifierName":"fn"}, "name": "fn", "typeAnnotation": { "type": "TypeAnnotation", - "start": 12, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":12,"end":21,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 14, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":14,"end":21,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":21}}, "params": [], "rest": null, "returnType": { "type": "GenericTypeAnnotation", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "T" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"T"}, "name": "T" } }, @@ -181,19 +58,7 @@ "async": true, "body": { "type": "Identifier", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "fn" - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28},"identifierName":"fn"}, "name": "fn" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-generics/with-jsx/output.json b/packages/babel-parser/test/fixtures/flow/type-generics/with-jsx/output.json index b859028ce9..a06d19da59 100644 --- a/packages/babel-parser/test/fixtures/flow/type-generics/with-jsx/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-generics/with-jsx/output.json @@ -1,154 +1,42 @@ { "type": "File", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "program": { "type": "Program", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":0,"end":54,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":54}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":4,"end":53,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":53}}, "id": { "type": "Identifier", - "start": 4, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "child" - }, + "start":4,"end":23,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":23},"identifierName":"child"}, "name": "child", "typeAnnotation": { "type": "TypeAnnotation", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 11, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":11,"end":23,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":23}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "params": [ { "type": "AnyTypeAnnotation", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}} } ] }, "id": { "type": "Identifier", - "start": 11, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "Element" - }, + "start":11,"end":18,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":18},"identifierName":"Element"}, "name": "Element" } } @@ -156,140 +44,45 @@ }, "init": { "type": "JSXElement", - "start": 26, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":26,"end":53,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":53}}, "openingElement": { "type": "JSXOpeningElement", - "start": 26, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 53 - } + "start":26,"end":53,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":53}}, + "name": { + "type": "JSXIdentifier", + "start":27,"end":30,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":30}}, + "name": "img" }, "attributes": [ { "type": "JSXAttribute", - "start": 31, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":31,"end":40,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":40}}, "name": { "type": "JSXIdentifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":31,"end":34,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":34}}, "name": "src" }, "value": { "type": "JSXExpressionContainer", - "start": 35, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":35,"end":40,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":40}}, "expression": { "type": "Identifier", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "url" - }, + "start":36,"end":39,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":39},"identifierName":"url"}, "name": "url" } } }, { "type": "JSXAttribute", - "start": 41, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":41,"end":50,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":50}}, "name": { "type": "JSXIdentifier", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":41,"end":44,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":44}}, "name": "key" }, "value": { "type": "StringLiteral", - "start": 45, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":45,"end":50,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":50}}, "extra": { "rawValue": "img", "raw": "\"img\"" @@ -298,22 +91,6 @@ } } ], - "name": { - "type": "JSXIdentifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 30 - } - }, - "name": "img" - }, "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/flow/type-grouping/1/output.json b/packages/babel-parser/test/fixtures/flow/type-grouping/1/output.json index 8597e224ee..efea0dcec9 100644 --- a/packages/babel-parser/test/fixtures/flow/type-grouping/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-grouping/1/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "a" - }, + "start":4,"end":15,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":15},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":5,"end":15,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":15}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}} } } }, diff --git a/packages/babel-parser/test/fixtures/flow/type-grouping/2/output.json b/packages/babel-parser/test/fixtures/flow/type-grouping/2/output.json index d9d33e1521..f2ee74dd93 100644 --- a/packages/babel-parser/test/fixtures/flow/type-grouping/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-grouping/2/output.json @@ -1,171 +1,49 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "a" - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":5,"end":36,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":36}}, "typeAnnotation": { "type": "UnionTypeAnnotation", - "start": 7, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":7,"end":36,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":36}}, "types": [ { "type": "FunctionTypeAnnotation", - "start": 8, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":8,"end":20,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":20}}, "params": [], "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}} }, "typeParameters": null }, { "type": "FunctionTypeAnnotation", - "start": 24, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":24,"end":36,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":36}}, "params": [], "rest": null, "returnType": { "type": "StringTypeAnnotation", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - } + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/type-grouping/3/output.json b/packages/babel-parser/test/fixtures/flow/type-grouping/3/output.json index afe9eb91a1..8d3f055fab 100644 --- a/packages/babel-parser/test/fixtures/flow/type-grouping/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-grouping/3/output.json @@ -1,167 +1,45 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":4,"end":31,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 4, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "a" - }, + "start":4,"end":31,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":31},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":5,"end":31,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":31}}, "typeAnnotation": { "type": "IntersectionTypeAnnotation", - "start": 7, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":7,"end":31,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":31}}, "types": [ { "type": "NumberTypeAnnotation", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}} }, { "type": "UnionTypeAnnotation", - "start": 17, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":17,"end":30,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":30}}, "types": [ { "type": "StringTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} }, { "type": "BooleanTypeAnnotation", - "start": 26, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":26,"end":30,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":30}} } ] } diff --git a/packages/babel-parser/test/fixtures/flow/type-grouping/4/output.json b/packages/babel-parser/test/fixtures/flow/type-grouping/4/output.json index 2120244101..c286ce7a9b 100644 --- a/packages/babel-parser/test/fixtures/flow/type-grouping/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-grouping/4/output.json @@ -1,137 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":4,"end":17,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":5,"end":17,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "TypeofTypeAnnotation", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":8,"end":16,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":16}}, "argument": { "type": "GenericTypeAnnotation", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "A" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"A"}, "name": "A" } } diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/import-type-2/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/import-type-2/output.json index f5fc078a42..2406bba2f4 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/import-type-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/import-type-2/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "local": { "type": "Identifier", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "type" - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11},"identifierName":"type"}, "name": "type" } }, { "type": "ImportSpecifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "imported": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" }, "importKind": null, "local": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "foo" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"foo"}, "name": "foo" } } @@ -130,18 +39,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/import-type-shorthand/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/import-type-shorthand/output.json index aeb7eded07..437eac4708 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/import-type-shorthand/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/import-type-shorthand/output.json @@ -1,96 +1,28 @@ { "type": "File", - "start": 0, - "end": 320, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 35 - } - }, + "start":0,"end":320,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":35}}, "program": { "type": "Program", - "start": 0, - "end": 320, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 35 - } - }, + "start":0,"end":320,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":35}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "imported": { "type": "Identifier", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "type" - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"type"}, "name": "type" }, "importKind": null, "local": { "type": "Identifier", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "type" - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12},"identifierName":"type"}, "name": "type" } } @@ -98,18 +30,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -119,66 +40,20 @@ }, { "type": "ImportDeclaration", - "start": 26, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":26,"end":53,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 34, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":34,"end":40,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14}}, "imported": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "t" - }, + "start":39,"end":40,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"t"}, "name": "t" }, "importKind": "type", "local": { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "t" - }, + "start":39,"end":40,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"t"}, "name": "t" } } @@ -186,18 +61,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 47, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":47,"end":52,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":26}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -207,66 +71,20 @@ }, { "type": "ImportDeclaration", - "start": 54, - "end": 82, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 28 - } - }, + "start":54,"end":82,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":28}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 62, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":62,"end":69,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":15}}, "imported": { "type": "Identifier", - "start": 67, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "as" - }, + "start":67,"end":69,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15},"identifierName":"as"}, "name": "as" }, "importKind": "type", "local": { "type": "Identifier", - "start": 67, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "as" - }, + "start":67,"end":69,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15},"identifierName":"as"}, "name": "as" } } @@ -274,18 +92,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 76, - "end": 81, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":76,"end":81,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":27}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -295,66 +102,20 @@ }, { "type": "ImportDeclaration", - "start": 83, - "end": 118, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 35 - } - }, + "start":83,"end":118,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":35}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 91, - "end": 105, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 22 - } - }, + "start":91,"end":105,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":22}}, "imported": { "type": "Identifier", - "start": 96, - "end": 98, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 15 - }, - "identifierName": "as" - }, + "start":96,"end":98,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":15},"identifierName":"as"}, "name": "as" }, "importKind": "type", "local": { "type": "Identifier", - "start": 102, - "end": 105, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 22 - }, - "identifierName": "foo" - }, + "start":102,"end":105,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":22},"identifierName":"foo"}, "name": "foo" } } @@ -362,18 +123,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 112, - "end": 117, - "loc": { - "start": { - "line": 4, - "column": 29 - }, - "end": { - "line": 4, - "column": 34 - } - }, + "start":112,"end":117,"loc":{"start":{"line":4,"column":29},"end":{"line":4,"column":34}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -383,66 +133,20 @@ }, { "type": "ImportDeclaration", - "start": 119, - "end": 151, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 32 - } - }, + "start":119,"end":151,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":32}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 127, - "end": 138, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 19 - } - }, + "start":127,"end":138,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":19}}, "imported": { "type": "Identifier", - "start": 132, - "end": 133, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 14 - }, - "identifierName": "t" - }, + "start":132,"end":133,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":14},"identifierName":"t"}, "name": "t" }, "importKind": "type", "local": { "type": "Identifier", - "start": 137, - "end": 138, - "loc": { - "start": { - "line": 5, - "column": 18 - }, - "end": { - "line": 5, - "column": 19 - }, - "identifierName": "u" - }, + "start":137,"end":138,"loc":{"start":{"line":5,"column":18},"end":{"line":5,"column":19},"identifierName":"u"}, "name": "u" } } @@ -450,18 +154,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 145, - "end": 150, - "loc": { - "start": { - "line": 5, - "column": 26 - }, - "end": { - "line": 5, - "column": 31 - } - }, + "start":145,"end":150,"loc":{"start":{"line":5,"column":26},"end":{"line":5,"column":31}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -471,66 +164,20 @@ }, { "type": "ImportDeclaration", - "start": 152, - "end": 184, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 32 - } - }, + "start":152,"end":184,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":32}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 160, - "end": 171, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 6, - "column": 19 - } - }, + "start":160,"end":171,"loc":{"start":{"line":6,"column":8},"end":{"line":6,"column":19}}, "imported": { "type": "Identifier", - "start": 165, - "end": 171, - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 6, - "column": 19 - }, - "identifierName": "switch" - }, + "start":165,"end":171,"loc":{"start":{"line":6,"column":13},"end":{"line":6,"column":19},"identifierName":"switch"}, "name": "switch" }, "importKind": "type", "local": { "type": "Identifier", - "start": 165, - "end": 171, - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 6, - "column": 19 - }, - "identifierName": "switch" - }, + "start":165,"end":171,"loc":{"start":{"line":6,"column":13},"end":{"line":6,"column":19},"identifierName":"switch"}, "name": "switch" } } @@ -538,18 +185,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 178, - "end": 183, - "loc": { - "start": { - "line": 6, - "column": 26 - }, - "end": { - "line": 6, - "column": 31 - } - }, + "start":178,"end":183,"loc":{"start":{"line":6,"column":26},"end":{"line":6,"column":31}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -559,66 +195,20 @@ }, { "type": "ImportDeclaration", - "start": 186, - "end": 216, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 30 - } - }, + "start":186,"end":216,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":30}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 194, - "end": 203, - "loc": { - "start": { - "line": 8, - "column": 8 - }, - "end": { - "line": 8, - "column": 17 - } - }, + "start":194,"end":203,"loc":{"start":{"line":8,"column":8},"end":{"line":8,"column":17}}, "imported": { "type": "Identifier", - "start": 201, - "end": 203, - "loc": { - "start": { - "line": 8, - "column": 15 - }, - "end": { - "line": 8, - "column": 17 - }, - "identifierName": "t2" - }, + "start":201,"end":203,"loc":{"start":{"line":8,"column":15},"end":{"line":8,"column":17},"identifierName":"t2"}, "name": "t2" }, "importKind": "typeof", "local": { "type": "Identifier", - "start": 201, - "end": 203, - "loc": { - "start": { - "line": 8, - "column": 15 - }, - "end": { - "line": 8, - "column": 17 - }, - "identifierName": "t2" - }, + "start":201,"end":203,"loc":{"start":{"line":8,"column":15},"end":{"line":8,"column":17},"identifierName":"t2"}, "name": "t2" } } @@ -626,18 +216,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 210, - "end": 215, - "loc": { - "start": { - "line": 8, - "column": 24 - }, - "end": { - "line": 8, - "column": 29 - } - }, + "start":210,"end":215,"loc":{"start":{"line":8,"column":24},"end":{"line":8,"column":29}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -647,66 +226,20 @@ }, { "type": "ImportDeclaration", - "start": 217, - "end": 248, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 31 - } - }, + "start":217,"end":248,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":31}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 225, - "end": 235, - "loc": { - "start": { - "line": 9, - "column": 8 - }, - "end": { - "line": 9, - "column": 18 - } - }, + "start":225,"end":235,"loc":{"start":{"line":9,"column":8},"end":{"line":9,"column":18}}, "imported": { "type": "Identifier", - "start": 232, - "end": 235, - "loc": { - "start": { - "line": 9, - "column": 15 - }, - "end": { - "line": 9, - "column": 18 - }, - "identifierName": "as2" - }, + "start":232,"end":235,"loc":{"start":{"line":9,"column":15},"end":{"line":9,"column":18},"identifierName":"as2"}, "name": "as2" }, "importKind": "typeof", "local": { "type": "Identifier", - "start": 232, - "end": 235, - "loc": { - "start": { - "line": 9, - "column": 15 - }, - "end": { - "line": 9, - "column": 18 - }, - "identifierName": "as2" - }, + "start":232,"end":235,"loc":{"start":{"line":9,"column":15},"end":{"line":9,"column":18},"identifierName":"as2"}, "name": "as2" } } @@ -714,18 +247,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 242, - "end": 247, - "loc": { - "start": { - "line": 9, - "column": 25 - }, - "end": { - "line": 9, - "column": 30 - } - }, + "start":242,"end":247,"loc":{"start":{"line":9,"column":25},"end":{"line":9,"column":30}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -735,66 +257,20 @@ }, { "type": "ImportDeclaration", - "start": 249, - "end": 284, - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 10, - "column": 35 - } - }, + "start":249,"end":284,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":35}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 257, - "end": 271, - "loc": { - "start": { - "line": 10, - "column": 8 - }, - "end": { - "line": 10, - "column": 22 - } - }, + "start":257,"end":271,"loc":{"start":{"line":10,"column":8},"end":{"line":10,"column":22}}, "imported": { "type": "Identifier", - "start": 264, - "end": 265, - "loc": { - "start": { - "line": 10, - "column": 15 - }, - "end": { - "line": 10, - "column": 16 - }, - "identifierName": "t" - }, + "start":264,"end":265,"loc":{"start":{"line":10,"column":15},"end":{"line":10,"column":16},"identifierName":"t"}, "name": "t" }, "importKind": "typeof", "local": { "type": "Identifier", - "start": 269, - "end": 271, - "loc": { - "start": { - "line": 10, - "column": 20 - }, - "end": { - "line": 10, - "column": 22 - }, - "identifierName": "u2" - }, + "start":269,"end":271,"loc":{"start":{"line":10,"column":20},"end":{"line":10,"column":22},"identifierName":"u2"}, "name": "u2" } } @@ -802,18 +278,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 278, - "end": 283, - "loc": { - "start": { - "line": 10, - "column": 29 - }, - "end": { - "line": 10, - "column": 34 - } - }, + "start":278,"end":283,"loc":{"start":{"line":10,"column":29},"end":{"line":10,"column":34}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -823,66 +288,20 @@ }, { "type": "ImportDeclaration", - "start": 285, - "end": 320, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 35 - } - }, + "start":285,"end":320,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":35}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 293, - "end": 307, - "loc": { - "start": { - "line": 11, - "column": 8 - }, - "end": { - "line": 11, - "column": 22 - } - }, + "start":293,"end":307,"loc":{"start":{"line":11,"column":8},"end":{"line":11,"column":22}}, "imported": { "type": "Identifier", - "start": 300, - "end": 307, - "loc": { - "start": { - "line": 11, - "column": 15 - }, - "end": { - "line": 11, - "column": 22 - }, - "identifierName": "switch2" - }, + "start":300,"end":307,"loc":{"start":{"line":11,"column":15},"end":{"line":11,"column":22},"identifierName":"switch2"}, "name": "switch2" }, "importKind": "typeof", "local": { "type": "Identifier", - "start": 300, - "end": 307, - "loc": { - "start": { - "line": 11, - "column": 15 - }, - "end": { - "line": 11, - "column": 22 - }, - "identifierName": "switch2" - }, + "start":300,"end":307,"loc":{"start":{"line":11,"column":15},"end":{"line":11,"column":22},"identifierName":"switch2"}, "name": "switch2" } } @@ -890,18 +309,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 314, - "end": 319, - "loc": { - "start": { - "line": 11, - "column": 29 - }, - "end": { - "line": 11, - "column": 34 - } - }, + "start":314,"end":319,"loc":{"start":{"line":11,"column":29},"end":{"line":11,"column":34}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/import-type/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/import-type/output.json index 8e626c8ad0..fcc0c31ed6 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/import-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/import-type/output.json @@ -1,78 +1,22 @@ { "type": "File", - "start": 0, - "end": 450, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 13, - "column": 38 - } - }, + "start":0,"end":450,"loc":{"start":{"line":1,"column":0},"end":{"line":13,"column":38}}, "program": { "type": "Program", - "start": 0, - "end": 450, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 13, - "column": 38 - } - }, + "start":0,"end":450,"loc":{"start":{"line":1,"column":0},"end":{"line":13,"column":38}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "local": { "type": "Identifier", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "Def1" - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16},"identifierName":"Def1"}, "name": "Def1" } } @@ -80,18 +24,7 @@ "importKind": "type", "source": { "type": "StringLiteral", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -101,66 +34,20 @@ }, { "type": "ImportDeclaration", - "start": 29, - "end": 61, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":29,"end":61,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":32}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 42, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":42,"end":48,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":19}}, "imported": { "type": "Identifier", - "start": 42, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "named1" - }, + "start":42,"end":48,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":19},"identifierName":"named1"}, "name": "named1" }, "importKind": null, "local": { "type": "Identifier", - "start": 42, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "named1" - }, + "start":42,"end":48,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":19},"identifierName":"named1"}, "name": "named1" } } @@ -168,18 +55,7 @@ "importKind": "type", "source": { "type": "StringLiteral", - "start": 55, - "end": 60, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":55,"end":60,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":31}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -189,98 +65,29 @@ }, { "type": "ImportDeclaration", - "start": 62, - "end": 100, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 38 - } - }, + "start":62,"end":100,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":38}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 74, - "end": 78, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":74,"end":78,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":16}}, "local": { "type": "Identifier", - "start": 74, - "end": 78, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 16 - }, - "identifierName": "Def2" - }, + "start":74,"end":78,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":16},"identifierName":"Def2"}, "name": "Def2" } }, { "type": "ImportSpecifier", - "start": 81, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":81,"end":87,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":25}}, "imported": { "type": "Identifier", - "start": 81, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 25 - }, - "identifierName": "named2" - }, + "start":81,"end":87,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":25},"identifierName":"named2"}, "name": "named2" }, "importKind": null, "local": { "type": "Identifier", - "start": 81, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 25 - }, - "identifierName": "named2" - }, + "start":81,"end":87,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":25},"identifierName":"named2"}, "name": "named2" } } @@ -288,18 +95,7 @@ "importKind": "type", "source": { "type": "StringLiteral", - "start": 94, - "end": 99, - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 37 - } - }, + "start":94,"end":99,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":37}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -309,48 +105,14 @@ }, { "type": "ImportDeclaration", - "start": 101, - "end": 132, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 31 - } - }, + "start":101,"end":132,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":31}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 113, - "end": 120, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 19 - } - }, + "start":113,"end":120,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":19}}, "local": { "type": "Identifier", - "start": 113, - "end": 120, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 19 - }, - "identifierName": "switch1" - }, + "start":113,"end":120,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":19},"identifierName":"switch1"}, "name": "switch1" } } @@ -358,18 +120,7 @@ "importKind": "type", "source": { "type": "StringLiteral", - "start": 126, - "end": 131, - "loc": { - "start": { - "line": 4, - "column": 25 - }, - "end": { - "line": 4, - "column": 30 - } - }, + "start":126,"end":131,"loc":{"start":{"line":4,"column":25},"end":{"line":4,"column":30}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -379,66 +130,20 @@ }, { "type": "ImportDeclaration", - "start": 133, - "end": 168, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 35 - } - }, + "start":133,"end":168,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":35}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 147, - "end": 154, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 21 - } - }, + "start":147,"end":154,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":21}}, "imported": { "type": "Identifier", - "start": 147, - "end": 154, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 21 - }, - "identifierName": "switch2" - }, + "start":147,"end":154,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":21},"identifierName":"switch2"}, "name": "switch2" }, "importKind": null, "local": { "type": "Identifier", - "start": 147, - "end": 154, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 21 - }, - "identifierName": "switch2" - }, + "start":147,"end":154,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":21},"identifierName":"switch2"}, "name": "switch2" } } @@ -446,18 +151,7 @@ "importKind": "type", "source": { "type": "StringLiteral", - "start": 162, - "end": 167, - "loc": { - "start": { - "line": 5, - "column": 29 - }, - "end": { - "line": 5, - "column": 34 - } - }, + "start":162,"end":167,"loc":{"start":{"line":5,"column":29},"end":{"line":5,"column":34}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -467,116 +161,35 @@ }, { "type": "ImportDeclaration", - "start": 169, - "end": 207, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 38 - } - }, + "start":169,"end":207,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":38}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 183, - "end": 187, - "loc": { - "start": { - "line": 6, - "column": 14 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":183,"end":187,"loc":{"start":{"line":6,"column":14},"end":{"line":6,"column":18}}, "imported": { "type": "Identifier", - "start": 183, - "end": 187, - "loc": { - "start": { - "line": 6, - "column": 14 - }, - "end": { - "line": 6, - "column": 18 - }, - "identifierName": "foo1" - }, + "start":183,"end":187,"loc":{"start":{"line":6,"column":14},"end":{"line":6,"column":18},"identifierName":"foo1"}, "name": "foo1" }, "importKind": null, "local": { "type": "Identifier", - "start": 183, - "end": 187, - "loc": { - "start": { - "line": 6, - "column": 14 - }, - "end": { - "line": 6, - "column": 18 - }, - "identifierName": "foo1" - }, + "start":183,"end":187,"loc":{"start":{"line":6,"column":14},"end":{"line":6,"column":18},"identifierName":"foo1"}, "name": "foo1" } }, { "type": "ImportSpecifier", - "start": 189, - "end": 193, - "loc": { - "start": { - "line": 6, - "column": 20 - }, - "end": { - "line": 6, - "column": 24 - } - }, + "start":189,"end":193,"loc":{"start":{"line":6,"column":20},"end":{"line":6,"column":24}}, "imported": { "type": "Identifier", - "start": 189, - "end": 193, - "loc": { - "start": { - "line": 6, - "column": 20 - }, - "end": { - "line": 6, - "column": 24 - }, - "identifierName": "bar1" - }, + "start":189,"end":193,"loc":{"start":{"line":6,"column":20},"end":{"line":6,"column":24},"identifierName":"bar1"}, "name": "bar1" }, "importKind": null, "local": { "type": "Identifier", - "start": 189, - "end": 193, - "loc": { - "start": { - "line": 6, - "column": 20 - }, - "end": { - "line": 6, - "column": 24 - }, - "identifierName": "bar1" - }, + "start":189,"end":193,"loc":{"start":{"line":6,"column":20},"end":{"line":6,"column":24},"identifierName":"bar1"}, "name": "bar1" } } @@ -584,18 +197,7 @@ "importKind": "type", "source": { "type": "StringLiteral", - "start": 201, - "end": 206, - "loc": { - "start": { - "line": 6, - "column": 32 - }, - "end": { - "line": 6, - "column": 37 - } - }, + "start":201,"end":206,"loc":{"start":{"line":6,"column":32},"end":{"line":6,"column":37}}, "extra": { "rawValue": "baz", "raw": "\"baz\"" @@ -605,48 +207,14 @@ }, { "type": "ImportDeclaration", - "start": 208, - "end": 231, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 23 - } - }, + "start":208,"end":231,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":23}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 215, - "end": 219, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 11 - } - }, + "start":215,"end":219,"loc":{"start":{"line":7,"column":7},"end":{"line":7,"column":11}}, "local": { "type": "Identifier", - "start": 215, - "end": 219, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 11 - }, - "identifierName": "type" - }, + "start":215,"end":219,"loc":{"start":{"line":7,"column":7},"end":{"line":7,"column":11},"identifierName":"type"}, "name": "type" } } @@ -654,18 +222,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 225, - "end": 230, - "loc": { - "start": { - "line": 7, - "column": 17 - }, - "end": { - "line": 7, - "column": 22 - } - }, + "start":225,"end":230,"loc":{"start":{"line":7,"column":17},"end":{"line":7,"column":22}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -675,48 +232,14 @@ }, { "type": "ImportDeclaration", - "start": 232, - "end": 262, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 30 - } - }, + "start":232,"end":262,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":30}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 246, - "end": 250, - "loc": { - "start": { - "line": 8, - "column": 14 - }, - "end": { - "line": 8, - "column": 18 - } - }, + "start":246,"end":250,"loc":{"start":{"line":8,"column":14},"end":{"line":8,"column":18}}, "local": { "type": "Identifier", - "start": 246, - "end": 250, - "loc": { - "start": { - "line": 8, - "column": 14 - }, - "end": { - "line": 8, - "column": 18 - }, - "identifierName": "foo3" - }, + "start":246,"end":250,"loc":{"start":{"line":8,"column":14},"end":{"line":8,"column":18},"identifierName":"foo3"}, "name": "foo3" } } @@ -724,18 +247,7 @@ "importKind": "typeof", "source": { "type": "StringLiteral", - "start": 256, - "end": 261, - "loc": { - "start": { - "line": 8, - "column": 24 - }, - "end": { - "line": 8, - "column": 29 - } - }, + "start":256,"end":261,"loc":{"start":{"line":8,"column":24},"end":{"line":8,"column":29}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" @@ -745,48 +257,14 @@ }, { "type": "ImportDeclaration", - "start": 263, - "end": 296, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 33 - } - }, + "start":263,"end":296,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":33}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 277, - "end": 284, - "loc": { - "start": { - "line": 9, - "column": 14 - }, - "end": { - "line": 9, - "column": 21 - } - }, + "start":277,"end":284,"loc":{"start":{"line":9,"column":14},"end":{"line":9,"column":21}}, "local": { "type": "Identifier", - "start": 277, - "end": 284, - "loc": { - "start": { - "line": 9, - "column": 14 - }, - "end": { - "line": 9, - "column": 21 - }, - "identifierName": "switch4" - }, + "start":277,"end":284,"loc":{"start":{"line":9,"column":14},"end":{"line":9,"column":21},"identifierName":"switch4"}, "name": "switch4" } } @@ -794,18 +272,7 @@ "importKind": "typeof", "source": { "type": "StringLiteral", - "start": 290, - "end": 295, - "loc": { - "start": { - "line": 9, - "column": 27 - }, - "end": { - "line": 9, - "column": 32 - } - }, + "start":290,"end":295,"loc":{"start":{"line":9,"column":27},"end":{"line":9,"column":32}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -815,66 +282,20 @@ }, { "type": "ImportDeclaration", - "start": 297, - "end": 334, - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 10, - "column": 37 - } - }, + "start":297,"end":334,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":37}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 313, - "end": 320, - "loc": { - "start": { - "line": 10, - "column": 16 - }, - "end": { - "line": 10, - "column": 23 - } - }, + "start":313,"end":320,"loc":{"start":{"line":10,"column":16},"end":{"line":10,"column":23}}, "imported": { "type": "Identifier", - "start": 313, - "end": 320, - "loc": { - "start": { - "line": 10, - "column": 16 - }, - "end": { - "line": 10, - "column": 23 - }, - "identifierName": "switch5" - }, + "start":313,"end":320,"loc":{"start":{"line":10,"column":16},"end":{"line":10,"column":23},"identifierName":"switch5"}, "name": "switch5" }, "importKind": null, "local": { "type": "Identifier", - "start": 313, - "end": 320, - "loc": { - "start": { - "line": 10, - "column": 16 - }, - "end": { - "line": 10, - "column": 23 - }, - "identifierName": "switch5" - }, + "start":313,"end":320,"loc":{"start":{"line":10,"column":16},"end":{"line":10,"column":23},"identifierName":"switch5"}, "name": "switch5" } } @@ -882,18 +303,7 @@ "importKind": "typeof", "source": { "type": "StringLiteral", - "start": 328, - "end": 333, - "loc": { - "start": { - "line": 10, - "column": 31 - }, - "end": { - "line": 10, - "column": 36 - } - }, + "start":328,"end":333,"loc":{"start":{"line":10,"column":31},"end":{"line":10,"column":36}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -903,66 +313,20 @@ }, { "type": "ImportDeclaration", - "start": 335, - "end": 376, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 41 - } - }, + "start":335,"end":376,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":41}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 351, - "end": 362, - "loc": { - "start": { - "line": 11, - "column": 16 - }, - "end": { - "line": 11, - "column": 27 - } - }, + "start":351,"end":362,"loc":{"start":{"line":11,"column":16},"end":{"line":11,"column":27}}, "imported": { "type": "Identifier", - "start": 351, - "end": 354, - "loc": { - "start": { - "line": 11, - "column": 16 - }, - "end": { - "line": 11, - "column": 19 - }, - "identifierName": "foo" - }, + "start":351,"end":354,"loc":{"start":{"line":11,"column":16},"end":{"line":11,"column":19},"identifierName":"foo"}, "name": "foo" }, "importKind": null, "local": { "type": "Identifier", - "start": 358, - "end": 362, - "loc": { - "start": { - "line": 11, - "column": 23 - }, - "end": { - "line": 11, - "column": 27 - }, - "identifierName": "bar6" - }, + "start":358,"end":362,"loc":{"start":{"line":11,"column":23},"end":{"line":11,"column":27},"identifierName":"bar6"}, "name": "bar6" } } @@ -970,18 +334,7 @@ "importKind": "typeof", "source": { "type": "StringLiteral", - "start": 370, - "end": 375, - "loc": { - "start": { - "line": 11, - "column": 35 - }, - "end": { - "line": 11, - "column": 40 - } - }, + "start":370,"end":375,"loc":{"start":{"line":11,"column":35},"end":{"line":11,"column":40}}, "extra": { "rawValue": "baz", "raw": "\"baz\"" @@ -991,48 +344,14 @@ }, { "type": "ImportDeclaration", - "start": 377, - "end": 411, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 34 - } - }, + "start":377,"end":411,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":34}}, "specifiers": [ { "type": "ImportNamespaceSpecifier", - "start": 391, - "end": 399, - "loc": { - "start": { - "line": 12, - "column": 14 - }, - "end": { - "line": 12, - "column": 22 - } - }, + "start":391,"end":399,"loc":{"start":{"line":12,"column":14},"end":{"line":12,"column":22}}, "local": { "type": "Identifier", - "start": 396, - "end": 399, - "loc": { - "start": { - "line": 12, - "column": 19 - }, - "end": { - "line": 12, - "column": 22 - }, - "identifierName": "ns7" - }, + "start":396,"end":399,"loc":{"start":{"line":12,"column":19},"end":{"line":12,"column":22},"identifierName":"ns7"}, "name": "ns7" } } @@ -1040,18 +359,7 @@ "importKind": "typeof", "source": { "type": "StringLiteral", - "start": 405, - "end": 410, - "loc": { - "start": { - "line": 12, - "column": 28 - }, - "end": { - "line": 12, - "column": 33 - } - }, + "start":405,"end":410,"loc":{"start":{"line":12,"column":28},"end":{"line":12,"column":33}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -1061,48 +369,14 @@ }, { "type": "ImportDeclaration", - "start": 412, - "end": 450, - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 13, - "column": 38 - } - }, + "start":412,"end":450,"loc":{"start":{"line":13,"column":0},"end":{"line":13,"column":38}}, "specifiers": [ { "type": "ImportNamespaceSpecifier", - "start": 426, - "end": 438, - "loc": { - "start": { - "line": 13, - "column": 14 - }, - "end": { - "line": 13, - "column": 26 - } - }, + "start":426,"end":438,"loc":{"start":{"line":13,"column":14},"end":{"line":13,"column":26}}, "local": { "type": "Identifier", - "start": 431, - "end": 438, - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 26 - }, - "identifierName": "switch8" - }, + "start":431,"end":438,"loc":{"start":{"line":13,"column":19},"end":{"line":13,"column":26},"identifierName":"switch8"}, "name": "switch8" } } @@ -1110,18 +384,7 @@ "importKind": "typeof", "source": { "type": "StringLiteral", - "start": 444, - "end": 449, - "loc": { - "start": { - "line": 13, - "column": 32 - }, - "end": { - "line": 13, - "column": 37 - } - }, + "start":444,"end":449,"loc":{"start":{"line":13,"column":32},"end":{"line":13,"column":37}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/output.json index 5ac98d7b46..cbd99a1995 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-2/output.json @@ -1,99 +1,31 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ "SyntaxError: Cannot overwrite reserved type string (1:14)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}}, "imported": { "type": "Identifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "string" - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20},"identifierName":"string"}, "name": "string" }, "importKind": null, "local": { "type": "Identifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "string" - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20},"identifierName":"string"}, "name": "string" } } @@ -101,18 +33,7 @@ "importKind": "type", "source": { "type": "StringLiteral", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/output.json index 3a1010d807..1e241ce546 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-3/output.json @@ -1,81 +1,25 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Cannot overwrite reserved type string (1:14)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}}, "local": { "type": "Identifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "string" - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20},"identifierName":"string"}, "name": "string" } } @@ -83,18 +27,7 @@ "importKind": "typeof", "source": { "type": "StringLiteral", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/output.json index dcbca6978a..4598f3355f 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-4/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ "SyntaxError: Cannot overwrite reserved type string (1:19)" ], "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "specifiers": [ { "type": "ImportNamespaceSpecifier", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":14,"end":25,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":25}}, "local": { "type": "Identifier", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "string" - }, + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25},"identifierName":"string"}, "name": "string" } } @@ -83,18 +27,7 @@ "importKind": "typeof", "source": { "type": "StringLiteral", - "start": 31, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":31,"end":36,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":36}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/output.json index 05cc09533a..20c6c60731 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-as/output.json @@ -1,99 +1,31 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected keyword 'debugger' (1:17)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":9,"end":25,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":25}}, "imported": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "type" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"type"}, "name": "type" }, "importKind": null, "local": { "type": "Identifier", - "start": 17, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "debugger" - }, + "start":17,"end":25,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":25},"identifierName":"debugger"}, "name": "debugger" } } @@ -101,18 +33,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":33,"end":38,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":38}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/output.json index 90585f1b4f..37af63c099 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-2/output.json @@ -1,99 +1,31 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements (1:13)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}}, "imported": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "t" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"t"}, "name": "t" }, "importKind": "type", "local": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "t" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"t"}, "name": "t" } } @@ -101,18 +33,7 @@ "importKind": "type", "source": { "type": "StringLiteral", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/output.json index 4969f577a3..56fba75c81 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-3/output.json @@ -1,99 +1,31 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: Cannot overwrite reserved type string (1:16)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "imported": { "type": "Identifier", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "string" - }, + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22},"identifierName":"string"}, "name": "string" }, "importKind": "typeof", "local": { "type": "Identifier", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "string" - }, + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22},"identifierName":"string"}, "name": "string" } } @@ -101,18 +33,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/output.json index 2b57e99a30..ff46538a95 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand-4/output.json @@ -1,99 +1,31 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "errors": [ "SyntaxError: Cannot overwrite reserved type string (1:14)" ], "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":9,"end":20,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":20}}, "imported": { "type": "Identifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "string" - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20},"identifierName":"string"}, "name": "string" }, "importKind": "type", "local": { "type": "Identifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "string" - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20},"identifierName":"string"}, "name": "string" } } @@ -101,18 +33,7 @@ "importKind": "value", "source": { "type": "StringLiteral", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/output.json index 174e856304..8d2dd58fa4 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type-shorthand/output.json @@ -1,99 +1,31 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "errors": [ "SyntaxError: The `type` and `typeof` keywords on named imports can only be used on regular `import` statements. It cannot be used with `import type` or `import typeof` statements (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "imported": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "t" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"t"}, "name": "t" }, "importKind": "typeof", "local": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "t" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"t"}, "name": "t" } } @@ -101,18 +33,7 @@ "importKind": "typeof", "source": { "type": "StringLiteral", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":30,"end":35,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":35}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/output.json b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/output.json index 95872d960a..78cb69bb8d 100644 --- a/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-imports/invalid-import-type/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "errors": [ "SyntaxError: Cannot overwrite reserved type string (1:12)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}}, "local": { "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "string" - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18},"identifierName":"string"}, "name": "string" } } @@ -83,18 +27,7 @@ "importKind": "type", "source": { "type": "StringLiteral", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_with_jsx/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_with_jsx/output.json index c450820263..5d46fe17f3 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_with_jsx/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_with_jsx/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 26 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 26 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "NumericLiteral", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "extra": { "rawValue": 123, "raw": "123" @@ -83,33 +28,11 @@ }, "typeParameters": { "type": "TypeParameterDeclaration", - "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}}, "params": [ { "type": "TypeParameter", - "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}}, "name": "T", "variance": null } @@ -119,68 +42,23 @@ }, { "type": "ExpressionStatement", - "start": 14, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":14,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":14,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"x"}, "name": "x" } ], "body": { "type": "NumericLiteral", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":24,"end":27,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13}}, "extra": { "rawValue": 123, "raw": "123" @@ -189,33 +67,11 @@ }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "params": [ { "type": "TypeParameter", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":2}}, "name": "T", "variance": null } @@ -225,98 +81,31 @@ }, { "type": "ExpressionStatement", - "start": 29, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":29,"end":51,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":22}}, "expression": { "type": "ArrowFunctionExpression", - "start": 29, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":29,"end":50,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":21}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 33, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "x" - }, + "start":33,"end":42,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 34, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":34,"end":42,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":13}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":36,"end":42,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":13}} } } } ], "body": { "type": "NumericLiteral", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":47,"end":50,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":21}}, "extra": { "rawValue": 123, "raw": "123" @@ -325,33 +114,11 @@ }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":29,"end":32,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3}}, "params": [ { "type": "TypeParameter", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":30,"end":31,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":2}}, "name": "T", "variance": null } @@ -361,127 +128,38 @@ }, { "type": "ExpressionStatement", - "start": 52, - "end": 78, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 26 - } - }, + "start":52,"end":78,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":26}}, "expression": { "type": "ArrowFunctionExpression", - "start": 52, - "end": 77, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":52,"end":77,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":25}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 56, - "end": 65, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 13 - }, - "identifierName": "x" - }, + "start":56,"end":65,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":13},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 57, - "end": 65, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":57,"end":65,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":13}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 59, - "end": 65, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 13 - } - } + "start":59,"end":65,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":13}} } } } ], "body": { "type": "BlockStatement", - "start": 70, - "end": 77, - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":70,"end":77,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":25}}, "body": [ { "type": "ExpressionStatement", - "start": 72, - "end": 75, - "loc": { - "start": { - "line": 4, - "column": 20 - }, - "end": { - "line": 4, - "column": 23 - } - }, + "start":72,"end":75,"loc":{"start":{"line":4,"column":20},"end":{"line":4,"column":23}}, "expression": { "type": "NumericLiteral", - "start": 72, - "end": 75, - "loc": { - "start": { - "line": 4, - "column": 20 - }, - "end": { - "line": 4, - "column": 23 - } - }, + "start":72,"end":75,"loc":{"start":{"line":4,"column":20},"end":{"line":4,"column":23}}, "extra": { "rawValue": 123, "raw": "123" @@ -494,33 +172,11 @@ }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 52, - "end": 55, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":52,"end":55,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":3}}, "params": [ { "type": "TypeParameter", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":53,"end":54,"loc":{"start":{"line":4,"column":1},"end":{"line":4,"column":2}}, "name": "T", "variance": null } diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_without_jsx/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_without_jsx/output.json index c450820263..5d46fe17f3 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_without_jsx/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/arrow_without_jsx/output.json @@ -1,80 +1,25 @@ { "type": "File", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 26 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 26 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "NumericLiteral", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "extra": { "rawValue": 123, "raw": "123" @@ -83,33 +28,11 @@ }, "typeParameters": { "type": "TypeParameterDeclaration", - "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}}, "params": [ { "type": "TypeParameter", - "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}}, "name": "T", "variance": null } @@ -119,68 +42,23 @@ }, { "type": "ExpressionStatement", - "start": 14, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":14,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "expression": { "type": "ArrowFunctionExpression", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":14,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"x"}, "name": "x" } ], "body": { "type": "NumericLiteral", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":24,"end":27,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13}}, "extra": { "rawValue": 123, "raw": "123" @@ -189,33 +67,11 @@ }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "params": [ { "type": "TypeParameter", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":2}}, "name": "T", "variance": null } @@ -225,98 +81,31 @@ }, { "type": "ExpressionStatement", - "start": 29, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":29,"end":51,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":22}}, "expression": { "type": "ArrowFunctionExpression", - "start": 29, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":29,"end":50,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":21}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 33, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "x" - }, + "start":33,"end":42,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 34, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":34,"end":42,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":13}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":36,"end":42,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":13}} } } } ], "body": { "type": "NumericLiteral", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":47,"end":50,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":21}}, "extra": { "rawValue": 123, "raw": "123" @@ -325,33 +114,11 @@ }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":29,"end":32,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":3}}, "params": [ { "type": "TypeParameter", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":30,"end":31,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":2}}, "name": "T", "variance": null } @@ -361,127 +128,38 @@ }, { "type": "ExpressionStatement", - "start": 52, - "end": 78, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 26 - } - }, + "start":52,"end":78,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":26}}, "expression": { "type": "ArrowFunctionExpression", - "start": 52, - "end": 77, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":52,"end":77,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":25}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 56, - "end": 65, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 13 - }, - "identifierName": "x" - }, + "start":56,"end":65,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":13},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 57, - "end": 65, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":57,"end":65,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":13}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 59, - "end": 65, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 13 - } - } + "start":59,"end":65,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":13}} } } } ], "body": { "type": "BlockStatement", - "start": 70, - "end": 77, - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":70,"end":77,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":25}}, "body": [ { "type": "ExpressionStatement", - "start": 72, - "end": 75, - "loc": { - "start": { - "line": 4, - "column": 20 - }, - "end": { - "line": 4, - "column": 23 - } - }, + "start":72,"end":75,"loc":{"start":{"line":4,"column":20},"end":{"line":4,"column":23}}, "expression": { "type": "NumericLiteral", - "start": 72, - "end": 75, - "loc": { - "start": { - "line": 4, - "column": 20 - }, - "end": { - "line": 4, - "column": 23 - } - }, + "start":72,"end":75,"loc":{"start":{"line":4,"column":20},"end":{"line":4,"column":23}}, "extra": { "rawValue": 123, "raw": "123" @@ -494,33 +172,11 @@ }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 52, - "end": 55, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":52,"end":55,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":3}}, "params": [ { "type": "TypeParameter", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":53,"end":54,"loc":{"start":{"line":4,"column":1},"end":{"line":4,"column":2}}, "name": "T", "variance": null } diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/class-method-reserved-word/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/class-method-reserved-word/output.json index a2837f7dd5..bc961ea835 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/class-method-reserved-word/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/class-method-reserved-word/output.json @@ -1,144 +1,43 @@ { "type": "File", - "start": 0, - "end": 166, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 10, - "column": 2 - } - }, + "start":0,"end":166,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 166, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 10, - "column": 2 - } - }, + "start":0,"end":166,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 165, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":0,"end":165,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "X" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"X"}, "name": "X" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 165, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":8,"end":165,"loc":{"start":{"line":1,"column":8},"end":{"line":10,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "foobar" - }, + "start":12,"end":18,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8},"identifierName":"foobar"}, "name": "foobar" }, "computed": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":18,"end":21,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11}}, "params": [ { "type": "TypeParameter", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "name": "T", "variance": null } @@ -150,85 +49,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 29, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":29,"end":43,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "static": false, "key": { "type": "Identifier", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "delete" - }, + "start":29,"end":35,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8},"identifierName":"delete"}, "name": "delete" }, "computed": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":35,"end":38,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":11}}, "params": [ { "type": "TypeParameter", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":36,"end":37,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, "name": "T", "variance": null } @@ -240,85 +83,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":41,"end":43,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":16}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 46, - "end": 59, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":46,"end":59,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":15}}, "static": false, "key": { "type": "Identifier", - "start": 46, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "yield" - }, + "start":46,"end":51,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":7},"identifierName":"yield"}, "name": "yield" }, "computed": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":51,"end":54,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":10}}, "params": [ { "type": "TypeParameter", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":52,"end":53,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":9}}, "name": "T", "variance": null } @@ -330,85 +117,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 57, - "end": 59, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":57,"end":59,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":15}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 62, - "end": 72, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 12 - } - }, + "start":62,"end":72,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":12}}, "static": false, "key": { "type": "Identifier", - "start": 62, - "end": 64, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 4 - }, - "identifierName": "do" - }, + "start":62,"end":64,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":4},"identifierName":"do"}, "name": "do" }, "computed": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", - "start": 64, - "end": 67, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 7 - } - }, + "start":64,"end":67,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":7}}, "params": [ { "type": "TypeParameter", - "start": 65, - "end": 66, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 6 - } - }, + "start":65,"end":66,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":6}}, "name": "T", "variance": null } @@ -420,85 +151,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 70, - "end": 72, - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 12 - } - }, + "start":70,"end":72,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":12}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 75, - "end": 96, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 23 - } - }, + "start":75,"end":96,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":23}}, "static": true, "key": { "type": "Identifier", - "start": 82, - "end": 88, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 15 - }, - "identifierName": "foobar" - }, + "start":82,"end":88,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":15},"identifierName":"foobar"}, "name": "foobar" }, "computed": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", - "start": 88, - "end": 91, - "loc": { - "start": { - "line": 6, - "column": 15 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":88,"end":91,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":18}}, "params": [ { "type": "TypeParameter", - "start": 89, - "end": 90, - "loc": { - "start": { - "line": 6, - "column": 16 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":89,"end":90,"loc":{"start":{"line":6,"column":16},"end":{"line":6,"column":17}}, "name": "T", "variance": null } @@ -510,85 +185,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 94, - "end": 96, - "loc": { - "start": { - "line": 6, - "column": 21 - }, - "end": { - "line": 6, - "column": 23 - } - }, + "start":94,"end":96,"loc":{"start":{"line":6,"column":21},"end":{"line":6,"column":23}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 99, - "end": 120, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 23 - } - }, + "start":99,"end":120,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":23}}, "static": true, "key": { "type": "Identifier", - "start": 106, - "end": 112, - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 15 - }, - "identifierName": "delete" - }, + "start":106,"end":112,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":15},"identifierName":"delete"}, "name": "delete" }, "computed": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", - "start": 112, - "end": 115, - "loc": { - "start": { - "line": 7, - "column": 15 - }, - "end": { - "line": 7, - "column": 18 - } - }, + "start":112,"end":115,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":18}}, "params": [ { "type": "TypeParameter", - "start": 113, - "end": 114, - "loc": { - "start": { - "line": 7, - "column": 16 - }, - "end": { - "line": 7, - "column": 17 - } - }, + "start":113,"end":114,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":17}}, "name": "T", "variance": null } @@ -600,85 +219,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 118, - "end": 120, - "loc": { - "start": { - "line": 7, - "column": 21 - }, - "end": { - "line": 7, - "column": 23 - } - }, + "start":118,"end":120,"loc":{"start":{"line":7,"column":21},"end":{"line":7,"column":23}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 123, - "end": 143, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 22 - } - }, + "start":123,"end":143,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":22}}, "static": true, "key": { "type": "Identifier", - "start": 130, - "end": 135, - "loc": { - "start": { - "line": 8, - "column": 9 - }, - "end": { - "line": 8, - "column": 14 - }, - "identifierName": "yield" - }, + "start":130,"end":135,"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":14},"identifierName":"yield"}, "name": "yield" }, "computed": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", - "start": 135, - "end": 138, - "loc": { - "start": { - "line": 8, - "column": 14 - }, - "end": { - "line": 8, - "column": 17 - } - }, + "start":135,"end":138,"loc":{"start":{"line":8,"column":14},"end":{"line":8,"column":17}}, "params": [ { "type": "TypeParameter", - "start": 136, - "end": 137, - "loc": { - "start": { - "line": 8, - "column": 15 - }, - "end": { - "line": 8, - "column": 16 - } - }, + "start":136,"end":137,"loc":{"start":{"line":8,"column":15},"end":{"line":8,"column":16}}, "name": "T", "variance": null } @@ -690,85 +253,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 141, - "end": 143, - "loc": { - "start": { - "line": 8, - "column": 20 - }, - "end": { - "line": 8, - "column": 22 - } - }, + "start":141,"end":143,"loc":{"start":{"line":8,"column":20},"end":{"line":8,"column":22}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 146, - "end": 163, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 19 - } - }, + "start":146,"end":163,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":19}}, "static": true, "key": { "type": "Identifier", - "start": 153, - "end": 155, - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 9, - "column": 11 - }, - "identifierName": "do" - }, + "start":153,"end":155,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":11},"identifierName":"do"}, "name": "do" }, "computed": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", - "start": 155, - "end": 158, - "loc": { - "start": { - "line": 9, - "column": 11 - }, - "end": { - "line": 9, - "column": 14 - } - }, + "start":155,"end":158,"loc":{"start":{"line":9,"column":11},"end":{"line":9,"column":14}}, "params": [ { "type": "TypeParameter", - "start": 156, - "end": 157, - "loc": { - "start": { - "line": 9, - "column": 12 - }, - "end": { - "line": 9, - "column": 13 - } - }, + "start":156,"end":157,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":13}}, "name": "T", "variance": null } @@ -780,18 +287,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 161, - "end": 163, - "loc": { - "start": { - "line": 9, - "column": 17 - }, - "end": { - "line": 9, - "column": 19 - } - }, + "start":161,"end":163,"loc":{"start":{"line":9,"column":17},"end":{"line":9,"column":19}}, "body": [], "directives": [] } @@ -801,18 +297,7 @@ }, { "type": "EmptyStatement", - "start": 165, - "end": 166, - "loc": { - "start": { - "line": 10, - "column": 1 - }, - "end": { - "line": 10, - "column": 2 - } - } + "start":165,"end":166,"loc":{"start":{"line":10,"column":1},"end":{"line":10,"column":2}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/output.json index 64b7c306de..1fcb8935c9 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/declare-class-method-reserved-word/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 206, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 10, - "column": 2 - } - }, + "start":0,"end":206,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 206, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 10, - "column": 2 - } - }, + "start":0,"end":206,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 205, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":0,"end":205,"loc":{"start":{"line":1,"column":0},"end":{"line":10,"column":1}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "X" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"X"}, "name": "X" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 16, - "end": 205, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 10, - "column": 1 - } - }, + "start":16,"end":205,"loc":{"start":{"line":1,"column":16},"end":{"line":10,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 20, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":20,"end":37,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "key": { "type": "Identifier", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "foobar" - }, + "start":20,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8},"identifierName":"foobar"}, "name": "foobar" }, "static": false, @@ -117,49 +38,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 20, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":20,"end":37,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":26,"end":29,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11}}, "params": [ { "type": "TypeParameter", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "name": "T", "variance": null } @@ -167,51 +55,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 33, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 19 - } - } + "start":33,"end":37,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":19}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 41, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":41,"end":58,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":19}}, "key": { "type": "Identifier", - "start": 41, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "delete" - }, + "start":41,"end":47,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8},"identifierName":"delete"}, "name": "delete" }, "static": false, @@ -220,49 +74,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 41, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":41,"end":58,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":19}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":47,"end":50,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":11}}, "params": [ { "type": "TypeParameter", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":48,"end":49,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, "name": "T", "variance": null } @@ -270,51 +91,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 54, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 19 - } - } + "start":54,"end":58,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":19}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 62, - "end": 78, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":62,"end":78,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":18}}, "key": { "type": "Identifier", - "start": 62, - "end": 67, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "yield" - }, + "start":62,"end":67,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":7},"identifierName":"yield"}, "name": "yield" }, "static": false, @@ -323,49 +110,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 62, - "end": 78, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":62,"end":78,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":18}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 67, - "end": 70, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":67,"end":70,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":10}}, "params": [ { "type": "TypeParameter", - "start": 68, - "end": 69, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":68,"end":69,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":9}}, "name": "T", "variance": null } @@ -373,51 +127,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 74, - "end": 78, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 18 - } - } + "start":74,"end":78,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":18}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 82, - "end": 95, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":82,"end":95,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":15}}, "key": { "type": "Identifier", - "start": 82, - "end": 84, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 4 - }, - "identifierName": "do" - }, + "start":82,"end":84,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":4},"identifierName":"do"}, "name": "do" }, "static": false, @@ -426,49 +146,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 82, - "end": 95, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":82,"end":95,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":15}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 84, - "end": 87, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 7 - } - }, + "start":84,"end":87,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":7}}, "params": [ { "type": "TypeParameter", - "start": 85, - "end": 86, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 6 - } - }, + "start":85,"end":86,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":6}}, "name": "T", "variance": null } @@ -476,51 +163,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 91, - "end": 95, - "loc": { - "start": { - "line": 5, - "column": 11 - }, - "end": { - "line": 5, - "column": 15 - } - } + "start":91,"end":95,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":15}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 99, - "end": 123, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 26 - } - }, + "start":99,"end":123,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":26}}, "key": { "type": "Identifier", - "start": 106, - "end": 112, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 15 - }, - "identifierName": "foobar" - }, + "start":106,"end":112,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":15},"identifierName":"foobar"}, "name": "foobar" }, "static": true, @@ -529,49 +182,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 99, - "end": 123, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 26 - } - }, + "start":99,"end":123,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":26}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 112, - "end": 115, - "loc": { - "start": { - "line": 6, - "column": 15 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":112,"end":115,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":18}}, "params": [ { "type": "TypeParameter", - "start": 113, - "end": 114, - "loc": { - "start": { - "line": 6, - "column": 16 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":113,"end":114,"loc":{"start":{"line":6,"column":16},"end":{"line":6,"column":17}}, "name": "T", "variance": null } @@ -579,51 +199,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 119, - "end": 123, - "loc": { - "start": { - "line": 6, - "column": 22 - }, - "end": { - "line": 6, - "column": 26 - } - } + "start":119,"end":123,"loc":{"start":{"line":6,"column":22},"end":{"line":6,"column":26}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 127, - "end": 151, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 26 - } - }, + "start":127,"end":151,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":26}}, "key": { "type": "Identifier", - "start": 134, - "end": 140, - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 15 - }, - "identifierName": "delete" - }, + "start":134,"end":140,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":15},"identifierName":"delete"}, "name": "delete" }, "static": true, @@ -632,49 +218,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 127, - "end": 151, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 26 - } - }, + "start":127,"end":151,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":26}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 140, - "end": 143, - "loc": { - "start": { - "line": 7, - "column": 15 - }, - "end": { - "line": 7, - "column": 18 - } - }, + "start":140,"end":143,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":18}}, "params": [ { "type": "TypeParameter", - "start": 141, - "end": 142, - "loc": { - "start": { - "line": 7, - "column": 16 - }, - "end": { - "line": 7, - "column": 17 - } - }, + "start":141,"end":142,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":17}}, "name": "T", "variance": null } @@ -682,51 +235,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 147, - "end": 151, - "loc": { - "start": { - "line": 7, - "column": 22 - }, - "end": { - "line": 7, - "column": 26 - } - } + "start":147,"end":151,"loc":{"start":{"line":7,"column":22},"end":{"line":7,"column":26}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 155, - "end": 178, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 25 - } - }, + "start":155,"end":178,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":25}}, "key": { "type": "Identifier", - "start": 162, - "end": 167, - "loc": { - "start": { - "line": 8, - "column": 9 - }, - "end": { - "line": 8, - "column": 14 - }, - "identifierName": "yield" - }, + "start":162,"end":167,"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":14},"identifierName":"yield"}, "name": "yield" }, "static": true, @@ -735,49 +254,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 155, - "end": 178, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 25 - } - }, + "start":155,"end":178,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":25}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 167, - "end": 170, - "loc": { - "start": { - "line": 8, - "column": 14 - }, - "end": { - "line": 8, - "column": 17 - } - }, + "start":167,"end":170,"loc":{"start":{"line":8,"column":14},"end":{"line":8,"column":17}}, "params": [ { "type": "TypeParameter", - "start": 168, - "end": 169, - "loc": { - "start": { - "line": 8, - "column": 15 - }, - "end": { - "line": 8, - "column": 16 - } - }, + "start":168,"end":169,"loc":{"start":{"line":8,"column":15},"end":{"line":8,"column":16}}, "name": "T", "variance": null } @@ -785,51 +271,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 174, - "end": 178, - "loc": { - "start": { - "line": 8, - "column": 21 - }, - "end": { - "line": 8, - "column": 25 - } - } + "start":174,"end":178,"loc":{"start":{"line":8,"column":21},"end":{"line":8,"column":25}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 182, - "end": 202, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 22 - } - }, + "start":182,"end":202,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":22}}, "key": { "type": "Identifier", - "start": 189, - "end": 191, - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 9, - "column": 11 - }, - "identifierName": "do" - }, + "start":189,"end":191,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":11},"identifierName":"do"}, "name": "do" }, "static": true, @@ -838,49 +290,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 182, - "end": 202, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 22 - } - }, + "start":182,"end":202,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":22}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 191, - "end": 194, - "loc": { - "start": { - "line": 9, - "column": 11 - }, - "end": { - "line": 9, - "column": 14 - } - }, + "start":191,"end":194,"loc":{"start":{"line":9,"column":11},"end":{"line":9,"column":14}}, "params": [ { "type": "TypeParameter", - "start": 192, - "end": 193, - "loc": { - "start": { - "line": 9, - "column": 12 - }, - "end": { - "line": 9, - "column": 13 - } - }, + "start":192,"end":193,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":13}}, "name": "T", "variance": null } @@ -888,18 +307,7 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 198, - "end": 202, - "loc": { - "start": { - "line": 9, - "column": 18 - }, - "end": { - "line": 9, - "column": 22 - } - } + "start":198,"end":202,"loc":{"start":{"line":9,"column":18},"end":{"line":9,"column":22}} } }, "optional": false @@ -912,18 +320,7 @@ }, { "type": "EmptyStatement", - "start": 205, - "end": 206, - "loc": { - "start": { - "line": 10, - "column": 1 - }, - "end": { - "line": 10, - "column": 2 - } - } + "start":205,"end":206,"loc":{"start":{"line":10,"column":1},"end":{"line":10,"column":2}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/output.json index cffd72d465..b1a4c4bd1d 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/declare-interface-method-reserved-word/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 103, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":0,"end":103,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 103, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":0,"end":103,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareInterface", - "start": 0, - "end": 102, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":102,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "X" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"X"}, "name": "X" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 20, - "end": 102, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":20,"end":102,"loc":{"start":{"line":1,"column":20},"end":{"line":6,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 24, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":24,"end":41,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "key": { "type": "Identifier", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "foobar" - }, + "start":24,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8},"identifierName":"foobar"}, "name": "foobar" }, "static": false, @@ -117,49 +38,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 24, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":24,"end":41,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":30,"end":33,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11}}, "params": [ { "type": "TypeParameter", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":31,"end":32,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "name": "T", "variance": null } @@ -167,51 +55,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 37, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 19 - } - } + "start":37,"end":41,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":19}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 45, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":45,"end":62,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":19}}, "key": { "type": "Identifier", - "start": 45, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "delete" - }, + "start":45,"end":51,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8},"identifierName":"delete"}, "name": "delete" }, "static": false, @@ -220,49 +74,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 45, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":45,"end":62,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":19}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":51,"end":54,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":11}}, "params": [ { "type": "TypeParameter", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":52,"end":53,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, "name": "T", "variance": null } @@ -270,51 +91,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 58, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 19 - } - } + "start":58,"end":62,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":19}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 66, - "end": 82, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":66,"end":82,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":18}}, "key": { "type": "Identifier", - "start": 66, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "yield" - }, + "start":66,"end":71,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":7},"identifierName":"yield"}, "name": "yield" }, "static": false, @@ -323,49 +110,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 66, - "end": 82, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":66,"end":82,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":18}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 71, - "end": 74, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":71,"end":74,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":10}}, "params": [ { "type": "TypeParameter", - "start": 72, - "end": 73, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":72,"end":73,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":9}}, "name": "T", "variance": null } @@ -373,51 +127,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 78, - "end": 82, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 18 - } - } + "start":78,"end":82,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":18}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 86, - "end": 99, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":86,"end":99,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":15}}, "key": { "type": "Identifier", - "start": 86, - "end": 88, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 4 - }, - "identifierName": "do" - }, + "start":86,"end":88,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":4},"identifierName":"do"}, "name": "do" }, "static": false, @@ -426,49 +146,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 86, - "end": 99, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":86,"end":99,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":15}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 88, - "end": 91, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 7 - } - }, + "start":88,"end":91,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":7}}, "params": [ { "type": "TypeParameter", - "start": 89, - "end": 90, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 6 - } - }, + "start":89,"end":90,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":6}}, "name": "T", "variance": null } @@ -476,18 +163,7 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 95, - "end": 99, - "loc": { - "start": { - "line": 5, - "column": 11 - }, - "end": { - "line": 5, - "column": 15 - } - } + "start":95,"end":99,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":15}} } }, "optional": false @@ -500,18 +176,7 @@ }, { "type": "EmptyStatement", - "start": 102, - "end": 103, - "loc": { - "start": { - "line": 6, - "column": 1 - }, - "end": { - "line": 6, - "column": 2 - } - } + "start":102,"end":103,"loc":{"start":{"line":6,"column":1},"end":{"line":6,"column":2}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/output.json index b902d88e15..127bd92825 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/default-missing/output.json @@ -1,129 +1,40 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "errors": [ "SyntaxError: Type parameter declaration needs a default, since a preceding type parameter declaration has a default. (1:28)" ], "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 6, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":6,"end":38,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":38}}, "params": [ { "type": "TypeParameter", - "start": 7, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":7,"end":26,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":26}}, "name": "HasDefault", "variance": null, "default": { "type": "StringTypeAnnotation", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - } + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26}} } }, { "type": "TypeParameter", - "start": 28, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":28,"end":37,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":37}}, "name": "NoDefault", "variance": null } @@ -131,34 +42,11 @@ }, "right": { "type": "GenericTypeAnnotation", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "T" - }, + "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42},"identifierName":"T"}, "name": "T" } } 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 8b2db5858c..767a8b8754 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 @@ -1,864 +1,259 @@ { "type": "File", - "start": 0, - "end": 1009, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 32, - "column": 22 - } - }, + "start":0,"end":1009,"loc":{"start":{"line":1,"column":0},"end":{"line":32,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 1009, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 32, - "column": 22 - } - }, + "start":0,"end":1009,"loc":{"start":{"line":1,"column":0},"end":{"line":32,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "A1" - }, + "start":5,"end":7,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":7},"identifierName":"A1"}, "name": "A1" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "params": [ { "type": "TypeParameter", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":8,"end":18,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":18}}, "name": "T", "variance": null, "default": { "type": "StringTypeAnnotation", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}} } } ] }, "right": { "type": "GenericTypeAnnotation", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "T" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"T"}, "name": "T" } } }, { "type": "TypeAlias", - "start": 24, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":24,"end":42,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "A2" - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":7},"identifierName":"A2"}, "name": "A2" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 31, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":31,"end":38,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":14}}, "params": [ { "type": "TypeParameter", - "start": 32, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":32,"end":37,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":13}}, "name": "T", "variance": null, "default": { "type": "ExistsTypeAnnotation", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - } - } + "start":36,"end":37,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13}} } } ] }, "right": { "type": "GenericTypeAnnotation", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":41,"end":42,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "T" - }, + "start":41,"end":42,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"T"}, "name": "T" } } }, { "type": "TypeAlias", - "start": 43, - "end": 75, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 32 - } - }, + "start":43,"end":75,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":32}}, "id": { "type": "Identifier", - "start": 48, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "A3" - }, + "start":48,"end":50,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":7},"identifierName":"A3"}, "name": "A3" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 50, - "end": 71, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 28 - } - }, + "start":50,"end":71,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":28}}, "params": [ { "type": "TypeParameter", - "start": 51, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":51,"end":70,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":27}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 52, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":52,"end":61,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":18}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 54, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":54,"end":61,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":18}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 55, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 18 - } - } + "start":55,"end":61,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":18}} } } }, "default": { "type": "StringTypeAnnotation", - "start": 64, - "end": 70, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 27 - } - } + "start":64,"end":70,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":27}} } } ] }, "right": { "type": "GenericTypeAnnotation", - "start": 74, - "end": 75, - "loc": { - "start": { - "line": 3, - "column": 31 - }, - "end": { - "line": 3, - "column": 32 - } - }, + "start":74,"end":75,"loc":{"start":{"line":3,"column":31},"end":{"line":3,"column":32}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 74, - "end": 75, - "loc": { - "start": { - "line": 3, - "column": 31 - }, - "end": { - "line": 3, - "column": 32 - }, - "identifierName": "T" - }, + "start":74,"end":75,"loc":{"start":{"line":3,"column":31},"end":{"line":3,"column":32},"identifierName":"T"}, "name": "T" } } }, { "type": "TypeAlias", - "start": 76, - "end": 111, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 35 - } - }, + "start":76,"end":111,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":35}}, "id": { "type": "Identifier", - "start": 81, - "end": 83, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "A4" - }, + "start":81,"end":83,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":7},"identifierName":"A4"}, "name": "A4" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 83, - "end": 107, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 31 - } - }, + "start":83,"end":107,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":31}}, "params": [ { "type": "TypeParameter", - "start": 84, - "end": 85, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":84,"end":85,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":9}}, "name": "S", "variance": null }, { "type": "TypeParameter", - "start": 87, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 30 - } - }, + "start":87,"end":106,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":30}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 88, - "end": 97, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 21 - } - }, + "start":88,"end":97,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":21}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 90, - "end": 97, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 21 - } - }, + "start":90,"end":97,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":21}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 91, - "end": 97, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 21 - } - } + "start":91,"end":97,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":21}} } } }, "default": { "type": "StringTypeAnnotation", - "start": 100, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 30 - } - } + "start":100,"end":106,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":30}} } } ] }, "right": { "type": "GenericTypeAnnotation", - "start": 110, - "end": 111, - "loc": { - "start": { - "line": 4, - "column": 34 - }, - "end": { - "line": 4, - "column": 35 - } - }, + "start":110,"end":111,"loc":{"start":{"line":4,"column":34},"end":{"line":4,"column":35}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 110, - "end": 111, - "loc": { - "start": { - "line": 4, - "column": 34 - }, - "end": { - "line": 4, - "column": 35 - }, - "identifierName": "T" - }, + "start":110,"end":111,"loc":{"start":{"line":4,"column":34},"end":{"line":4,"column":35},"identifierName":"T"}, "name": "T" } } }, { "type": "TypeAlias", - "start": 112, - "end": 156, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 44 - } - }, + "start":112,"end":156,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":44}}, "id": { "type": "Identifier", - "start": 117, - "end": 119, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 7 - }, - "identifierName": "A5" - }, + "start":117,"end":119,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":7},"identifierName":"A5"}, "name": "A5" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 119, - "end": 152, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 40 - } - }, + "start":119,"end":152,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":40}}, "params": [ { "type": "TypeParameter", - "start": 120, - "end": 130, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 18 - } - }, + "start":120,"end":130,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":18}}, "name": "S", "variance": null, "default": { "type": "NumberTypeAnnotation", - "start": 124, - "end": 130, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 18 - } - } + "start":124,"end":130,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":18}} } }, { "type": "TypeParameter", - "start": 132, - "end": 151, - "loc": { - "start": { - "line": 5, - "column": 20 - }, - "end": { - "line": 5, - "column": 39 - } - }, + "start":132,"end":151,"loc":{"start":{"line":5,"column":20},"end":{"line":5,"column":39}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 133, - "end": 142, - "loc": { - "start": { - "line": 5, - "column": 21 - }, - "end": { - "line": 5, - "column": 30 - } - }, + "start":133,"end":142,"loc":{"start":{"line":5,"column":21},"end":{"line":5,"column":30}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 135, - "end": 142, - "loc": { - "start": { - "line": 5, - "column": 23 - }, - "end": { - "line": 5, - "column": 30 - } - }, + "start":135,"end":142,"loc":{"start":{"line":5,"column":23},"end":{"line":5,"column":30}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 136, - "end": 142, - "loc": { - "start": { - "line": 5, - "column": 24 - }, - "end": { - "line": 5, - "column": 30 - } - } + "start":136,"end":142,"loc":{"start":{"line":5,"column":24},"end":{"line":5,"column":30}} } } }, "default": { "type": "StringTypeAnnotation", - "start": 145, - "end": 151, - "loc": { - "start": { - "line": 5, - "column": 33 - }, - "end": { - "line": 5, - "column": 39 - } - } + "start":145,"end":151,"loc":{"start":{"line":5,"column":33},"end":{"line":5,"column":39}} } } ] }, "right": { "type": "GenericTypeAnnotation", - "start": 155, - "end": 156, - "loc": { - "start": { - "line": 5, - "column": 43 - }, - "end": { - "line": 5, - "column": 44 - } - }, + "start":155,"end":156,"loc":{"start":{"line":5,"column":43},"end":{"line":5,"column":44}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 155, - "end": 156, - "loc": { - "start": { - "line": 5, - "column": 43 - }, - "end": { - "line": 5, - "column": 44 - }, - "identifierName": "T" - }, + "start":155,"end":156,"loc":{"start":{"line":5,"column":43},"end":{"line":5,"column":44},"identifierName":"T"}, "name": "T" } } }, { "type": "ClassDeclaration", - "start": 157, - "end": 180, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 23 - } - }, + "start":157,"end":180,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":23}}, "id": { "type": "Identifier", - "start": 163, - "end": 165, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 6, - "column": 8 - }, - "identifierName": "A6" - }, + "start":163,"end":165,"loc":{"start":{"line":6,"column":6},"end":{"line":6,"column":8},"identifierName":"A6"}, "name": "A6" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 165, - "end": 177, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 6, - "column": 20 - } - }, + "start":165,"end":177,"loc":{"start":{"line":6,"column":8},"end":{"line":6,"column":20}}, "params": [ { "type": "TypeParameter", - "start": 166, - "end": 176, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 19 - } - }, + "start":166,"end":176,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":19}}, "name": "T", "variance": null, "default": { "type": "StringTypeAnnotation", - "start": 170, - "end": 176, - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 6, - "column": 19 - } - } + "start":170,"end":176,"loc":{"start":{"line":6,"column":13},"end":{"line":6,"column":19}} } } ] @@ -866,142 +261,42 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 178, - "end": 180, - "loc": { - "start": { - "line": 6, - "column": 21 - }, - "end": { - "line": 6, - "column": 23 - } - }, + "start":178,"end":180,"loc":{"start":{"line":6,"column":21},"end":{"line":6,"column":23}}, "body": [] } }, { "type": "ClassDeclaration", - "start": 181, - "end": 213, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 32 - } - }, + "start":181,"end":213,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":32}}, "id": { "type": "Identifier", - "start": 187, - "end": 189, - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 8 - }, - "identifierName": "A7" - }, + "start":187,"end":189,"loc":{"start":{"line":7,"column":6},"end":{"line":7,"column":8},"identifierName":"A7"}, "name": "A7" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 189, - "end": 210, - "loc": { - "start": { - "line": 7, - "column": 8 - }, - "end": { - "line": 7, - "column": 29 - } - }, + "start":189,"end":210,"loc":{"start":{"line":7,"column":8},"end":{"line":7,"column":29}}, "params": [ { "type": "TypeParameter", - "start": 190, - "end": 209, - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 28 - } - }, + "start":190,"end":209,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":28}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 191, - "end": 200, - "loc": { - "start": { - "line": 7, - "column": 10 - }, - "end": { - "line": 7, - "column": 19 - } - }, + "start":191,"end":200,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":19}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 193, - "end": 200, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 19 - } - }, + "start":193,"end":200,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":19}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 194, - "end": 200, - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 19 - } - } + "start":194,"end":200,"loc":{"start":{"line":7,"column":13},"end":{"line":7,"column":19}} } } }, "default": { "type": "StringTypeAnnotation", - "start": 203, - "end": 209, - "loc": { - "start": { - "line": 7, - "column": 22 - }, - "end": { - "line": 7, - "column": 28 - } - } + "start":203,"end":209,"loc":{"start":{"line":7,"column":22},"end":{"line":7,"column":28}} } } ] @@ -1009,159 +304,48 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 211, - "end": 213, - "loc": { - "start": { - "line": 7, - "column": 30 - }, - "end": { - "line": 7, - "column": 32 - } - }, + "start":211,"end":213,"loc":{"start":{"line":7,"column":30},"end":{"line":7,"column":32}}, "body": [] } }, { "type": "ClassDeclaration", - "start": 214, - "end": 249, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 35 - } - }, + "start":214,"end":249,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":35}}, "id": { "type": "Identifier", - "start": 220, - "end": 222, - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 8 - }, - "identifierName": "A8" - }, + "start":220,"end":222,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":8},"identifierName":"A8"}, "name": "A8" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 222, - "end": 246, - "loc": { - "start": { - "line": 8, - "column": 8 - }, - "end": { - "line": 8, - "column": 32 - } - }, + "start":222,"end":246,"loc":{"start":{"line":8,"column":8},"end":{"line":8,"column":32}}, "params": [ { "type": "TypeParameter", - "start": 223, - "end": 224, - "loc": { - "start": { - "line": 8, - "column": 9 - }, - "end": { - "line": 8, - "column": 10 - } - }, + "start":223,"end":224,"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":10}}, "name": "S", "variance": null }, { "type": "TypeParameter", - "start": 226, - "end": 245, - "loc": { - "start": { - "line": 8, - "column": 12 - }, - "end": { - "line": 8, - "column": 31 - } - }, + "start":226,"end":245,"loc":{"start":{"line":8,"column":12},"end":{"line":8,"column":31}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 227, - "end": 236, - "loc": { - "start": { - "line": 8, - "column": 13 - }, - "end": { - "line": 8, - "column": 22 - } - }, + "start":227,"end":236,"loc":{"start":{"line":8,"column":13},"end":{"line":8,"column":22}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 229, - "end": 236, - "loc": { - "start": { - "line": 8, - "column": 15 - }, - "end": { - "line": 8, - "column": 22 - } - }, + "start":229,"end":236,"loc":{"start":{"line":8,"column":15},"end":{"line":8,"column":22}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 230, - "end": 236, - "loc": { - "start": { - "line": 8, - "column": 16 - }, - "end": { - "line": 8, - "column": 22 - } - } + "start":230,"end":236,"loc":{"start":{"line":8,"column":16},"end":{"line":8,"column":22}} } } }, "default": { "type": "StringTypeAnnotation", - "start": 239, - "end": 245, - "loc": { - "start": { - "line": 8, - "column": 25 - }, - "end": { - "line": 8, - "column": 31 - } - } + "start":239,"end":245,"loc":{"start":{"line":8,"column":25},"end":{"line":8,"column":31}} } } ] @@ -1169,174 +353,52 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 247, - "end": 249, - "loc": { - "start": { - "line": 8, - "column": 33 - }, - "end": { - "line": 8, - "column": 35 - } - }, + "start":247,"end":249,"loc":{"start":{"line":8,"column":33},"end":{"line":8,"column":35}}, "body": [] } }, { "type": "ClassDeclaration", - "start": 250, - "end": 294, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 44 - } - }, + "start":250,"end":294,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":44}}, "id": { "type": "Identifier", - "start": 256, - "end": 258, - "loc": { - "start": { - "line": 9, - "column": 6 - }, - "end": { - "line": 9, - "column": 8 - }, - "identifierName": "A9" - }, + "start":256,"end":258,"loc":{"start":{"line":9,"column":6},"end":{"line":9,"column":8},"identifierName":"A9"}, "name": "A9" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 258, - "end": 291, - "loc": { - "start": { - "line": 9, - "column": 8 - }, - "end": { - "line": 9, - "column": 41 - } - }, + "start":258,"end":291,"loc":{"start":{"line":9,"column":8},"end":{"line":9,"column":41}}, "params": [ { "type": "TypeParameter", - "start": 259, - "end": 269, - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 9, - "column": 19 - } - }, + "start":259,"end":269,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":19}}, "name": "S", "variance": null, "default": { "type": "NumberTypeAnnotation", - "start": 263, - "end": 269, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 19 - } - } + "start":263,"end":269,"loc":{"start":{"line":9,"column":13},"end":{"line":9,"column":19}} } }, { "type": "TypeParameter", - "start": 271, - "end": 290, - "loc": { - "start": { - "line": 9, - "column": 21 - }, - "end": { - "line": 9, - "column": 40 - } - }, + "start":271,"end":290,"loc":{"start":{"line":9,"column":21},"end":{"line":9,"column":40}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 272, - "end": 281, - "loc": { - "start": { - "line": 9, - "column": 22 - }, - "end": { - "line": 9, - "column": 31 - } - }, + "start":272,"end":281,"loc":{"start":{"line":9,"column":22},"end":{"line":9,"column":31}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 274, - "end": 281, - "loc": { - "start": { - "line": 9, - "column": 24 - }, - "end": { - "line": 9, - "column": 31 - } - }, + "start":274,"end":281,"loc":{"start":{"line":9,"column":24},"end":{"line":9,"column":31}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 275, - "end": 281, - "loc": { - "start": { - "line": 9, - "column": 25 - }, - "end": { - "line": 9, - "column": 31 - } - } + "start":275,"end":281,"loc":{"start":{"line":9,"column":25},"end":{"line":9,"column":31}} } } }, "default": { "type": "StringTypeAnnotation", - "start": 284, - "end": 290, - "loc": { - "start": { - "line": 9, - "column": 34 - }, - "end": { - "line": 9, - "column": 40 - } - } + "start":284,"end":290,"loc":{"start":{"line":9,"column":34},"end":{"line":9,"column":40}} } } ] @@ -1344,126 +406,37 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 292, - "end": 294, - "loc": { - "start": { - "line": 9, - "column": 42 - }, - "end": { - "line": 9, - "column": 44 - } - }, + "start":292,"end":294,"loc":{"start":{"line":9,"column":42},"end":{"line":9,"column":44}}, "body": [] } }, { "type": "EmptyStatement", - "start": 295, - "end": 296, - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 10, - "column": 1 - } - } + "start":295,"end":296,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":1}} }, { "type": "ExpressionStatement", - "start": 296, - "end": 324, - "loc": { - "start": { - "line": 10, - "column": 1 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":296,"end":324,"loc":{"start":{"line":10,"column":1},"end":{"line":11,"column":1}}, "expression": { "type": "ClassExpression", - "start": 297, - "end": 321, - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 10, - "column": 26 - } - }, + "start":297,"end":321,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":26}}, "id": { "type": "Identifier", - "start": 303, - "end": 306, - "loc": { - "start": { - "line": 10, - "column": 8 - }, - "end": { - "line": 10, - "column": 11 - }, - "identifierName": "A10" - }, + "start":303,"end":306,"loc":{"start":{"line":10,"column":8},"end":{"line":10,"column":11},"identifierName":"A10"}, "name": "A10" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 306, - "end": 318, - "loc": { - "start": { - "line": 10, - "column": 11 - }, - "end": { - "line": 10, - "column": 23 - } - }, + "start":306,"end":318,"loc":{"start":{"line":10,"column":11},"end":{"line":10,"column":23}}, "params": [ { "type": "TypeParameter", - "start": 307, - "end": 317, - "loc": { - "start": { - "line": 10, - "column": 12 - }, - "end": { - "line": 10, - "column": 22 - } - }, + "start":307,"end":317,"loc":{"start":{"line":10,"column":12},"end":{"line":10,"column":22}}, "name": "T", "variance": null, "default": { "type": "StringTypeAnnotation", - "start": 311, - "end": 317, - "loc": { - "start": { - "line": 10, - "column": 16 - }, - "end": { - "line": 10, - "column": 22 - } - } + "start":311,"end":317,"loc":{"start":{"line":10,"column":16},"end":{"line":10,"column":22}} } } ] @@ -1471,18 +444,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 319, - "end": 321, - "loc": { - "start": { - "line": 10, - "column": 24 - }, - "end": { - "line": 10, - "column": 26 - } - }, + "start":319,"end":321,"loc":{"start":{"line":10,"column":24},"end":{"line":10,"column":26}}, "body": [] }, "extra": { @@ -1493,139 +455,39 @@ }, { "type": "ExpressionStatement", - "start": 324, - "end": 361, - "loc": { - "start": { - "line": 11, - "column": 1 - }, - "end": { - "line": 12, - "column": 1 - } - }, + "start":324,"end":361,"loc":{"start":{"line":11,"column":1},"end":{"line":12,"column":1}}, "expression": { "type": "ClassExpression", - "start": 325, - "end": 358, - "loc": { - "start": { - "line": 11, - "column": 2 - }, - "end": { - "line": 11, - "column": 35 - } - }, + "start":325,"end":358,"loc":{"start":{"line":11,"column":2},"end":{"line":11,"column":35}}, "id": { "type": "Identifier", - "start": 331, - "end": 334, - "loc": { - "start": { - "line": 11, - "column": 8 - }, - "end": { - "line": 11, - "column": 11 - }, - "identifierName": "A11" - }, + "start":331,"end":334,"loc":{"start":{"line":11,"column":8},"end":{"line":11,"column":11},"identifierName":"A11"}, "name": "A11" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 334, - "end": 355, - "loc": { - "start": { - "line": 11, - "column": 11 - }, - "end": { - "line": 11, - "column": 32 - } - }, + "start":334,"end":355,"loc":{"start":{"line":11,"column":11},"end":{"line":11,"column":32}}, "params": [ { "type": "TypeParameter", - "start": 335, - "end": 354, - "loc": { - "start": { - "line": 11, - "column": 12 - }, - "end": { - "line": 11, - "column": 31 - } - }, + "start":335,"end":354,"loc":{"start":{"line":11,"column":12},"end":{"line":11,"column":31}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 336, - "end": 345, - "loc": { - "start": { - "line": 11, - "column": 13 - }, - "end": { - "line": 11, - "column": 22 - } - }, + "start":336,"end":345,"loc":{"start":{"line":11,"column":13},"end":{"line":11,"column":22}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 338, - "end": 345, - "loc": { - "start": { - "line": 11, - "column": 15 - }, - "end": { - "line": 11, - "column": 22 - } - }, + "start":338,"end":345,"loc":{"start":{"line":11,"column":15},"end":{"line":11,"column":22}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 339, - "end": 345, - "loc": { - "start": { - "line": 11, - "column": 16 - }, - "end": { - "line": 11, - "column": 22 - } - } + "start":339,"end":345,"loc":{"start":{"line":11,"column":16},"end":{"line":11,"column":22}} } } }, "default": { "type": "StringTypeAnnotation", - "start": 348, - "end": 354, - "loc": { - "start": { - "line": 11, - "column": 25 - }, - "end": { - "line": 11, - "column": 31 - } - } + "start":348,"end":354,"loc":{"start":{"line":11,"column":25},"end":{"line":11,"column":31}} } } ] @@ -1633,18 +495,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 356, - "end": 358, - "loc": { - "start": { - "line": 11, - "column": 33 - }, - "end": { - "line": 11, - "column": 35 - } - }, + "start":356,"end":358,"loc":{"start":{"line":11,"column":33},"end":{"line":11,"column":35}}, "body": [] }, "extra": { @@ -1655,156 +506,45 @@ }, { "type": "ExpressionStatement", - "start": 361, - "end": 401, - "loc": { - "start": { - "line": 12, - "column": 1 - }, - "end": { - "line": 13, - "column": 1 - } - }, + "start":361,"end":401,"loc":{"start":{"line":12,"column":1},"end":{"line":13,"column":1}}, "expression": { "type": "ClassExpression", - "start": 362, - "end": 398, - "loc": { - "start": { - "line": 12, - "column": 2 - }, - "end": { - "line": 12, - "column": 38 - } - }, + "start":362,"end":398,"loc":{"start":{"line":12,"column":2},"end":{"line":12,"column":38}}, "id": { "type": "Identifier", - "start": 368, - "end": 371, - "loc": { - "start": { - "line": 12, - "column": 8 - }, - "end": { - "line": 12, - "column": 11 - }, - "identifierName": "A12" - }, + "start":368,"end":371,"loc":{"start":{"line":12,"column":8},"end":{"line":12,"column":11},"identifierName":"A12"}, "name": "A12" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 371, - "end": 395, - "loc": { - "start": { - "line": 12, - "column": 11 - }, - "end": { - "line": 12, - "column": 35 - } - }, + "start":371,"end":395,"loc":{"start":{"line":12,"column":11},"end":{"line":12,"column":35}}, "params": [ { "type": "TypeParameter", - "start": 372, - "end": 373, - "loc": { - "start": { - "line": 12, - "column": 12 - }, - "end": { - "line": 12, - "column": 13 - } - }, + "start":372,"end":373,"loc":{"start":{"line":12,"column":12},"end":{"line":12,"column":13}}, "name": "S", "variance": null }, { "type": "TypeParameter", - "start": 375, - "end": 394, - "loc": { - "start": { - "line": 12, - "column": 15 - }, - "end": { - "line": 12, - "column": 34 - } - }, + "start":375,"end":394,"loc":{"start":{"line":12,"column":15},"end":{"line":12,"column":34}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 376, - "end": 385, - "loc": { - "start": { - "line": 12, - "column": 16 - }, - "end": { - "line": 12, - "column": 25 - } - }, + "start":376,"end":385,"loc":{"start":{"line":12,"column":16},"end":{"line":12,"column":25}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 378, - "end": 385, - "loc": { - "start": { - "line": 12, - "column": 18 - }, - "end": { - "line": 12, - "column": 25 - } - }, + "start":378,"end":385,"loc":{"start":{"line":12,"column":18},"end":{"line":12,"column":25}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 379, - "end": 385, - "loc": { - "start": { - "line": 12, - "column": 19 - }, - "end": { - "line": 12, - "column": 25 - } - } + "start":379,"end":385,"loc":{"start":{"line":12,"column":19},"end":{"line":12,"column":25}} } } }, "default": { "type": "StringTypeAnnotation", - "start": 388, - "end": 394, - "loc": { - "start": { - "line": 12, - "column": 28 - }, - "end": { - "line": 12, - "column": 34 - } - } + "start":388,"end":394,"loc":{"start":{"line":12,"column":28},"end":{"line":12,"column":34}} } } ] @@ -1812,18 +552,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 396, - "end": 398, - "loc": { - "start": { - "line": 12, - "column": 36 - }, - "end": { - "line": 12, - "column": 38 - } - }, + "start":396,"end":398,"loc":{"start":{"line":12,"column":36},"end":{"line":12,"column":38}}, "body": [] }, "extra": { @@ -1834,171 +563,49 @@ }, { "type": "ExpressionStatement", - "start": 401, - "end": 448, - "loc": { - "start": { - "line": 13, - "column": 1 - }, - "end": { - "line": 13, - "column": 48 - } - }, + "start":401,"end":448,"loc":{"start":{"line":13,"column":1},"end":{"line":13,"column":48}}, "expression": { "type": "ClassExpression", - "start": 402, - "end": 447, - "loc": { - "start": { - "line": 13, - "column": 2 - }, - "end": { - "line": 13, - "column": 47 - } - }, + "start":402,"end":447,"loc":{"start":{"line":13,"column":2},"end":{"line":13,"column":47}}, "id": { "type": "Identifier", - "start": 408, - "end": 411, - "loc": { - "start": { - "line": 13, - "column": 8 - }, - "end": { - "line": 13, - "column": 11 - }, - "identifierName": "A13" - }, + "start":408,"end":411,"loc":{"start":{"line":13,"column":8},"end":{"line":13,"column":11},"identifierName":"A13"}, "name": "A13" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 411, - "end": 444, - "loc": { - "start": { - "line": 13, - "column": 11 - }, - "end": { - "line": 13, - "column": 44 - } - }, + "start":411,"end":444,"loc":{"start":{"line":13,"column":11},"end":{"line":13,"column":44}}, "params": [ { "type": "TypeParameter", - "start": 412, - "end": 422, - "loc": { - "start": { - "line": 13, - "column": 12 - }, - "end": { - "line": 13, - "column": 22 - } - }, + "start":412,"end":422,"loc":{"start":{"line":13,"column":12},"end":{"line":13,"column":22}}, "name": "S", "variance": null, "default": { "type": "NumberTypeAnnotation", - "start": 416, - "end": 422, - "loc": { - "start": { - "line": 13, - "column": 16 - }, - "end": { - "line": 13, - "column": 22 - } - } + "start":416,"end":422,"loc":{"start":{"line":13,"column":16},"end":{"line":13,"column":22}} } }, { "type": "TypeParameter", - "start": 424, - "end": 443, - "loc": { - "start": { - "line": 13, - "column": 24 - }, - "end": { - "line": 13, - "column": 43 - } - }, + "start":424,"end":443,"loc":{"start":{"line":13,"column":24},"end":{"line":13,"column":43}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 425, - "end": 434, - "loc": { - "start": { - "line": 13, - "column": 25 - }, - "end": { - "line": 13, - "column": 34 - } - }, + "start":425,"end":434,"loc":{"start":{"line":13,"column":25},"end":{"line":13,"column":34}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 427, - "end": 434, - "loc": { - "start": { - "line": 13, - "column": 27 - }, - "end": { - "line": 13, - "column": 34 - } - }, + "start":427,"end":434,"loc":{"start":{"line":13,"column":27},"end":{"line":13,"column":34}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 428, - "end": 434, - "loc": { - "start": { - "line": 13, - "column": 28 - }, - "end": { - "line": 13, - "column": 34 - } - } + "start":428,"end":434,"loc":{"start":{"line":13,"column":28},"end":{"line":13,"column":34}} } } }, "default": { "type": "StringTypeAnnotation", - "start": 437, - "end": 443, - "loc": { - "start": { - "line": 13, - "column": 37 - }, - "end": { - "line": 13, - "column": 43 - } - } + "start":437,"end":443,"loc":{"start":{"line":13,"column":37},"end":{"line":13,"column":43}} } } ] @@ -2006,18 +613,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 445, - "end": 447, - "loc": { - "start": { - "line": 13, - "column": 45 - }, - "end": { - "line": 13, - "column": 47 - } - }, + "start":445,"end":447,"loc":{"start":{"line":13,"column":45},"end":{"line":13,"column":47}}, "body": [] }, "extra": { @@ -2028,80 +624,24 @@ }, { "type": "DeclareClass", - "start": 449, - "end": 481, - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 32 - } - }, + "start":449,"end":481,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":32}}, "id": { "type": "Identifier", - "start": 463, - "end": 466, - "loc": { - "start": { - "line": 14, - "column": 14 - }, - "end": { - "line": 14, - "column": 17 - }, - "identifierName": "A14" - }, + "start":463,"end":466,"loc":{"start":{"line":14,"column":14},"end":{"line":14,"column":17},"identifierName":"A14"}, "name": "A14" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 466, - "end": 478, - "loc": { - "start": { - "line": 14, - "column": 17 - }, - "end": { - "line": 14, - "column": 29 - } - }, + "start":466,"end":478,"loc":{"start":{"line":14,"column":17},"end":{"line":14,"column":29}}, "params": [ { "type": "TypeParameter", - "start": 467, - "end": 477, - "loc": { - "start": { - "line": 14, - "column": 18 - }, - "end": { - "line": 14, - "column": 28 - } - }, + "start":467,"end":477,"loc":{"start":{"line":14,"column":18},"end":{"line":14,"column":28}}, "name": "T", "variance": null, "default": { "type": "StringTypeAnnotation", - "start": 471, - "end": 477, - "loc": { - "start": { - "line": 14, - "column": 22 - }, - "end": { - "line": 14, - "column": 28 - } - } + "start":471,"end":477,"loc":{"start":{"line":14,"column":22},"end":{"line":14,"column":28}} } } ] @@ -2111,18 +651,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 479, - "end": 481, - "loc": { - "start": { - "line": 14, - "column": 30 - }, - "end": { - "line": 14, - "column": 32 - } - }, + "start":479,"end":481,"loc":{"start":{"line":14,"column":30},"end":{"line":14,"column":32}}, "callProperties": [], "properties": [], "indexers": [], @@ -2132,125 +661,36 @@ }, { "type": "DeclareClass", - "start": 482, - "end": 523, - "loc": { - "start": { - "line": 15, - "column": 0 - }, - "end": { - "line": 15, - "column": 41 - } - }, + "start":482,"end":523,"loc":{"start":{"line":15,"column":0},"end":{"line":15,"column":41}}, "id": { "type": "Identifier", - "start": 496, - "end": 499, - "loc": { - "start": { - "line": 15, - "column": 14 - }, - "end": { - "line": 15, - "column": 17 - }, - "identifierName": "A15" - }, + "start":496,"end":499,"loc":{"start":{"line":15,"column":14},"end":{"line":15,"column":17},"identifierName":"A15"}, "name": "A15" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 499, - "end": 520, - "loc": { - "start": { - "line": 15, - "column": 17 - }, - "end": { - "line": 15, - "column": 38 - } - }, + "start":499,"end":520,"loc":{"start":{"line":15,"column":17},"end":{"line":15,"column":38}}, "params": [ { "type": "TypeParameter", - "start": 500, - "end": 519, - "loc": { - "start": { - "line": 15, - "column": 18 - }, - "end": { - "line": 15, - "column": 37 - } - }, + "start":500,"end":519,"loc":{"start":{"line":15,"column":18},"end":{"line":15,"column":37}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 501, - "end": 510, - "loc": { - "start": { - "line": 15, - "column": 19 - }, - "end": { - "line": 15, - "column": 28 - } - }, + "start":501,"end":510,"loc":{"start":{"line":15,"column":19},"end":{"line":15,"column":28}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 503, - "end": 510, - "loc": { - "start": { - "line": 15, - "column": 21 - }, - "end": { - "line": 15, - "column": 28 - } - }, + "start":503,"end":510,"loc":{"start":{"line":15,"column":21},"end":{"line":15,"column":28}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 504, - "end": 510, - "loc": { - "start": { - "line": 15, - "column": 22 - }, - "end": { - "line": 15, - "column": 28 - } - } + "start":504,"end":510,"loc":{"start":{"line":15,"column":22},"end":{"line":15,"column":28}} } } }, "default": { "type": "StringTypeAnnotation", - "start": 513, - "end": 519, - "loc": { - "start": { - "line": 15, - "column": 31 - }, - "end": { - "line": 15, - "column": 37 - } - } + "start":513,"end":519,"loc":{"start":{"line":15,"column":31},"end":{"line":15,"column":37}} } } ] @@ -2260,18 +700,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 521, - "end": 523, - "loc": { - "start": { - "line": 15, - "column": 39 - }, - "end": { - "line": 15, - "column": 41 - } - }, + "start":521,"end":523,"loc":{"start":{"line":15,"column":39},"end":{"line":15,"column":41}}, "callProperties": [], "properties": [], "indexers": [], @@ -2281,142 +710,42 @@ }, { "type": "DeclareClass", - "start": 524, - "end": 568, - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 16, - "column": 44 - } - }, + "start":524,"end":568,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":44}}, "id": { "type": "Identifier", - "start": 538, - "end": 541, - "loc": { - "start": { - "line": 16, - "column": 14 - }, - "end": { - "line": 16, - "column": 17 - }, - "identifierName": "A16" - }, + "start":538,"end":541,"loc":{"start":{"line":16,"column":14},"end":{"line":16,"column":17},"identifierName":"A16"}, "name": "A16" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 541, - "end": 565, - "loc": { - "start": { - "line": 16, - "column": 17 - }, - "end": { - "line": 16, - "column": 41 - } - }, + "start":541,"end":565,"loc":{"start":{"line":16,"column":17},"end":{"line":16,"column":41}}, "params": [ { "type": "TypeParameter", - "start": 542, - "end": 543, - "loc": { - "start": { - "line": 16, - "column": 18 - }, - "end": { - "line": 16, - "column": 19 - } - }, + "start":542,"end":543,"loc":{"start":{"line":16,"column":18},"end":{"line":16,"column":19}}, "name": "S", "variance": null }, { "type": "TypeParameter", - "start": 545, - "end": 564, - "loc": { - "start": { - "line": 16, - "column": 21 - }, - "end": { - "line": 16, - "column": 40 - } - }, + "start":545,"end":564,"loc":{"start":{"line":16,"column":21},"end":{"line":16,"column":40}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 546, - "end": 555, - "loc": { - "start": { - "line": 16, - "column": 22 - }, - "end": { - "line": 16, - "column": 31 - } - }, + "start":546,"end":555,"loc":{"start":{"line":16,"column":22},"end":{"line":16,"column":31}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 548, - "end": 555, - "loc": { - "start": { - "line": 16, - "column": 24 - }, - "end": { - "line": 16, - "column": 31 - } - }, + "start":548,"end":555,"loc":{"start":{"line":16,"column":24},"end":{"line":16,"column":31}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 549, - "end": 555, - "loc": { - "start": { - "line": 16, - "column": 25 - }, - "end": { - "line": 16, - "column": 31 - } - } + "start":549,"end":555,"loc":{"start":{"line":16,"column":25},"end":{"line":16,"column":31}} } } }, "default": { "type": "StringTypeAnnotation", - "start": 558, - "end": 564, - "loc": { - "start": { - "line": 16, - "column": 34 - }, - "end": { - "line": 16, - "column": 40 - } - } + "start":558,"end":564,"loc":{"start":{"line":16,"column":34},"end":{"line":16,"column":40}} } } ] @@ -2426,18 +755,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 566, - "end": 568, - "loc": { - "start": { - "line": 16, - "column": 42 - }, - "end": { - "line": 16, - "column": 44 - } - }, + "start":566,"end":568,"loc":{"start":{"line":16,"column":42},"end":{"line":16,"column":44}}, "callProperties": [], "properties": [], "indexers": [], @@ -2447,157 +765,46 @@ }, { "type": "DeclareClass", - "start": 569, - "end": 622, - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 17, - "column": 53 - } - }, + "start":569,"end":622,"loc":{"start":{"line":17,"column":0},"end":{"line":17,"column":53}}, "id": { "type": "Identifier", - "start": 583, - "end": 586, - "loc": { - "start": { - "line": 17, - "column": 14 - }, - "end": { - "line": 17, - "column": 17 - }, - "identifierName": "A17" - }, + "start":583,"end":586,"loc":{"start":{"line":17,"column":14},"end":{"line":17,"column":17},"identifierName":"A17"}, "name": "A17" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 586, - "end": 619, - "loc": { - "start": { - "line": 17, - "column": 17 - }, - "end": { - "line": 17, - "column": 50 - } - }, + "start":586,"end":619,"loc":{"start":{"line":17,"column":17},"end":{"line":17,"column":50}}, "params": [ { "type": "TypeParameter", - "start": 587, - "end": 597, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 28 - } - }, + "start":587,"end":597,"loc":{"start":{"line":17,"column":18},"end":{"line":17,"column":28}}, "name": "S", "variance": null, "default": { "type": "NumberTypeAnnotation", - "start": 591, - "end": 597, - "loc": { - "start": { - "line": 17, - "column": 22 - }, - "end": { - "line": 17, - "column": 28 - } - } + "start":591,"end":597,"loc":{"start":{"line":17,"column":22},"end":{"line":17,"column":28}} } }, { "type": "TypeParameter", - "start": 599, - "end": 618, - "loc": { - "start": { - "line": 17, - "column": 30 - }, - "end": { - "line": 17, - "column": 49 - } - }, + "start":599,"end":618,"loc":{"start":{"line":17,"column":30},"end":{"line":17,"column":49}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 600, - "end": 609, - "loc": { - "start": { - "line": 17, - "column": 31 - }, - "end": { - "line": 17, - "column": 40 - } - }, + "start":600,"end":609,"loc":{"start":{"line":17,"column":31},"end":{"line":17,"column":40}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 602, - "end": 609, - "loc": { - "start": { - "line": 17, - "column": 33 - }, - "end": { - "line": 17, - "column": 40 - } - }, + "start":602,"end":609,"loc":{"start":{"line":17,"column":33},"end":{"line":17,"column":40}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 603, - "end": 609, - "loc": { - "start": { - "line": 17, - "column": 34 - }, - "end": { - "line": 17, - "column": 40 - } - } + "start":603,"end":609,"loc":{"start":{"line":17,"column":34},"end":{"line":17,"column":40}} } } }, "default": { "type": "StringTypeAnnotation", - "start": 612, - "end": 618, - "loc": { - "start": { - "line": 17, - "column": 43 - }, - "end": { - "line": 17, - "column": 49 - } - } + "start":612,"end":618,"loc":{"start":{"line":17,"column":43},"end":{"line":17,"column":49}} } } ] @@ -2607,18 +814,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 620, - "end": 622, - "loc": { - "start": { - "line": 17, - "column": 51 - }, - "end": { - "line": 17, - "column": 53 - } - }, + "start":620,"end":622,"loc":{"start":{"line":17,"column":51},"end":{"line":17,"column":53}}, "callProperties": [], "properties": [], "indexers": [], @@ -2628,80 +824,24 @@ }, { "type": "InterfaceDeclaration", - "start": 623, - "end": 651, - "loc": { - "start": { - "line": 18, - "column": 0 - }, - "end": { - "line": 18, - "column": 28 - } - }, + "start":623,"end":651,"loc":{"start":{"line":18,"column":0},"end":{"line":18,"column":28}}, "id": { "type": "Identifier", - "start": 633, - "end": 636, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 13 - }, - "identifierName": "A18" - }, + "start":633,"end":636,"loc":{"start":{"line":18,"column":10},"end":{"line":18,"column":13},"identifierName":"A18"}, "name": "A18" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 636, - "end": 648, - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 25 - } - }, + "start":636,"end":648,"loc":{"start":{"line":18,"column":13},"end":{"line":18,"column":25}}, "params": [ { "type": "TypeParameter", - "start": 637, - "end": 647, - "loc": { - "start": { - "line": 18, - "column": 14 - }, - "end": { - "line": 18, - "column": 24 - } - }, + "start":637,"end":647,"loc":{"start":{"line":18,"column":14},"end":{"line":18,"column":24}}, "name": "T", "variance": null, "default": { "type": "StringTypeAnnotation", - "start": 641, - "end": 647, - "loc": { - "start": { - "line": 18, - "column": 18 - }, - "end": { - "line": 18, - "column": 24 - } - } + "start":641,"end":647,"loc":{"start":{"line":18,"column":18},"end":{"line":18,"column":24}} } } ] @@ -2711,18 +851,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 649, - "end": 651, - "loc": { - "start": { - "line": 18, - "column": 26 - }, - "end": { - "line": 18, - "column": 28 - } - }, + "start":649,"end":651,"loc":{"start":{"line":18,"column":26},"end":{"line":18,"column":28}}, "callProperties": [], "properties": [], "indexers": [], @@ -2732,125 +861,36 @@ }, { "type": "InterfaceDeclaration", - "start": 652, - "end": 689, - "loc": { - "start": { - "line": 19, - "column": 0 - }, - "end": { - "line": 19, - "column": 37 - } - }, + "start":652,"end":689,"loc":{"start":{"line":19,"column":0},"end":{"line":19,"column":37}}, "id": { "type": "Identifier", - "start": 662, - "end": 665, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 13 - }, - "identifierName": "A19" - }, + "start":662,"end":665,"loc":{"start":{"line":19,"column":10},"end":{"line":19,"column":13},"identifierName":"A19"}, "name": "A19" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 665, - "end": 686, - "loc": { - "start": { - "line": 19, - "column": 13 - }, - "end": { - "line": 19, - "column": 34 - } - }, + "start":665,"end":686,"loc":{"start":{"line":19,"column":13},"end":{"line":19,"column":34}}, "params": [ { "type": "TypeParameter", - "start": 666, - "end": 685, - "loc": { - "start": { - "line": 19, - "column": 14 - }, - "end": { - "line": 19, - "column": 33 - } - }, + "start":666,"end":685,"loc":{"start":{"line":19,"column":14},"end":{"line":19,"column":33}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 667, - "end": 676, - "loc": { - "start": { - "line": 19, - "column": 15 - }, - "end": { - "line": 19, - "column": 24 - } - }, + "start":667,"end":676,"loc":{"start":{"line":19,"column":15},"end":{"line":19,"column":24}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 669, - "end": 676, - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 24 - } - }, + "start":669,"end":676,"loc":{"start":{"line":19,"column":17},"end":{"line":19,"column":24}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 670, - "end": 676, - "loc": { - "start": { - "line": 19, - "column": 18 - }, - "end": { - "line": 19, - "column": 24 - } - } + "start":670,"end":676,"loc":{"start":{"line":19,"column":18},"end":{"line":19,"column":24}} } } }, "default": { "type": "StringTypeAnnotation", - "start": 679, - "end": 685, - "loc": { - "start": { - "line": 19, - "column": 27 - }, - "end": { - "line": 19, - "column": 33 - } - } + "start":679,"end":685,"loc":{"start":{"line":19,"column":27},"end":{"line":19,"column":33}} } } ] @@ -2860,18 +900,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 687, - "end": 689, - "loc": { - "start": { - "line": 19, - "column": 35 - }, - "end": { - "line": 19, - "column": 37 - } - }, + "start":687,"end":689,"loc":{"start":{"line":19,"column":35},"end":{"line":19,"column":37}}, "callProperties": [], "properties": [], "indexers": [], @@ -2881,142 +910,42 @@ }, { "type": "InterfaceDeclaration", - "start": 690, - "end": 730, - "loc": { - "start": { - "line": 20, - "column": 0 - }, - "end": { - "line": 20, - "column": 40 - } - }, + "start":690,"end":730,"loc":{"start":{"line":20,"column":0},"end":{"line":20,"column":40}}, "id": { "type": "Identifier", - "start": 700, - "end": 703, - "loc": { - "start": { - "line": 20, - "column": 10 - }, - "end": { - "line": 20, - "column": 13 - }, - "identifierName": "A20" - }, + "start":700,"end":703,"loc":{"start":{"line":20,"column":10},"end":{"line":20,"column":13},"identifierName":"A20"}, "name": "A20" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 703, - "end": 727, - "loc": { - "start": { - "line": 20, - "column": 13 - }, - "end": { - "line": 20, - "column": 37 - } - }, + "start":703,"end":727,"loc":{"start":{"line":20,"column":13},"end":{"line":20,"column":37}}, "params": [ { "type": "TypeParameter", - "start": 704, - "end": 705, - "loc": { - "start": { - "line": 20, - "column": 14 - }, - "end": { - "line": 20, - "column": 15 - } - }, + "start":704,"end":705,"loc":{"start":{"line":20,"column":14},"end":{"line":20,"column":15}}, "name": "S", "variance": null }, { "type": "TypeParameter", - "start": 707, - "end": 726, - "loc": { - "start": { - "line": 20, - "column": 17 - }, - "end": { - "line": 20, - "column": 36 - } - }, + "start":707,"end":726,"loc":{"start":{"line":20,"column":17},"end":{"line":20,"column":36}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 708, - "end": 717, - "loc": { - "start": { - "line": 20, - "column": 18 - }, - "end": { - "line": 20, - "column": 27 - } - }, + "start":708,"end":717,"loc":{"start":{"line":20,"column":18},"end":{"line":20,"column":27}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 710, - "end": 717, - "loc": { - "start": { - "line": 20, - "column": 20 - }, - "end": { - "line": 20, - "column": 27 - } - }, + "start":710,"end":717,"loc":{"start":{"line":20,"column":20},"end":{"line":20,"column":27}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 711, - "end": 717, - "loc": { - "start": { - "line": 20, - "column": 21 - }, - "end": { - "line": 20, - "column": 27 - } - } + "start":711,"end":717,"loc":{"start":{"line":20,"column":21},"end":{"line":20,"column":27}} } } }, "default": { "type": "StringTypeAnnotation", - "start": 720, - "end": 726, - "loc": { - "start": { - "line": 20, - "column": 30 - }, - "end": { - "line": 20, - "column": 36 - } - } + "start":720,"end":726,"loc":{"start":{"line":20,"column":30},"end":{"line":20,"column":36}} } } ] @@ -3026,18 +955,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 728, - "end": 730, - "loc": { - "start": { - "line": 20, - "column": 38 - }, - "end": { - "line": 20, - "column": 40 - } - }, + "start":728,"end":730,"loc":{"start":{"line":20,"column":38},"end":{"line":20,"column":40}}, "callProperties": [], "properties": [], "indexers": [], @@ -3047,157 +965,46 @@ }, { "type": "InterfaceDeclaration", - "start": 731, - "end": 780, - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 21, - "column": 49 - } - }, + "start":731,"end":780,"loc":{"start":{"line":21,"column":0},"end":{"line":21,"column":49}}, "id": { "type": "Identifier", - "start": 741, - "end": 744, - "loc": { - "start": { - "line": 21, - "column": 10 - }, - "end": { - "line": 21, - "column": 13 - }, - "identifierName": "A21" - }, + "start":741,"end":744,"loc":{"start":{"line":21,"column":10},"end":{"line":21,"column":13},"identifierName":"A21"}, "name": "A21" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 744, - "end": 777, - "loc": { - "start": { - "line": 21, - "column": 13 - }, - "end": { - "line": 21, - "column": 46 - } - }, + "start":744,"end":777,"loc":{"start":{"line":21,"column":13},"end":{"line":21,"column":46}}, "params": [ { "type": "TypeParameter", - "start": 745, - "end": 755, - "loc": { - "start": { - "line": 21, - "column": 14 - }, - "end": { - "line": 21, - "column": 24 - } - }, + "start":745,"end":755,"loc":{"start":{"line":21,"column":14},"end":{"line":21,"column":24}}, "name": "S", "variance": null, "default": { "type": "NumberTypeAnnotation", - "start": 749, - "end": 755, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 24 - } - } + "start":749,"end":755,"loc":{"start":{"line":21,"column":18},"end":{"line":21,"column":24}} } }, { "type": "TypeParameter", - "start": 757, - "end": 776, - "loc": { - "start": { - "line": 21, - "column": 26 - }, - "end": { - "line": 21, - "column": 45 - } - }, + "start":757,"end":776,"loc":{"start":{"line":21,"column":26},"end":{"line":21,"column":45}}, "name": "T", "variance": null, "bound": { "type": "TypeAnnotation", - "start": 758, - "end": 767, - "loc": { - "start": { - "line": 21, - "column": 27 - }, - "end": { - "line": 21, - "column": 36 - } - }, + "start":758,"end":767,"loc":{"start":{"line":21,"column":27},"end":{"line":21,"column":36}}, "typeAnnotation": { "type": "NullableTypeAnnotation", - "start": 760, - "end": 767, - "loc": { - "start": { - "line": 21, - "column": 29 - }, - "end": { - "line": 21, - "column": 36 - } - }, + "start":760,"end":767,"loc":{"start":{"line":21,"column":29},"end":{"line":21,"column":36}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 761, - "end": 767, - "loc": { - "start": { - "line": 21, - "column": 30 - }, - "end": { - "line": 21, - "column": 36 - } - } + "start":761,"end":767,"loc":{"start":{"line":21,"column":30},"end":{"line":21,"column":36}} } } }, "default": { "type": "StringTypeAnnotation", - "start": 770, - "end": 776, - "loc": { - "start": { - "line": 21, - "column": 39 - }, - "end": { - "line": 21, - "column": 45 - } - } + "start":770,"end":776,"loc":{"start":{"line":21,"column":39},"end":{"line":21,"column":45}} } } ] @@ -3207,18 +1014,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 778, - "end": 780, - "loc": { - "start": { - "line": 21, - "column": 47 - }, - "end": { - "line": 21, - "column": 49 - } - }, + "start":778,"end":780,"loc":{"start":{"line":21,"column":47},"end":{"line":21,"column":49}}, "callProperties": [], "properties": [], "indexers": [], @@ -3228,196 +1024,61 @@ }, { "type": "TypeAlias", - "start": 781, - "end": 803, - "loc": { - "start": { - "line": 22, - "column": 0 - }, - "end": { - "line": 22, - "column": 22 - } - }, + "start":781,"end":803,"loc":{"start":{"line":22,"column":0},"end":{"line":22,"column":22}}, "id": { "type": "Identifier", - "start": 786, - "end": 789, - "loc": { - "start": { - "line": 22, - "column": 5 - }, - "end": { - "line": 22, - "column": 8 - }, - "identifierName": "A22" - }, + "start":786,"end":789,"loc":{"start":{"line":22,"column":5},"end":{"line":22,"column":8},"identifierName":"A22"}, "name": "A22" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 789, - "end": 799, - "loc": { - "start": { - "line": 22, - "column": 8 - }, - "end": { - "line": 22, - "column": 18 - } - }, + "start":789,"end":799,"loc":{"start":{"line":22,"column":8},"end":{"line":22,"column":18}}, "params": [ { "type": "TypeParameter", - "start": 790, - "end": 798, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 17 - } - }, + "start":790,"end":798,"loc":{"start":{"line":22,"column":9},"end":{"line":22,"column":17}}, "name": "T", "variance": null, "default": { "type": "VoidTypeAnnotation", - "start": 794, - "end": 798, - "loc": { - "start": { - "line": 22, - "column": 13 - }, - "end": { - "line": 22, - "column": 17 - } - } + "start":794,"end":798,"loc":{"start":{"line":22,"column":13},"end":{"line":22,"column":17}} } } ] }, "right": { "type": "GenericTypeAnnotation", - "start": 802, - "end": 803, - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 22 - } - }, + "start":802,"end":803,"loc":{"start":{"line":22,"column":21},"end":{"line":22,"column":22}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 802, - "end": 803, - "loc": { - "start": { - "line": 22, - "column": 21 - }, - "end": { - "line": 22, - "column": 22 - }, - "identifierName": "T" - }, + "start":802,"end":803,"loc":{"start":{"line":22,"column":21},"end":{"line":22,"column":22},"identifierName":"T"}, "name": "T" } } }, { "type": "FunctionDeclaration", - "start": 804, - "end": 833, - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 23, - "column": 29 - } - }, + "start":804,"end":833,"loc":{"start":{"line":23,"column":0},"end":{"line":23,"column":29}}, "id": { "type": "Identifier", - "start": 813, - "end": 816, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 12 - }, - "identifierName": "A26" - }, + "start":813,"end":816,"loc":{"start":{"line":23,"column":9},"end":{"line":23,"column":12},"identifierName":"A26"}, "name": "A26" }, "generator": false, "async": false, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 816, - "end": 828, - "loc": { - "start": { - "line": 23, - "column": 12 - }, - "end": { - "line": 23, - "column": 24 - } - }, + "start":816,"end":828,"loc":{"start":{"line":23,"column":12},"end":{"line":23,"column":24}}, "params": [ { "type": "TypeParameter", - "start": 817, - "end": 827, - "loc": { - "start": { - "line": 23, - "column": 13 - }, - "end": { - "line": 23, - "column": 23 - } - }, + "start":817,"end":827,"loc":{"start":{"line":23,"column":13},"end":{"line":23,"column":23}}, "name": "T", "variance": null, "default": { "type": "StringTypeAnnotation", - "start": 821, - "end": 827, - "loc": { - "start": { - "line": 23, - "column": 17 - }, - "end": { - "line": 23, - "column": 23 - } - } + "start":821,"end":827,"loc":{"start":{"line":23,"column":17},"end":{"line":23,"column":23}} } } ] @@ -3425,96 +1086,29 @@ "params": [], "body": { "type": "BlockStatement", - "start": 831, - "end": 833, - "loc": { - "start": { - "line": 23, - "column": 27 - }, - "end": { - "line": 23, - "column": 29 - } - }, + "start":831,"end":833,"loc":{"start":{"line":23,"column":27},"end":{"line":23,"column":29}}, "body": [], "directives": [] } }, { "type": "EmptyStatement", - "start": 834, - "end": 835, - "loc": { - "start": { - "line": 24, - "column": 0 - }, - "end": { - "line": 24, - "column": 1 - } - } + "start":834,"end":835,"loc":{"start":{"line":24,"column":0},"end":{"line":24,"column":1}} }, { "type": "ExpressionStatement", - "start": 835, - "end": 862, - "loc": { - "start": { - "line": 24, - "column": 1 - }, - "end": { - "line": 24, - "column": 28 - } - }, + "start":835,"end":862,"loc":{"start":{"line":24,"column":1},"end":{"line":24,"column":28}}, "expression": { "type": "ObjectExpression", - "start": 836, - "end": 860, - "loc": { - "start": { - "line": 24, - "column": 2 - }, - "end": { - "line": 24, - "column": 26 - } - }, + "start":836,"end":860,"loc":{"start":{"line":24,"column":2},"end":{"line":24,"column":26}}, "properties": [ { "type": "ObjectMethod", - "start": 838, - "end": 858, - "loc": { - "start": { - "line": 24, - "column": 4 - }, - "end": { - "line": 24, - "column": 24 - } - }, + "start":838,"end":858,"loc":{"start":{"line":24,"column":4},"end":{"line":24,"column":24}}, "method": true, "key": { "type": "Identifier", - "start": 838, - "end": 841, - "loc": { - "start": { - "line": 24, - "column": 4 - }, - "end": { - "line": 24, - "column": 7 - }, - "identifierName": "A28" - }, + "start":838,"end":841,"loc":{"start":{"line":24,"column":4},"end":{"line":24,"column":7},"identifierName":"A28"}, "name": "A28" }, "computed": false, @@ -3525,66 +1119,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 856, - "end": 858, - "loc": { - "start": { - "line": 24, - "column": 22 - }, - "end": { - "line": 24, - "column": 24 - } - }, + "start":856,"end":858,"loc":{"start":{"line":24,"column":22},"end":{"line":24,"column":24}}, "body": [], "directives": [] }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 841, - "end": 853, - "loc": { - "start": { - "line": 24, - "column": 7 - }, - "end": { - "line": 24, - "column": 19 - } - }, + "start":841,"end":853,"loc":{"start":{"line":24,"column":7},"end":{"line":24,"column":19}}, "params": [ { "type": "TypeParameter", - "start": 842, - "end": 852, - "loc": { - "start": { - "line": 24, - "column": 8 - }, - "end": { - "line": 24, - "column": 18 - } - }, + "start":842,"end":852,"loc":{"start":{"line":24,"column":8},"end":{"line":24,"column":18}}, "name": "T", "variance": null, "default": { "type": "StringTypeAnnotation", - "start": 846, - "end": 852, - "loc": { - "start": { - "line": 24, - "column": 12 - }, - "end": { - "line": 24, - "column": 18 - } - } + "start":846,"end":852,"loc":{"start":{"line":24,"column":12},"end":{"line":24,"column":18}} } } ] @@ -3599,130 +1149,40 @@ }, { "type": "ClassDeclaration", - "start": 863, - "end": 899, - "loc": { - "start": { - "line": 25, - "column": 0 - }, - "end": { - "line": 27, - "column": 1 - } - }, + "start":863,"end":899,"loc":{"start":{"line":25,"column":0},"end":{"line":27,"column":1}}, "id": { "type": "Identifier", - "start": 869, - "end": 872, - "loc": { - "start": { - "line": 25, - "column": 6 - }, - "end": { - "line": 25, - "column": 9 - }, - "identifierName": "A29" - }, + "start":869,"end":872,"loc":{"start":{"line":25,"column":6},"end":{"line":25,"column":9},"identifierName":"A29"}, "name": "A29" }, "superClass": null, "body": { "type": "ClassBody", - "start": 873, - "end": 899, - "loc": { - "start": { - "line": 25, - "column": 10 - }, - "end": { - "line": 27, - "column": 1 - } - }, + "start":873,"end":899,"loc":{"start":{"line":25,"column":10},"end":{"line":27,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 877, - "end": 897, - "loc": { - "start": { - "line": 26, - "column": 2 - }, - "end": { - "line": 26, - "column": 22 - } - }, + "start":877,"end":897,"loc":{"start":{"line":26,"column":2},"end":{"line":26,"column":22}}, "static": false, "key": { "type": "Identifier", - "start": 877, - "end": 880, - "loc": { - "start": { - "line": 26, - "column": 2 - }, - "end": { - "line": 26, - "column": 5 - }, - "identifierName": "foo" - }, + "start":877,"end":880,"loc":{"start":{"line":26,"column":2},"end":{"line":26,"column":5},"identifierName":"foo"}, "name": "foo" }, "computed": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", - "start": 880, - "end": 892, - "loc": { - "start": { - "line": 26, - "column": 5 - }, - "end": { - "line": 26, - "column": 17 - } - }, + "start":880,"end":892,"loc":{"start":{"line":26,"column":5},"end":{"line":26,"column":17}}, "params": [ { "type": "TypeParameter", - "start": 881, - "end": 891, - "loc": { - "start": { - "line": 26, - "column": 6 - }, - "end": { - "line": 26, - "column": 16 - } - }, + "start":881,"end":891,"loc":{"start":{"line":26,"column":6},"end":{"line":26,"column":16}}, "name": "T", "variance": null, "default": { "type": "StringTypeAnnotation", - "start": 885, - "end": 891, - "loc": { - "start": { - "line": 26, - "column": 10 - }, - "end": { - "line": 26, - "column": 16 - } - } + "start":885,"end":891,"loc":{"start":{"line":26,"column":10},"end":{"line":26,"column":16}} } } ] @@ -3733,18 +1193,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 895, - "end": 897, - "loc": { - "start": { - "line": 26, - "column": 20 - }, - "end": { - "line": 26, - "column": 22 - } - }, + "start":895,"end":897,"loc":{"start":{"line":26,"column":20},"end":{"line":26,"column":22}}, "body": [], "directives": [] } @@ -3754,159 +1203,47 @@ }, { "type": "EmptyStatement", - "start": 900, - "end": 901, - "loc": { - "start": { - "line": 28, - "column": 0 - }, - "end": { - "line": 28, - "column": 1 - } - } + "start":900,"end":901,"loc":{"start":{"line":28,"column":0},"end":{"line":28,"column":1}} }, { "type": "ExpressionStatement", - "start": 901, - "end": 940, - "loc": { - "start": { - "line": 28, - "column": 1 - }, - "end": { - "line": 30, - "column": 3 - } - }, + "start":901,"end":940,"loc":{"start":{"line":28,"column":1},"end":{"line":30,"column":3}}, "expression": { "type": "ClassExpression", - "start": 902, - "end": 938, - "loc": { - "start": { - "line": 28, - "column": 2 - }, - "end": { - "line": 30, - "column": 1 - } - }, + "start":902,"end":938,"loc":{"start":{"line":28,"column":2},"end":{"line":30,"column":1}}, "id": { "type": "Identifier", - "start": 908, - "end": 911, - "loc": { - "start": { - "line": 28, - "column": 8 - }, - "end": { - "line": 28, - "column": 11 - }, - "identifierName": "A30" - }, + "start":908,"end":911,"loc":{"start":{"line":28,"column":8},"end":{"line":28,"column":11},"identifierName":"A30"}, "name": "A30" }, "superClass": null, "body": { "type": "ClassBody", - "start": 912, - "end": 938, - "loc": { - "start": { - "line": 28, - "column": 12 - }, - "end": { - "line": 30, - "column": 1 - } - }, + "start":912,"end":938,"loc":{"start":{"line":28,"column":12},"end":{"line":30,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 916, - "end": 936, - "loc": { - "start": { - "line": 29, - "column": 2 - }, - "end": { - "line": 29, - "column": 22 - } - }, + "start":916,"end":936,"loc":{"start":{"line":29,"column":2},"end":{"line":29,"column":22}}, "static": false, "key": { "type": "Identifier", - "start": 916, - "end": 919, - "loc": { - "start": { - "line": 29, - "column": 2 - }, - "end": { - "line": 29, - "column": 5 - }, - "identifierName": "foo" - }, + "start":916,"end":919,"loc":{"start":{"line":29,"column":2},"end":{"line":29,"column":5},"identifierName":"foo"}, "name": "foo" }, "computed": false, "kind": "method", "typeParameters": { "type": "TypeParameterDeclaration", - "start": 919, - "end": 931, - "loc": { - "start": { - "line": 29, - "column": 5 - }, - "end": { - "line": 29, - "column": 17 - } - }, + "start":919,"end":931,"loc":{"start":{"line":29,"column":5},"end":{"line":29,"column":17}}, "params": [ { "type": "TypeParameter", - "start": 920, - "end": 930, - "loc": { - "start": { - "line": 29, - "column": 6 - }, - "end": { - "line": 29, - "column": 16 - } - }, + "start":920,"end":930,"loc":{"start":{"line":29,"column":6},"end":{"line":29,"column":16}}, "name": "T", "variance": null, "default": { "type": "StringTypeAnnotation", - "start": 924, - "end": 930, - "loc": { - "start": { - "line": 29, - "column": 10 - }, - "end": { - "line": 29, - "column": 16 - } - } + "start":924,"end":930,"loc":{"start":{"line":29,"column":10},"end":{"line":29,"column":16}} } } ] @@ -3917,18 +1254,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 934, - "end": 936, - "loc": { - "start": { - "line": 29, - "column": 20 - }, - "end": { - "line": 29, - "column": 22 - } - }, + "start":934,"end":936,"loc":{"start":{"line":29,"column":20},"end":{"line":29,"column":22}}, "body": [], "directives": [] } @@ -3943,33 +1269,10 @@ }, { "type": "DeclareClass", - "start": 941, - "end": 986, - "loc": { - "start": { - "line": 31, - "column": 0 - }, - "end": { - "line": 31, - "column": 45 - } - }, + "start":941,"end":986,"loc":{"start":{"line":31,"column":0},"end":{"line":31,"column":45}}, "id": { "type": "Identifier", - "start": 955, - "end": 958, - "loc": { - "start": { - "line": 31, - "column": 14 - }, - "end": { - "line": 31, - "column": 17 - }, - "identifierName": "A31" - }, + "start":955,"end":958,"loc":{"start":{"line":31,"column":14},"end":{"line":31,"column":17},"identifierName":"A31"}, "name": "A31" }, "typeParameters": null, @@ -3978,49 +1281,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 959, - "end": 986, - "loc": { - "start": { - "line": 31, - "column": 18 - }, - "end": { - "line": 31, - "column": 45 - } - }, + "start":959,"end":986,"loc":{"start":{"line":31,"column":18},"end":{"line":31,"column":45}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 961, - "end": 984, - "loc": { - "start": { - "line": 31, - "column": 20 - }, - "end": { - "line": 31, - "column": 43 - } - }, + "start":961,"end":984,"loc":{"start":{"line":31,"column":20},"end":{"line":31,"column":43}}, "key": { "type": "Identifier", - "start": 961, - "end": 964, - "loc": { - "start": { - "line": 31, - "column": 20 - }, - "end": { - "line": 31, - "column": 23 - }, - "identifierName": "foo" - }, + "start":961,"end":964,"loc":{"start":{"line":31,"column":20},"end":{"line":31,"column":23},"identifierName":"foo"}, "name": "foo" }, "static": false, @@ -4029,83 +1298,28 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 961, - "end": 984, - "loc": { - "start": { - "line": 31, - "column": 20 - }, - "end": { - "line": 31, - "column": 43 - } - }, + "start":961,"end":984,"loc":{"start":{"line":31,"column":20},"end":{"line":31,"column":43}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 964, - "end": 976, - "loc": { - "start": { - "line": 31, - "column": 23 - }, - "end": { - "line": 31, - "column": 35 - } - }, + "start":964,"end":976,"loc":{"start":{"line":31,"column":23},"end":{"line":31,"column":35}}, "params": [ { "type": "TypeParameter", - "start": 965, - "end": 975, - "loc": { - "start": { - "line": 31, - "column": 24 - }, - "end": { - "line": 31, - "column": 34 - } - }, + "start":965,"end":975,"loc":{"start":{"line":31,"column":24},"end":{"line":31,"column":34}}, "name": "T", "variance": null, "default": { "type": "StringTypeAnnotation", - "start": 969, - "end": 975, - "loc": { - "start": { - "line": 31, - "column": 28 - }, - "end": { - "line": 31, - "column": 34 - } - } + "start":969,"end":975,"loc":{"start":{"line":31,"column":28},"end":{"line":31,"column":34}} } } ] }, "returnType": { "type": "VoidTypeAnnotation", - "start": 980, - "end": 984, - "loc": { - "start": { - "line": 31, - "column": 39 - }, - "end": { - "line": 31, - "column": 43 - } - } + "start":980,"end":984,"loc":{"start":{"line":31,"column":39},"end":{"line":31,"column":43}} } }, "optional": false @@ -4118,50 +1332,17 @@ }, { "type": "ExpressionStatement", - "start": 987, - "end": 1009, - "loc": { - "start": { - "line": 32, - "column": 0 - }, - "end": { - "line": 32, - "column": 22 - } - }, + "start":987,"end":1009,"loc":{"start":{"line":32,"column":0},"end":{"line":32,"column":22}}, "expression": { "type": "ArrowFunctionExpression", - "start": 987, - "end": 1008, - "loc": { - "start": { - "line": 32, - "column": 0 - }, - "end": { - "line": 32, - "column": 21 - } - }, + "start":987,"end":1008,"loc":{"start":{"line":32,"column":0},"end":{"line":32,"column":21}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "NumericLiteral", - "start": 1005, - "end": 1008, - "loc": { - "start": { - "line": 32, - "column": 18 - }, - "end": { - "line": 32, - "column": 21 - } - }, + "start":1005,"end":1008,"loc":{"start":{"line":32,"column":18},"end":{"line":32,"column":21}}, "extra": { "rawValue": 123, "raw": "123" @@ -4170,49 +1351,16 @@ }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 987, - "end": 999, - "loc": { - "start": { - "line": 32, - "column": 0 - }, - "end": { - "line": 32, - "column": 12 - } - }, + "start":987,"end":999,"loc":{"start":{"line":32,"column":0},"end":{"line":32,"column":12}}, "params": [ { "type": "TypeParameter", - "start": 988, - "end": 998, - "loc": { - "start": { - "line": 32, - "column": 1 - }, - "end": { - "line": 32, - "column": 11 - } - }, + "start":988,"end":998,"loc":{"start":{"line":32,"column":1},"end":{"line":32,"column":11}}, "name": "T", "variance": null, "default": { "type": "StringTypeAnnotation", - "start": 992, - "end": 998, - "loc": { - "start": { - "line": 32, - "column": 5 - }, - "end": { - "line": 32, - "column": 11 - } - } + "start":992,"end":998,"loc":{"start":{"line":32,"column":5},"end":{"line":32,"column":11}} } } ] diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/output.json index 773dc48b8c..fc8e1f196b 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/interface-reserved-word/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 95, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":0,"end":95,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 95, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":0,"end":95,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "InterfaceDeclaration", - "start": 0, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "X" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"X"}, "name": "X" }, "typeParameters": null, @@ -66,49 +21,15 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 12, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":12,"end":94,"loc":{"start":{"line":1,"column":12},"end":{"line":6,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 16, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":16,"end":33,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "key": { "type": "Identifier", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "foobar" - }, + "start":16,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8},"identifierName":"foobar"}, "name": "foobar" }, "static": false, @@ -117,49 +38,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 16, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":16,"end":33,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11}}, "params": [ { "type": "TypeParameter", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "name": "T", "variance": null } @@ -167,51 +55,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 19 - } - } + "start":29,"end":33,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":19}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 37, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":37,"end":54,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":19}}, "key": { "type": "Identifier", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "delete" - }, + "start":37,"end":43,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8},"identifierName":"delete"}, "name": "delete" }, "static": false, @@ -220,49 +74,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 37, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":37,"end":54,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":19}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":43,"end":46,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":11}}, "params": [ { "type": "TypeParameter", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":44,"end":45,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, "name": "T", "variance": null } @@ -270,51 +91,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 50, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 19 - } - } + "start":50,"end":54,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":19}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 58, - "end": 74, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":58,"end":74,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":18}}, "key": { "type": "Identifier", - "start": 58, - "end": 63, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "yield" - }, + "start":58,"end":63,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":7},"identifierName":"yield"}, "name": "yield" }, "static": false, @@ -323,49 +110,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 58, - "end": 74, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":58,"end":74,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":18}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 63, - "end": 66, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":63,"end":66,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":10}}, "params": [ { "type": "TypeParameter", - "start": 64, - "end": 65, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":64,"end":65,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":9}}, "name": "T", "variance": null } @@ -373,51 +127,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 70, - "end": 74, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 18 - } - } + "start":70,"end":74,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":18}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 78, - "end": 91, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":78,"end":91,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":15}}, "key": { "type": "Identifier", - "start": 78, - "end": 80, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 4 - }, - "identifierName": "do" - }, + "start":78,"end":80,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":4},"identifierName":"do"}, "name": "do" }, "static": false, @@ -426,49 +146,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 78, - "end": 91, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":78,"end":91,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":15}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 80, - "end": 83, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 7 - } - }, + "start":80,"end":83,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":7}}, "params": [ { "type": "TypeParameter", - "start": 81, - "end": 82, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 6 - } - }, + "start":81,"end":82,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":6}}, "name": "T", "variance": null } @@ -476,18 +163,7 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 87, - "end": 91, - "loc": { - "start": { - "line": 5, - "column": 11 - }, - "end": { - "line": 5, - "column": 15 - } - } + "start":87,"end":91,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":15}} } }, "optional": false @@ -500,18 +176,7 @@ }, { "type": "EmptyStatement", - "start": 94, - "end": 95, - "loc": { - "start": { - "line": 6, - "column": 1 - }, - "end": { - "line": 6, - "column": 2 - } - } + "start":94,"end":95,"loc":{"start":{"line":6,"column":1},"end":{"line":6,"column":2}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-method-type-param-jsx/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-method-type-param-jsx/output.json index 5e5de02ff3..a284774820 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-method-type-param-jsx/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-method-type-param-jsx/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":6,"end":42,"loc":{"start":{"line":1,"column":6},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "s" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"s"}, "name": "s" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":42,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 14, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":14,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":27}}, "method": true, "key": { "type": "Identifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "delete" - }, + "start":14,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8},"identifierName":"delete"}, "name": "delete" }, "computed": false, @@ -130,77 +40,21 @@ "params": [ { "type": "AssignmentPattern", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":24,"end":35,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":23}}, "left": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "d" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"d"}, "name": "d" }, "right": { "type": "JSXElement", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":28,"end":35,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":23}}, "openingElement": { "type": "JSXOpeningElement", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":28,"end":35,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":23}}, "name": { "type": "JSXIdentifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":29,"end":32,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":20}}, "name": "Foo" }, "attributes": [], @@ -213,50 +67,17 @@ ], "body": { "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":37,"end":39,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":27}}, "body": [], "directives": [] }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11}}, "params": [ { "type": "TypeParameter", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "name": "T", "variance": null } diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-reserved-word/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-reserved-word/output.json index bd86fd1738..f0b6c30860 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-reserved-word/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/object-reserved-word/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 81, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":0,"end":81,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 81, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":0,"end":81,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 81, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":0,"end":81,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 80, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":6,"end":80,"loc":{"start":{"line":1,"column":6},"end":{"line":6,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 80, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":10,"end":80,"loc":{"start":{"line":1,"column":10},"end":{"line":6,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 14, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":14,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "method": true, "key": { "type": "Identifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "foobar" - }, + "start":14,"end":20,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8},"identifierName":"foobar"}, "name": "foobar" }, "computed": false, @@ -130,50 +40,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":26,"end":28,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "body": [], "directives": [] }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11}}, "params": [ { "type": "TypeParameter", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "name": "T", "variance": null } @@ -182,34 +59,11 @@ }, { "type": "ObjectMethod", - "start": 32, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":32,"end":46,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":16}}, "method": true, "key": { "type": "Identifier", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "delete" - }, + "start":32,"end":38,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8},"identifierName":"delete"}, "name": "delete" }, "computed": false, @@ -220,50 +74,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":44,"end":46,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":16}}, "body": [], "directives": [] }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 38, - "end": 41, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":38,"end":41,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":11}}, "params": [ { "type": "TypeParameter", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":39,"end":40,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, "name": "T", "variance": null } @@ -272,34 +93,11 @@ }, { "type": "ObjectMethod", - "start": 50, - "end": 63, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":50,"end":63,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":15}}, "method": true, "key": { "type": "Identifier", - "start": 50, - "end": 55, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "yield" - }, + "start":50,"end":55,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":7},"identifierName":"yield"}, "name": "yield" }, "computed": false, @@ -310,50 +108,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 61, - "end": 63, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":61,"end":63,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":15}}, "body": [], "directives": [] }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 55, - "end": 58, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":55,"end":58,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":10}}, "params": [ { "type": "TypeParameter", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":56,"end":57,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":9}}, "name": "T", "variance": null } @@ -362,34 +127,11 @@ }, { "type": "ObjectMethod", - "start": 67, - "end": 77, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 12 - } - }, + "start":67,"end":77,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":12}}, "method": true, "key": { "type": "Identifier", - "start": 67, - "end": 69, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 4 - }, - "identifierName": "do" - }, + "start":67,"end":69,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":4},"identifierName":"do"}, "name": "do" }, "computed": false, @@ -400,50 +142,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 75, - "end": 77, - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 12 - } - }, + "start":75,"end":77,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":12}}, "body": [], "directives": [] }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 69, - "end": 72, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 7 - } - }, + "start":69,"end":72,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":7}}, "params": [ { "type": "TypeParameter", - "start": 70, - "end": 71, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 6 - } - }, + "start":70,"end":71,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":6}}, "name": "T", "variance": null } diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/output.json index a86c5b5aeb..3c1f8ac956 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/reserved-word-class-name-failure/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ "SyntaxError: Unexpected keyword 'delete' (1:14)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "DeclareClass", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "delete" - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20},"identifierName":"delete"}, "name": "delete" }, "typeParameters": null, @@ -69,18 +24,7 @@ "mixins": [], "body": { "type": "ObjectTypeAnnotation", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "callProperties": [], "properties": [], "indexers": [], diff --git a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/output.json b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/output.json index d817f6ed47..86e2ee528e 100644 --- a/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/output.json +++ b/packages/babel-parser/test/fixtures/flow/type-parameter-declaration/type-object-reserved-word/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 92, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":0,"end":92,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 92, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":0,"end":92,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 0, - "end": 92, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":0,"end":92,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":2}}, "id": { "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" }, "typeParameters": null, "right": { "type": "ObjectTypeAnnotation", - "start": 9, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":9,"end":91,"loc":{"start":{"line":1,"column":9},"end":{"line":6,"column":1}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 13, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":13,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "key": { "type": "Identifier", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "foobar" - }, + "start":13,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8},"identifierName":"foobar"}, "name": "foobar" }, "static": false, @@ -114,49 +35,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 13, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":13,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":19}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":22,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11}}, "params": [ { "type": "TypeParameter", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "name": "T", "variance": null } @@ -164,51 +52,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 26, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 19 - } - } + "start":26,"end":30,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":19}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 34, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":34,"end":51,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":19}}, "key": { "type": "Identifier", - "start": 34, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "delete" - }, + "start":34,"end":40,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":8},"identifierName":"delete"}, "name": "delete" }, "static": false, @@ -217,49 +71,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 34, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":34,"end":51,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":19}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":40,"end":43,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":11}}, "params": [ { "type": "TypeParameter", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":41,"end":42,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, "name": "T", "variance": null } @@ -267,51 +88,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 47, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 19 - } - } + "start":47,"end":51,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":19}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 55, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":55,"end":71,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":18}}, "key": { "type": "Identifier", - "start": 55, - "end": 60, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "yield" - }, + "start":55,"end":60,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":7},"identifierName":"yield"}, "name": "yield" }, "static": false, @@ -320,49 +107,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 55, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 18 - } - }, + "start":55,"end":71,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":18}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 60, - "end": 63, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":60,"end":63,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":10}}, "params": [ { "type": "TypeParameter", - "start": 61, - "end": 62, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":61,"end":62,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":9}}, "name": "T", "variance": null } @@ -370,51 +124,17 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 67, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 18 - } - } + "start":67,"end":71,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":18}} } }, "optional": false }, { "type": "ObjectTypeProperty", - "start": 75, - "end": 88, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":75,"end":88,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":15}}, "key": { "type": "Identifier", - "start": 75, - "end": 77, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 4 - }, - "identifierName": "do" - }, + "start":75,"end":77,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":4},"identifierName":"do"}, "name": "do" }, "static": false, @@ -423,49 +143,16 @@ "method": true, "value": { "type": "FunctionTypeAnnotation", - "start": 75, - "end": 88, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":75,"end":88,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":15}}, "params": [], "rest": null, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 77, - "end": 80, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 7 - } - }, + "start":77,"end":80,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":7}}, "params": [ { "type": "TypeParameter", - "start": 78, - "end": 79, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 6 - } - }, + "start":78,"end":79,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":6}}, "name": "T", "variance": null } @@ -473,18 +160,7 @@ }, "returnType": { "type": "VoidTypeAnnotation", - "start": 84, - "end": 88, - "loc": { - "start": { - "line": 5, - "column": 11 - }, - "end": { - "line": 5, - "column": 15 - } - } + "start":84,"end":88,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":15}} } }, "optional": false diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/async-call/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/async-call/output.json index 7df2d61ae2..c73062c2bf 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/async-call/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/async-call/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "program": { "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":9,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "expression": { "type": "CallExpression", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":9,"end":19,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "callee": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "async" - }, + "start":9,"end":14,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5},"identifierName":"async"}, "name": "async" }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "T" - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"T"}, "name": "T" } } @@ -130,18 +40,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -152,18 +51,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/async-generic-arrow/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/async-generic-arrow/output.json index e70ff3c275..339773cf69 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/async-generic-arrow/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/async-generic-arrow/output.json @@ -1,91 +1,25 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":20}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":20}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 9, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":9,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "expression": { "type": "ArrowFunctionExpression", - "start": 9, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":9,"end":26,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":9}}, "params": [ { "type": "TypeParameter", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "name": "T", "variance": null } @@ -97,18 +31,7 @@ "async": true, "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":17}}, "body": [], "directives": [] } @@ -117,78 +40,23 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] }, { "type": "ExpressionStatement", - "start": 28, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":28,"end":48,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":20}}, "expression": { "type": "ArrowFunctionExpression", - "start": 28, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":28,"end":48,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":20}}, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":34,"end":37,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":9}}, "params": [ { "type": "TypeParameter", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - } - }, + "start":35,"end":36,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8}}, "name": "T", "variance": null } @@ -198,48 +66,14 @@ "predicate": null, "returnType": { "type": "TypeAnnotation", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":39,"end":42,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":14}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":41,"end":42,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":14}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 14 - }, - "identifierName": "T" - }, + "start":41,"end":42,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":14},"identifierName":"T"}, "name": "T" } } @@ -249,18 +83,7 @@ "async": true, "body": { "type": "BlockStatement", - "start": 46, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":46,"end":48,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":20}}, "body": [], "directives": [] } @@ -273,18 +96,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/disabled-ambiguous-call/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/disabled-ambiguous-call/output.json index fc7f1bc6ce..c83517dcff 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/disabled-ambiguous-call/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/disabled-ambiguous-call/output.json @@ -1,128 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "BinaryExpression", - "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}}, "left": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "operator": "<", "right": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "T" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"T"}, "name": "T" } }, "operator": ">", "right": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "e" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"e"}, "name": "e", "extra": { "parenthesized": true, diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/disabled-ambiguous-new/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/disabled-ambiguous-new/output.json index 260f1c7309..b7e5a930e2 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/disabled-ambiguous-new/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/disabled-ambiguous-new/output.json @@ -1,105 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 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": "NewExpression", - "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}}, "callee": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "C" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"C"}, "name": "C" }, "typeArguments": null, @@ -108,38 +30,14 @@ "operator": "<", "right": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "T" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"T"}, "name": "T" } }, "operator": ">", "right": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "e" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"e"}, "name": "e", "extra": { "parenthesized": true, diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call-chain/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call-chain/output.json index a75a9589d3..f09c475b61 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call-chain/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call-chain/output.json @@ -1,138 +1,37 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":9,"end":23,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "expression": { "type": "CallExpression", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":9,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "callee": { "type": "CallExpression", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":9,"end":16,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":7}}, "callee": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"f"}, "name": "f" }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":10,"end":13,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":4}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "T" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"T"}, "name": "T" } } @@ -141,68 +40,22 @@ "arguments": [ { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"x"}, "name": "x" } ] }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":16,"end":19,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":10}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "U" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"U"}, "name": "U" } } @@ -211,19 +64,7 @@ "arguments": [ { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "y" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"y"}, "name": "y" } ] @@ -232,18 +73,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -254,18 +84,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call-optional/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call-optional/output.json index 1b67e740c1..14d0d4bfba 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call-optional/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call-optional/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":9,"end":19,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "expression": { "type": "OptionalCallExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":9,"end":18,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":9}}, "callee": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"f"}, "name": "f" }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":12,"end":15,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"T"}, "name": "T" } } @@ -127,19 +37,7 @@ "arguments": [ { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "e" - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"e"}, "name": "e" } ], @@ -149,18 +47,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -171,18 +58,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call/output.json index d5ac0faff3..3118e7c29c 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/function-call/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "program": { "type": "Program", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":9,"end":16,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":7}}, "expression": { "type": "CallExpression", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":9,"end":15,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "callee": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"f"}, "name": "f" }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":10,"end":13,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":4}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "T" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"T"}, "name": "T" } } @@ -130,18 +40,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -152,18 +51,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file 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 d2fb705046..acef855dde 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 @@ -1,157 +1,44 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":9,"end":19,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "expression": { "type": "CallExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":9,"end":18,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":9}}, "callee": { "type": "MemberExpression", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":9,"end":13,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":4}}, "object": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "o" - }, + "start":9,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"o"}, "name": "o" }, "property": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "e" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"e"}, "name": "e" }, "computed": true }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "T" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, "name": "T" } } @@ -163,18 +50,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -185,18 +61,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file 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 d8b08d1da8..9a2538975c 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 @@ -1,108 +1,29 @@ { "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "program": { "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":9,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "expression": { "type": "OptionalCallExpression", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":9,"end":19,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "callee": { "type": "OptionalMemberExpression", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":9,"end":13,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":4}}, "object": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "o" - }, + "start":9,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"o"}, "name": "o" }, "property": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "m" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"m"}, "name": "m" }, "computed": false, @@ -110,49 +31,15 @@ }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "T" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"T"}, "name": "T" } } @@ -161,19 +48,7 @@ "arguments": [ { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "e" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"e"}, "name": "e" } ], @@ -183,18 +58,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -205,18 +69,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file 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 0dc5c6af71..152e3df13b 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 @@ -1,157 +1,44 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":9,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "expression": { "type": "OptionalCallExpression", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":9,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "callee": { "type": "MemberExpression", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":9,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "object": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "o" - }, + "start":9,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"o"}, "name": "o" }, "property": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "m" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"m"}, "name": "m" }, "computed": false }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "T" - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"T"}, "name": "T" } } @@ -160,19 +47,7 @@ "arguments": [ { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "e" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"e"}, "name": "e" } ], @@ -182,18 +57,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -204,18 +68,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file 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 9be1647ab2..b4ee22f6fc 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 @@ -1,157 +1,44 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":9,"end":18,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":9}}, "expression": { "type": "CallExpression", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":9,"end":17,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}}, "callee": { "type": "MemberExpression", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":9,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "object": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "o" - }, + "start":9,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"o"}, "name": "o" }, "property": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "m" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"m"}, "name": "m" }, "computed": false }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":12,"end":15,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":6}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"T"}, "name": "T" } } @@ -163,18 +50,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -185,18 +61,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/new-noparens/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/new-noparens/output.json index 78b8589e63..6eefbdf4a3 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/new-noparens/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/new-noparens/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":9,"end":18,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":9}}, "expression": { "type": "NewExpression", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":9,"end":17,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}}, "callee": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "C" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"C"}, "name": "C" }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "T" - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"T"}, "name": "T" } } @@ -130,18 +40,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -152,18 +51,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/new/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/new/output.json index f98a88da1f..80f780346a 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/new/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/new/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "program": { "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":9,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "expression": { "type": "NewExpression", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":9,"end":19,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "callee": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "C" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"C"}, "name": "C" }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "T" - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"T"}, "name": "T" } } @@ -130,18 +40,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -152,18 +51,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/rollback-computed/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/rollback-computed/output.json index 131125e884..53499a9b33 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/rollback-computed/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/rollback-computed/output.json @@ -1,143 +1,41 @@ { "type": "File", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":9,"end":17,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}}, "expression": { "type": "BinaryExpression", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":9,"end":16,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":7}}, "left": { "type": "BinaryExpression", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":9,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "left": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"f"}, "name": "f" }, "operator": "<", "right": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "T" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"T"}, "name": "T" } }, "operator": ">", "right": { "type": "ArrayExpression", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}}, "elements": [ { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "e" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"e"}, "name": "e" } ] @@ -147,18 +45,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -169,18 +56,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/rollback-dot/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/rollback-dot/output.json index 5f129dfbd4..b451a68862 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/rollback-dot/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/rollback-dot/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "program": { "type": "Program", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":9,"end":16,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":7}}, "expression": { "type": "BinaryExpression", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":9,"end":15,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "left": { "type": "BinaryExpression", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":9,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "left": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"f"}, "name": "f" }, "operator": "<", "right": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "T" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"T"}, "name": "T" } }, "operator": ">", "right": { "type": "NumericLiteral", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":13,"end":15,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "extra": { "rawValue": 0, "raw": ".0" @@ -133,18 +43,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -155,18 +54,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/rollback-jsx/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/rollback-jsx/output.json index 463e2ffcb2..dad8a1a859 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/rollback-jsx/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/rollback-jsx/output.json @@ -1,188 +1,54 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":12}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":9,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "expression": { "type": "BinaryExpression", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":9,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "left": { "type": "BinaryExpression", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":9,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "left": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"f"}, "name": "f" }, "operator": "<", "right": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "T" - }, + "start":11,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"T"}, "name": "T" } }, "operator": ">", "right": { "type": "JSXElement", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":13,"end":20,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":11}}, "openingElement": { "type": "JSXOpeningElement", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, - "attributes": [], + "start":13,"end":16,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}}, "name": { "type": "JSXIdentifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6}}, "name": "U" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":16,"end":20,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":11}}, "name": { "type": "JSXIdentifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "name": "U" } }, @@ -193,18 +59,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } @@ -215,18 +70,7 @@ { "type": "CommentLine", "value": " @flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_allowed_trailing_commas/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_allowed_trailing_commas/output.json index e30f8a938f..05dc9ee1c8 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_allowed_trailing_commas/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_allowed_trailing_commas/output.json @@ -1,238 +1,68 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 4 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 4 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":4}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 8, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 8, - "column": 4 - } - }, + "start":8,"end":48,"loc":{"start":{"line":2,"column":0},"end":{"line":8,"column":4}}, "expression": { "type": "CallExpression", - "start": 8, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 8, - "column": 3 - } - }, + "start":8,"end":47,"loc":{"start":{"line":2,"column":0},"end":{"line":8,"column":3}}, "callee": { "type": "Identifier", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "test" - }, + "start":8,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":4},"identifierName":"test"}, "name": "test" }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 12, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":12,"end":45,"loc":{"start":{"line":2,"column":4},"end":{"line":8,"column":1}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":16,"end":17,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - }, - "identifierName": "_" - }, + "start":16,"end":17,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":3},"identifierName":"_"}, "name": "_" } }, { "type": "GenericTypeAnnotation", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":21,"end":22,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":3}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - }, - "identifierName": "_" - }, + "start":21,"end":22,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":3},"identifierName":"_"}, "name": "_" } }, { "type": "NumberTypeAnnotation", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 8 - } - } + "start":26,"end":32,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":8}} }, { "type": "GenericTypeAnnotation", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":36,"end":37,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":3}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - }, - "identifierName": "_" - }, + "start":36,"end":37,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":3},"identifierName":"_"}, "name": "_" } }, { "type": "GenericTypeAnnotation", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":41,"end":42,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":3}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 7, - "column": 2 - }, - "end": { - "line": 7, - "column": 3 - }, - "identifierName": "_" - }, + "start":41,"end":42,"loc":{"start":{"line":7,"column":2},"end":{"line":7,"column":3},"identifierName":"_"}, "name": "_" } } @@ -244,18 +74,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -266,18 +85,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file 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 297c8d1776..ebd1f2cd37 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 @@ -1,155 +1,43 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "errors": [ "SyntaxError: `_` is only allowed as a type argument to call or new (2:16)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 8, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":8,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 12, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":12,"end":29,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":21}}, "id": { "type": "Identifier", - "start": 12, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "x" - }, + "start":12,"end":25,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":17},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TypeAnnotation", - "start": 13, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":13,"end":25,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":17}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":15,"end":25,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":17}}, "typeParameters": { "type": "TypeParameterInstantiation", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "_" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16},"identifierName":"_"}, "name": "_" } } @@ -157,19 +45,7 @@ }, "id": { "type": "Identifier", - "start": 15, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "Generic" - }, + "start":15,"end":22,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":14},"identifierName":"Generic"}, "name": "Generic" } } @@ -177,18 +53,7 @@ }, "init": { "type": "NumericLiteral", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":21}}, "extra": { "rawValue": 3, "raw": "3" @@ -202,18 +67,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -224,18 +78,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file 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 53ac01f6fe..ab4466e152 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 @@ -1,100 +1,33 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "errors": [ "SyntaxError: Cannot overwrite reserved type _ (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 8, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":8,"end":24,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "_" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"_"}, "name": "_" }, "typeParameters": null, "right": { "type": "NumberTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - } + "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 - } - } + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}} } ] } @@ -105,18 +38,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file 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 e087eecbd2..a0f7c08fca 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 @@ -1,98 +1,31 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "errors": [ "SyntaxError: Unexpected reserved type _ (2:13)", "SyntaxError: `_` is only allowed as a type argument to call or new (2:19)" ], "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":20}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TypeAlias", - "start": 8, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":8,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":20}}, "id": { "type": "Identifier", - "start": 13, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "Generic" - }, + "start":13,"end":20,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":12},"identifierName":"Generic"}, "name": "Generic" }, "typeParameters": { "type": "TypeParameterDeclaration", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":15}}, "params": [ { "type": "TypeParameter", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14}}, "name": "_", "variance": null } @@ -100,34 +33,11 @@ }, "right": { "type": "GenericTypeAnnotation", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "_" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19},"identifierName":"_"}, "name": "_" } }, @@ -135,18 +45,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -157,18 +56,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_anywhere_in_list/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_anywhere_in_list/output.json index 7b90b530ad..5881b27004 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_anywhere_in_list/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_anywhere_in_list/output.json @@ -1,352 +1,102 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 50 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":50}}, "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 50 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":50}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 8, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 50 - } - }, + "start":8,"end":58,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":50}}, "expression": { "type": "CallExpression", - "start": 8, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 49 - } - }, + "start":8,"end":57,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":49}}, "callee": { "type": "Identifier", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "test" - }, + "start":8,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":4},"identifierName":"test"}, "name": "test" }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 12, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 47 - } - }, + "start":12,"end":55,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":47}}, "params": [ { "type": "NumberTypeAnnotation", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 11 - } - } + "start":13,"end":19,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":11}} }, { "type": "GenericTypeAnnotation", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "_" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"_"}, "name": "_" } }, { "type": "StringTypeAnnotation", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 22 - } - } + "start":24,"end":30,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":22}} }, { "type": "GenericTypeAnnotation", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":32,"end":33,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":25}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "_" - }, + "start":32,"end":33,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":25},"identifierName":"_"}, "name": "_" } }, { "type": "GenericTypeAnnotation", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":35,"end":36,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":28}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 28 - }, - "identifierName": "_" - }, + "start":35,"end":36,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":28},"identifierName":"_"}, "name": "_" } }, { "type": "GenericTypeAnnotation", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":38,"end":39,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":31}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 31 - }, - "identifierName": "_" - }, + "start":38,"end":39,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":31},"identifierName":"_"}, "name": "_" } }, { "type": "GenericTypeAnnotation", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 33 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":41,"end":44,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":36}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 33 - }, - "end": { - "line": 2, - "column": 36 - }, - "identifierName": "Foo" - }, + "start":41,"end":44,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":36},"identifierName":"Foo"}, "name": "Foo" } }, { "type": "GenericTypeAnnotation", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 2, - "column": 41 - } - }, + "start":46,"end":49,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":41}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 2, - "column": 41 - }, - "identifierName": "Bar" - }, + "start":46,"end":49,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":41},"identifierName":"Bar"}, "name": "Bar" } }, { "type": "GenericTypeAnnotation", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 43 - }, - "end": { - "line": 2, - "column": 46 - } - }, + "start":51,"end":54,"loc":{"start":{"line":2,"column":43},"end":{"line":2,"column":46}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 43 - }, - "end": { - "line": 2, - "column": 46 - }, - "identifierName": "Baz" - }, + "start":51,"end":54,"loc":{"start":{"line":2,"column":43},"end":{"line":2,"column":46},"identifierName":"Baz"}, "name": "Baz" } } @@ -358,18 +108,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -380,18 +119,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_in_calls/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_in_calls/output.json index 6d1aceded8..e35839347f 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_in_calls/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_in_calls/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":8,"end":18,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "expression": { "type": "CallExpression", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":8,"end":17,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":9}}, "callee": { "type": "Identifier", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "test" - }, + "start":8,"end":12,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":4},"identifierName":"test"}, "name": "test" }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":12,"end":15,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "_" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"_"}, "name": "_" } } @@ -130,18 +40,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -152,18 +51,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file 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 26c9a3ee40..5903b12085 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 @@ -1,122 +1,32 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 8, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":8,"end":31,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}}, "expression": { "type": "CallExpression", - "start": 8, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":8,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, "callee": { "type": "CallExpression", - "start": 8, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":8,"end":25,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "callee": { "type": "MemberExpression", - "start": 8, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":8,"end":23,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":15}}, "object": { "type": "Identifier", - "start": 8, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "instance" - }, + "start":8,"end":16,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8},"identifierName":"instance"}, "name": "instance" }, "property": { "type": "Identifier", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "method" - }, + "start":17,"end":23,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15},"identifierName":"method"}, "name": "method" }, "computed": false @@ -125,49 +35,15 @@ }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":25,"end":28,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":20}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "_" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19},"identifierName":"_"}, "name": "_" } } @@ -179,18 +55,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -201,18 +66,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_in_new/output.json b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_in_new/output.json index 6c48948afe..a1f8a77259 100644 --- a/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_in_new/output.json +++ b/packages/babel-parser/test/fixtures/flow/typeapp-call/underscore_is_implicit_in_new/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":8,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "expression": { "type": "NewExpression", - "start": 8, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":8,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "callee": { "type": "Identifier", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "test" - }, + "start":12,"end":16,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":8},"identifierName":"test"}, "name": "test" }, "typeArguments": { "type": "TypeParameterInstantiation", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":16,"end":19,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11}}, "params": [ { "type": "GenericTypeAnnotation", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "_" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"_"}, "name": "_" } } @@ -130,18 +40,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } @@ -152,18 +51,7 @@ { "type": "CommentLine", "value": "@flow", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/1/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/1/output.json index 95c6966cb5..041443eb98 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/1/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/1/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TypeCastExpression", - "start": 1, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, "expression": { "type": "Identifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "xxx" - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4},"identifierName":"xxx"}, "name": "xxx" }, "typeAnnotation": { "type": "TypeAnnotation", - "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}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - } + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}} } }, "extra": { diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/2/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/2/output.json index 4d9f9da74b..c8f7a5641e 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/2/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/2/output.json @@ -1,125 +1,36 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "expression": { "type": "TypeCastExpression", - "start": 1, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":1,"end":49,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":49}}, "expression": { "type": "ObjectExpression", - "start": 1, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":1,"end":21,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":21}}, "properties": [ { "type": "ObjectProperty", - "start": 2, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":2,"end":8,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":8}}, "method": false, "key": { "type": "Identifier", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "xxx" - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5},"identifierName":"xxx"}, "name": "xxx" }, "computed": false, "shorthand": false, "value": { "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": 0, "raw": "0" @@ -129,52 +40,18 @@ }, { "type": "ObjectProperty", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":10,"end":20,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "yyy" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"yyy"}, "name": "yyy" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "extra": { "rawValue": "hey", "raw": "\"hey\"" @@ -186,63 +63,18 @@ }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 21, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":21,"end":49,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":49}}, "typeAnnotation": { "type": "ObjectTypeAnnotation", - "start": 23, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":23,"end":49,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":49}}, "callProperties": [], "properties": [ { "type": "ObjectTypeProperty", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":24,"end":35,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":35}}, "key": { "type": "Identifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "xxx" - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27},"identifierName":"xxx"}, "name": "xxx" }, "static": false, @@ -251,51 +83,17 @@ "method": false, "value": { "type": "NumberTypeAnnotation", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":29,"end":35,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":35}} }, "variance": null, "optional": false }, { "type": "ObjectTypeProperty", - "start": 37, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":37,"end":48,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":48}}, "key": { "type": "Identifier", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "yyy" - }, + "start":37,"end":40,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":40},"identifierName":"yyy"}, "name": "yyy" }, "static": false, @@ -304,18 +102,7 @@ "method": false, "value": { "type": "StringTypeAnnotation", - "start": 42, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 48 - } - } + "start":42,"end":48,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":48}} }, "variance": null, "optional": false 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 fafc87e644..0e3ddeef54 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/3/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/3/output.json @@ -1,144 +1,43 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "expression": { "type": "TypeCastExpression", - "start": 1, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, "expression": { "type": "ArrowFunctionExpression", - "start": 1, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":1,"end":17,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":17}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "xxx" - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5},"identifierName":"xxx"}, "name": "xxx" } ], "body": { "type": "BinaryExpression", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "left": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "xxx" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"xxx"}, "name": "xxx" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 1, "raw": "1" @@ -149,97 +48,30 @@ }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 17, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":17,"end":42,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":42}}, "typeAnnotation": { "type": "FunctionTypeAnnotation", - "start": 19, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":19,"end":42,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":42}}, "params": [ { "type": "FunctionTypeParam", - "start": 20, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":20,"end":31,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":31}}, "name": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "xxx" - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23},"identifierName":"xxx"}, "name": "xxx" }, "optional": false, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":25,"end":31,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":31}} } } ], "rest": null, "returnType": { "type": "NumberTypeAnnotation", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } - } + "start":36,"end":42,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":42}} }, "typeParameters": null } diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/4/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/4/output.json index 99c2b77acb..09dd6a55f5 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/4/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/4/output.json @@ -1,122 +1,33 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expression": { "type": "SequenceExpression", - "start": 1, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":1,"end":29,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":29}}, "expressions": [ { "type": "TypeCastExpression", - "start": 2, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":2,"end":13,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":13}}, "expression": { "type": "Identifier", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "xxx" - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5},"identifierName":"xxx"}, "name": "xxx" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":5,"end":13,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":13}}, "typeAnnotation": { "type": "NumberTypeAnnotation", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}} } }, "extra": { @@ -126,63 +37,18 @@ }, { "type": "TypeCastExpression", - "start": 17, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":17,"end":28,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":28}}, "expression": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "yyy" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"yyy"}, "name": "yyy" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":22,"end":28,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":28}} } }, "extra": { diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/output.json index 098b44cec6..84a61889a5 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls-with-one-arg/output.json @@ -1,142 +1,41 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:10)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "callee": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "funccall" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"funccall"}, "name": "funccall" }, "arguments": [ { "type": "TypeCastExpression", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "expression": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "b" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"b"}, "name": "b" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":10,"end":18,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":18}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/output.json index 6b5b957074..c56ca182c2 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-calls/output.json @@ -1,159 +1,46 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "errors": [ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:13)" ], "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "callee": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "funccall" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"funccall"}, "name": "funccall" }, "arguments": [ { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a" }, { "type": "TypeCastExpression", - "start": 12, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":12,"end":21,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":21}}, "expression": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "b" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"b"}, "name": "b" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/output.json index 84fcef591c..5eb20e808d 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fail-in-optional-calls/output.json @@ -1,160 +1,47 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:15)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "OptionalCallExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "callee": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "funccall" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"funccall"}, "name": "funccall" }, "optional": true, "arguments": [ { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a" }, { "type": "TypeCastExpression", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}}, "expression": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "b" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"b"}, "name": "b" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} } } } 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 0e18e29a41..60c8b992e9 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 @@ -1,158 +1,45 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "SequenceExpression", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "expressions": [ { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "A" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"A"}, "name": "A" }, { "type": "TypeCastExpression", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "expression": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "B" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"B"}, "name": "B" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "typeAnnotation": { "type": "GenericTypeAnnotation", - "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}}, "typeParameters": null, "id": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "T" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/output.json index 8170ccf4c8..6fef5e5834 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-1/output.json @@ -1,125 +1,36 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "TypeCastExpression", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, "expression": { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 2, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":2,"end":10,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":10}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - } + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}} } } } 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 c5ba396b81..2dfd651b7a 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 @@ -1,125 +1,36 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:3)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrayExpression", - "start": 1, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, "elements": [ { "type": "TypeCastExpression", - "start": 2, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":2,"end":11,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":11}}, "expression": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 3, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":3,"end":11,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":11}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "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}} } } } 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 d8bfbe9b12..98c3f55f97 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 @@ -1,157 +1,45 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "errors": [ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:7)" ], "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "ArrayExpression", - "start": 1, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":1,"end":17,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":17}}, "elements": [ { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "a" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"a"}, "name": "a" }, { "type": "ArrayExpression", - "start": 5, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":5,"end":16,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":16}}, "elements": [ { "type": "TypeCastExpression", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "expression": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "b" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"b"}, "name": "b" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/output.json index 517f9d0437..06d2a6430d 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-4/output.json @@ -1,157 +1,45 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "callee": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "async" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"async"}, "name": "async" }, "arguments": [ { "type": "ArrayExpression", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "elements": [ { "type": "TypeCastExpression", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17}}, "expression": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"a"}, "name": "a" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/output.json index 5ae330ce23..9633347434 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/fails-in-array-expression-5/output.json @@ -1,189 +1,54 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "errors": [ "SyntaxError: The type cast expression is expected to be wrapped with parenthesis (1:13)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "callee": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "async" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"async"}, "name": "async" }, "arguments": [ { "type": "ArrayExpression", - "start": 7, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":7,"end":23,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":23}}, "elements": [ { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"a"}, "name": "a" }, { "type": "ArrayExpression", - "start": 11, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":11,"end":22,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":22}}, "elements": [ { "type": "TypeCastExpression", - "start": 12, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":12,"end":21,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":21}}, "expression": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "b" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"b"}, "name": "b" }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}} } } } diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/output.json index 0dc34605be..e01de114e5 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/works-in-array-pattern/output.json @@ -1,125 +1,36 @@ { "type": "File", - "start": 0, - "end": 327, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 14, - "column": 28 - } - }, + "start":0,"end":327,"loc":{"start":{"line":1,"column":0},"end":{"line":14,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 327, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 14, - "column": 28 - } - }, + "start":0,"end":327,"loc":{"start":{"line":1,"column":0},"end":{"line":14,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ArrayPattern", - "start": 1, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, "elements": [ { "type": "Identifier", - "start": 2, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "a" - }, + "start":2,"end":11,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":11},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 3, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":3,"end":11,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":11}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "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}} } } } @@ -128,18 +39,7 @@ ], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } @@ -147,127 +47,37 @@ }, { "type": "ExpressionStatement", - "start": 21, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":21,"end":46,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":25}}, "expression": { "type": "ArrowFunctionExpression", - "start": 21, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":21,"end":45,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":24}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ArrayPattern", - "start": 22, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":22,"end":38,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":17}}, "elements": [ { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "a" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"a"}, "name": "a" }, { "type": "ArrayPattern", - "start": 26, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":26,"end":37,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":16}}, "elements": [ { "type": "Identifier", - "start": 27, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "b" - }, + "start":27,"end":36,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":15},"identifierName":"b"}, "name": "b", "typeAnnotation": { "type": "TypeAnnotation", - "start": 28, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":28,"end":36,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":15}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":30,"end":36,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} } } } @@ -278,18 +88,7 @@ ], "body": { "type": "BlockStatement", - "start": 43, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":43,"end":45,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":24}}, "body": [], "directives": [] } @@ -297,109 +96,31 @@ }, { "type": "ExpressionStatement", - "start": 47, - "end": 72, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":47,"end":72,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":25}}, "expression": { "type": "ArrowFunctionExpression", - "start": 47, - "end": 71, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":47,"end":71,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":24}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 48, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":48,"end":64,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":17}}, "left": { "type": "ArrayPattern", - "start": 48, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":48,"end":59,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":12}}, "elements": [ { "type": "Identifier", - "start": 49, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "a" - }, + "start":49,"end":58,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":11},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 50, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":50,"end":58,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":11}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 52, - "end": 58, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 11 - } - } + "start":52,"end":58,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":11}} } } } @@ -407,36 +128,14 @@ }, "right": { "type": "ArrayExpression", - "start": 62, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":62,"end":64,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":17}}, "elements": [] } } ], "body": { "type": "BlockStatement", - "start": 69, - "end": 71, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":69,"end":71,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":24}}, "body": [], "directives": [] } @@ -444,144 +143,43 @@ }, { "type": "ExpressionStatement", - "start": 73, - "end": 100, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 27 - } - }, + "start":73,"end":100,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":27}}, "expression": { "type": "ArrowFunctionExpression", - "start": 73, - "end": 99, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 26 - } - }, + "start":73,"end":99,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":26}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 74, - "end": 92, - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 4, - "column": 19 - } - }, + "start":74,"end":92,"loc":{"start":{"line":4,"column":1},"end":{"line":4,"column":19}}, "properties": [ { "type": "ObjectProperty", - "start": 76, - "end": 90, - "loc": { - "start": { - "line": 4, - "column": 3 - }, - "end": { - "line": 4, - "column": 17 - } - }, + "start":76,"end":90,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":17}}, "method": false, "key": { "type": "Identifier", - "start": 76, - "end": 77, - "loc": { - "start": { - "line": 4, - "column": 3 - }, - "end": { - "line": 4, - "column": 4 - }, - "identifierName": "x" - }, + "start":76,"end":77,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":4},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 79, - "end": 90, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 17 - } - }, + "start":79,"end":90,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":17}}, "elements": [ { "type": "Identifier", - "start": 80, - "end": 89, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 16 - }, - "identifierName": "a" - }, + "start":80,"end":89,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":16},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 81, - "end": 89, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 16 - } - }, + "start":81,"end":89,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":16}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 83, - "end": 89, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 16 - } - } + "start":83,"end":89,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":16}} } } } @@ -593,18 +191,7 @@ ], "body": { "type": "BlockStatement", - "start": 97, - "end": 99, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 26 - } - }, + "start":97,"end":99,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":26}}, "body": [], "directives": [] } @@ -612,95 +199,28 @@ }, { "type": "ExpressionStatement", - "start": 102, - "end": 128, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 26 - } - }, + "start":102,"end":128,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":26}}, "expression": { "type": "ArrowFunctionExpression", - "start": 102, - "end": 127, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 25 - } - }, + "start":102,"end":127,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":25}}, "id": null, "generator": false, "async": true, "params": [ { "type": "ArrayPattern", - "start": 109, - "end": 120, - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":109,"end":120,"loc":{"start":{"line":6,"column":7},"end":{"line":6,"column":18}}, "elements": [ { "type": "Identifier", - "start": 110, - "end": 119, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 6, - "column": 17 - }, - "identifierName": "a" - }, + "start":110,"end":119,"loc":{"start":{"line":6,"column":8},"end":{"line":6,"column":17},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 111, - "end": 119, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 17 - } - }, + "start":111,"end":119,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":17}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 113, - "end": 119, - "loc": { - "start": { - "line": 6, - "column": 11 - }, - "end": { - "line": 6, - "column": 17 - } - } + "start":113,"end":119,"loc":{"start":{"line":6,"column":11},"end":{"line":6,"column":17}} } } } @@ -709,18 +229,7 @@ ], "body": { "type": "BlockStatement", - "start": 125, - "end": 127, - "loc": { - "start": { - "line": 6, - "column": 23 - }, - "end": { - "line": 6, - "column": 25 - } - }, + "start":125,"end":127,"loc":{"start":{"line":6,"column":23},"end":{"line":6,"column":25}}, "body": [], "directives": [] } @@ -728,127 +237,37 @@ }, { "type": "ExpressionStatement", - "start": 129, - "end": 160, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 31 - } - }, + "start":129,"end":160,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":31}}, "expression": { "type": "ArrowFunctionExpression", - "start": 129, - "end": 159, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 30 - } - }, + "start":129,"end":159,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":30}}, "id": null, "generator": false, "async": true, "params": [ { "type": "ArrayPattern", - "start": 136, - "end": 152, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 23 - } - }, + "start":136,"end":152,"loc":{"start":{"line":7,"column":7},"end":{"line":7,"column":23}}, "elements": [ { "type": "Identifier", - "start": 137, - "end": 138, - "loc": { - "start": { - "line": 7, - "column": 8 - }, - "end": { - "line": 7, - "column": 9 - }, - "identifierName": "a" - }, + "start":137,"end":138,"loc":{"start":{"line":7,"column":8},"end":{"line":7,"column":9},"identifierName":"a"}, "name": "a" }, { "type": "ArrayPattern", - "start": 140, - "end": 151, - "loc": { - "start": { - "line": 7, - "column": 11 - }, - "end": { - "line": 7, - "column": 22 - } - }, + "start":140,"end":151,"loc":{"start":{"line":7,"column":11},"end":{"line":7,"column":22}}, "elements": [ { "type": "Identifier", - "start": 141, - "end": 150, - "loc": { - "start": { - "line": 7, - "column": 12 - }, - "end": { - "line": 7, - "column": 21 - }, - "identifierName": "b" - }, + "start":141,"end":150,"loc":{"start":{"line":7,"column":12},"end":{"line":7,"column":21},"identifierName":"b"}, "name": "b", "typeAnnotation": { "type": "TypeAnnotation", - "start": 142, - "end": 150, - "loc": { - "start": { - "line": 7, - "column": 13 - }, - "end": { - "line": 7, - "column": 21 - } - }, + "start":142,"end":150,"loc":{"start":{"line":7,"column":13},"end":{"line":7,"column":21}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 144, - "end": 150, - "loc": { - "start": { - "line": 7, - "column": 15 - }, - "end": { - "line": 7, - "column": 21 - } - } + "start":144,"end":150,"loc":{"start":{"line":7,"column":15},"end":{"line":7,"column":21}} } } } @@ -859,18 +278,7 @@ ], "body": { "type": "BlockStatement", - "start": 157, - "end": 159, - "loc": { - "start": { - "line": 7, - "column": 28 - }, - "end": { - "line": 7, - "column": 30 - } - }, + "start":157,"end":159,"loc":{"start":{"line":7,"column":28},"end":{"line":7,"column":30}}, "body": [], "directives": [] } @@ -878,109 +286,31 @@ }, { "type": "ExpressionStatement", - "start": 161, - "end": 192, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 31 - } - }, + "start":161,"end":192,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":31}}, "expression": { "type": "ArrowFunctionExpression", - "start": 161, - "end": 191, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 30 - } - }, + "start":161,"end":191,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":30}}, "id": null, "generator": false, "async": true, "params": [ { "type": "AssignmentPattern", - "start": 168, - "end": 184, - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 23 - } - }, + "start":168,"end":184,"loc":{"start":{"line":8,"column":7},"end":{"line":8,"column":23}}, "left": { "type": "ArrayPattern", - "start": 168, - "end": 179, - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 18 - } - }, + "start":168,"end":179,"loc":{"start":{"line":8,"column":7},"end":{"line":8,"column":18}}, "elements": [ { "type": "Identifier", - "start": 169, - "end": 178, - "loc": { - "start": { - "line": 8, - "column": 8 - }, - "end": { - "line": 8, - "column": 17 - }, - "identifierName": "a" - }, + "start":169,"end":178,"loc":{"start":{"line":8,"column":8},"end":{"line":8,"column":17},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 170, - "end": 178, - "loc": { - "start": { - "line": 8, - "column": 9 - }, - "end": { - "line": 8, - "column": 17 - } - }, + "start":170,"end":178,"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":17}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 172, - "end": 178, - "loc": { - "start": { - "line": 8, - "column": 11 - }, - "end": { - "line": 8, - "column": 17 - } - } + "start":172,"end":178,"loc":{"start":{"line":8,"column":11},"end":{"line":8,"column":17}} } } } @@ -988,36 +318,14 @@ }, "right": { "type": "ArrayExpression", - "start": 182, - "end": 184, - "loc": { - "start": { - "line": 8, - "column": 21 - }, - "end": { - "line": 8, - "column": 23 - } - }, + "start":182,"end":184,"loc":{"start":{"line":8,"column":21},"end":{"line":8,"column":23}}, "elements": [] } } ], "body": { "type": "BlockStatement", - "start": 189, - "end": 191, - "loc": { - "start": { - "line": 8, - "column": 28 - }, - "end": { - "line": 8, - "column": 30 - } - }, + "start":189,"end":191,"loc":{"start":{"line":8,"column":28},"end":{"line":8,"column":30}}, "body": [], "directives": [] } @@ -1025,144 +333,43 @@ }, { "type": "ExpressionStatement", - "start": 193, - "end": 226, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 33 - } - }, + "start":193,"end":226,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":33}}, "expression": { "type": "ArrowFunctionExpression", - "start": 193, - "end": 225, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 32 - } - }, + "start":193,"end":225,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":32}}, "id": null, "generator": false, "async": true, "params": [ { "type": "ObjectPattern", - "start": 200, - "end": 218, - "loc": { - "start": { - "line": 9, - "column": 7 - }, - "end": { - "line": 9, - "column": 25 - } - }, + "start":200,"end":218,"loc":{"start":{"line":9,"column":7},"end":{"line":9,"column":25}}, "properties": [ { "type": "ObjectProperty", - "start": 202, - "end": 216, - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 9, - "column": 23 - } - }, + "start":202,"end":216,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":23}}, "method": false, "key": { "type": "Identifier", - "start": 202, - "end": 203, - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 9, - "column": 10 - }, - "identifierName": "x" - }, + "start":202,"end":203,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":10},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 205, - "end": 216, - "loc": { - "start": { - "line": 9, - "column": 12 - }, - "end": { - "line": 9, - "column": 23 - } - }, + "start":205,"end":216,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":23}}, "elements": [ { "type": "Identifier", - "start": 206, - "end": 215, - "loc": { - "start": { - "line": 9, - "column": 13 - }, - "end": { - "line": 9, - "column": 22 - }, - "identifierName": "a" - }, + "start":206,"end":215,"loc":{"start":{"line":9,"column":13},"end":{"line":9,"column":22},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TypeAnnotation", - "start": 207, - "end": 215, - "loc": { - "start": { - "line": 9, - "column": 14 - }, - "end": { - "line": 9, - "column": 22 - } - }, + "start":207,"end":215,"loc":{"start":{"line":9,"column":14},"end":{"line":9,"column":22}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 209, - "end": 215, - "loc": { - "start": { - "line": 9, - "column": 16 - }, - "end": { - "line": 9, - "column": 22 - } - } + "start":209,"end":215,"loc":{"start":{"line":9,"column":16},"end":{"line":9,"column":22}} } } } @@ -1174,18 +381,7 @@ ], "body": { "type": "BlockStatement", - "start": 223, - "end": 225, - "loc": { - "start": { - "line": 9, - "column": 30 - }, - "end": { - "line": 9, - "column": 32 - } - }, + "start":223,"end":225,"loc":{"start":{"line":9,"column":30},"end":{"line":9,"column":32}}, "body": [], "directives": [] } @@ -1193,92 +389,25 @@ }, { "type": "VariableDeclaration", - "start": 228, - "end": 249, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 21 - } - }, + "start":228,"end":249,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 232, - "end": 248, - "loc": { - "start": { - "line": 11, - "column": 4 - }, - "end": { - "line": 11, - "column": 20 - } - }, + "start":232,"end":248,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":20}}, "id": { "type": "ArrayPattern", - "start": 232, - "end": 244, - "loc": { - "start": { - "line": 11, - "column": 4 - }, - "end": { - "line": 11, - "column": 16 - } - }, + "start":232,"end":244,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":16}}, "elements": [ { "type": "Identifier", - "start": 233, - "end": 243, - "loc": { - "start": { - "line": 11, - "column": 5 - }, - "end": { - "line": 11, - "column": 15 - }, - "identifierName": "a1" - }, + "start":233,"end":243,"loc":{"start":{"line":11,"column":5},"end":{"line":11,"column":15},"identifierName":"a1"}, "name": "a1", "typeAnnotation": { "type": "TypeAnnotation", - "start": 235, - "end": 243, - "loc": { - "start": { - "line": 11, - "column": 7 - }, - "end": { - "line": 11, - "column": 15 - } - }, + "start":235,"end":243,"loc":{"start":{"line":11,"column":7},"end":{"line":11,"column":15}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 237, - "end": 243, - "loc": { - "start": { - "line": 11, - "column": 9 - }, - "end": { - "line": 11, - "column": 15 - } - } + "start":237,"end":243,"loc":{"start":{"line":11,"column":9},"end":{"line":11,"column":15}} } } } @@ -1286,19 +415,7 @@ }, "init": { "type": "Identifier", - "start": 247, - "end": 248, - "loc": { - "start": { - "line": 11, - "column": 19 - }, - "end": { - "line": 11, - "column": 20 - }, - "identifierName": "c" - }, + "start":247,"end":248,"loc":{"start":{"line":11,"column":19},"end":{"line":11,"column":20},"identifierName":"c"}, "name": "c" } } @@ -1307,124 +424,34 @@ }, { "type": "VariableDeclaration", - "start": 250, - "end": 276, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 26 - } - }, + "start":250,"end":276,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":26}}, "declarations": [ { "type": "VariableDeclarator", - "start": 254, - "end": 275, - "loc": { - "start": { - "line": 12, - "column": 4 - }, - "end": { - "line": 12, - "column": 25 - } - }, + "start":254,"end":275,"loc":{"start":{"line":12,"column":4},"end":{"line":12,"column":25}}, "id": { "type": "ArrayPattern", - "start": 254, - "end": 271, - "loc": { - "start": { - "line": 12, - "column": 4 - }, - "end": { - "line": 12, - "column": 21 - } - }, + "start":254,"end":271,"loc":{"start":{"line":12,"column":4},"end":{"line":12,"column":21}}, "elements": [ { "type": "Identifier", - "start": 255, - "end": 257, - "loc": { - "start": { - "line": 12, - "column": 5 - }, - "end": { - "line": 12, - "column": 7 - }, - "identifierName": "a2" - }, + "start":255,"end":257,"loc":{"start":{"line":12,"column":5},"end":{"line":12,"column":7},"identifierName":"a2"}, "name": "a2" }, { "type": "ArrayPattern", - "start": 259, - "end": 270, - "loc": { - "start": { - "line": 12, - "column": 9 - }, - "end": { - "line": 12, - "column": 20 - } - }, + "start":259,"end":270,"loc":{"start":{"line":12,"column":9},"end":{"line":12,"column":20}}, "elements": [ { "type": "Identifier", - "start": 260, - "end": 269, - "loc": { - "start": { - "line": 12, - "column": 10 - }, - "end": { - "line": 12, - "column": 19 - }, - "identifierName": "b" - }, + "start":260,"end":269,"loc":{"start":{"line":12,"column":10},"end":{"line":12,"column":19},"identifierName":"b"}, "name": "b", "typeAnnotation": { "type": "TypeAnnotation", - "start": 261, - "end": 269, - "loc": { - "start": { - "line": 12, - "column": 11 - }, - "end": { - "line": 12, - "column": 19 - } - }, + "start":261,"end":269,"loc":{"start":{"line":12,"column":11},"end":{"line":12,"column":19}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 263, - "end": 269, - "loc": { - "start": { - "line": 12, - "column": 13 - }, - "end": { - "line": 12, - "column": 19 - } - } + "start":263,"end":269,"loc":{"start":{"line":12,"column":13},"end":{"line":12,"column":19}} } } } @@ -1434,19 +461,7 @@ }, "init": { "type": "Identifier", - "start": 274, - "end": 275, - "loc": { - "start": { - "line": 12, - "column": 24 - }, - "end": { - "line": 12, - "column": 25 - }, - "identifierName": "c" - }, + "start":274,"end":275,"loc":{"start":{"line":12,"column":24},"end":{"line":12,"column":25},"identifierName":"c"}, "name": "c" } } @@ -1455,92 +470,25 @@ }, { "type": "VariableDeclaration", - "start": 277, - "end": 298, - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 13, - "column": 21 - } - }, + "start":277,"end":298,"loc":{"start":{"line":13,"column":0},"end":{"line":13,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 281, - "end": 297, - "loc": { - "start": { - "line": 13, - "column": 4 - }, - "end": { - "line": 13, - "column": 20 - } - }, + "start":281,"end":297,"loc":{"start":{"line":13,"column":4},"end":{"line":13,"column":20}}, "id": { "type": "ArrayPattern", - "start": 281, - "end": 293, - "loc": { - "start": { - "line": 13, - "column": 4 - }, - "end": { - "line": 13, - "column": 16 - } - }, + "start":281,"end":293,"loc":{"start":{"line":13,"column":4},"end":{"line":13,"column":16}}, "elements": [ { "type": "Identifier", - "start": 282, - "end": 292, - "loc": { - "start": { - "line": 13, - "column": 5 - }, - "end": { - "line": 13, - "column": 15 - }, - "identifierName": "a3" - }, + "start":282,"end":292,"loc":{"start":{"line":13,"column":5},"end":{"line":13,"column":15},"identifierName":"a3"}, "name": "a3", "typeAnnotation": { "type": "TypeAnnotation", - "start": 284, - "end": 292, - "loc": { - "start": { - "line": 13, - "column": 7 - }, - "end": { - "line": 13, - "column": 15 - } - }, + "start":284,"end":292,"loc":{"start":{"line":13,"column":7},"end":{"line":13,"column":15}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 286, - "end": 292, - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 15 - } - } + "start":286,"end":292,"loc":{"start":{"line":13,"column":9},"end":{"line":13,"column":15}} } } } @@ -1548,19 +496,7 @@ }, "init": { "type": "Identifier", - "start": 296, - "end": 297, - "loc": { - "start": { - "line": 13, - "column": 19 - }, - "end": { - "line": 13, - "column": 20 - }, - "identifierName": "c" - }, + "start":296,"end":297,"loc":{"start":{"line":13,"column":19},"end":{"line":13,"column":20},"identifierName":"c"}, "name": "c" } } @@ -1569,141 +505,40 @@ }, { "type": "VariableDeclaration", - "start": 299, - "end": 327, - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 28 - } - }, + "start":299,"end":327,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 303, - "end": 326, - "loc": { - "start": { - "line": 14, - "column": 4 - }, - "end": { - "line": 14, - "column": 27 - } - }, + "start":303,"end":326,"loc":{"start":{"line":14,"column":4},"end":{"line":14,"column":27}}, "id": { "type": "ObjectPattern", - "start": 303, - "end": 322, - "loc": { - "start": { - "line": 14, - "column": 4 - }, - "end": { - "line": 14, - "column": 23 - } - }, + "start":303,"end":322,"loc":{"start":{"line":14,"column":4},"end":{"line":14,"column":23}}, "properties": [ { "type": "ObjectProperty", - "start": 305, - "end": 320, - "loc": { - "start": { - "line": 14, - "column": 6 - }, - "end": { - "line": 14, - "column": 21 - } - }, + "start":305,"end":320,"loc":{"start":{"line":14,"column":6},"end":{"line":14,"column":21}}, "method": false, "key": { "type": "Identifier", - "start": 305, - "end": 306, - "loc": { - "start": { - "line": 14, - "column": 6 - }, - "end": { - "line": 14, - "column": 7 - }, - "identifierName": "x" - }, + "start":305,"end":306,"loc":{"start":{"line":14,"column":6},"end":{"line":14,"column":7},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 308, - "end": 320, - "loc": { - "start": { - "line": 14, - "column": 9 - }, - "end": { - "line": 14, - "column": 21 - } - }, + "start":308,"end":320,"loc":{"start":{"line":14,"column":9},"end":{"line":14,"column":21}}, "elements": [ { "type": "Identifier", - "start": 309, - "end": 319, - "loc": { - "start": { - "line": 14, - "column": 10 - }, - "end": { - "line": 14, - "column": 20 - }, - "identifierName": "a4" - }, + "start":309,"end":319,"loc":{"start":{"line":14,"column":10},"end":{"line":14,"column":20},"identifierName":"a4"}, "name": "a4", "typeAnnotation": { "type": "TypeAnnotation", - "start": 311, - "end": 319, - "loc": { - "start": { - "line": 14, - "column": 12 - }, - "end": { - "line": 14, - "column": 20 - } - }, + "start":311,"end":319,"loc":{"start":{"line":14,"column":12},"end":{"line":14,"column":20}}, "typeAnnotation": { "type": "StringTypeAnnotation", - "start": 313, - "end": 319, - "loc": { - "start": { - "line": 14, - "column": 14 - }, - "end": { - "line": 14, - "column": 20 - } - } + "start":313,"end":319,"loc":{"start":{"line":14,"column":14},"end":{"line":14,"column":20}} } } } @@ -1714,19 +549,7 @@ }, "init": { "type": "Identifier", - "start": 325, - "end": 326, - "loc": { - "start": { - "line": 14, - "column": 26 - }, - "end": { - "line": 14, - "column": 27 - }, - "identifierName": "c" - }, + "start":325,"end":326,"loc":{"start":{"line":14,"column":26},"end":{"line":14,"column":27},"identifierName":"c"}, "name": "c" } } diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/yield-extra-parentheses/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/yield-extra-parentheses/output.json index c8d784f85f..b9f585103d 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/yield-extra-parentheses/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/yield-extra-parentheses/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,126 +20,36 @@ "params": [ { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "z" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"z"}, "name": "z" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":17,"end":49,"loc":{"start":{"line":1,"column":17},"end":{"line":3,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 21, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":21,"end":47,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 27, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":27,"end":47,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":28}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "x" - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"x"}, "name": "x" }, "init": { "type": "TypeCastExpression", - "start": 32, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":32,"end":46,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":27}}, "expression": { "type": "YieldExpression", - "start": 33, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":33,"end":40,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":21}}, "delegate": false, "argument": { "type": "NumericLiteral", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":39,"end":40,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":21}}, "extra": { "rawValue": 3, "raw": "3" @@ -198,32 +63,10 @@ }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 41, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":41,"end":46,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":27}}, "typeAnnotation": { "type": "AnyTypeAnnotation", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 27 - } - } + "start":43,"end":46,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":27}} } }, "extra": { diff --git a/packages/babel-parser/test/fixtures/flow/typecasts/yield/output.json b/packages/babel-parser/test/fixtures/flow/typecasts/yield/output.json index 70c311fbfb..61afa7d3af 100644 --- a/packages/babel-parser/test/fixtures/flow/typecasts/yield/output.json +++ b/packages/babel-parser/test/fixtures/flow/typecasts/yield/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,126 +20,36 @@ "params": [ { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "z" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"z"}, "name": "z" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":17,"end":47,"loc":{"start":{"line":1,"column":17},"end":{"line":3,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 21, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":21,"end":45,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":26}}, "declarations": [ { "type": "VariableDeclarator", - "start": 27, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":27,"end":45,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":26}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "x" - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"x"}, "name": "x" }, "init": { "type": "TypeCastExpression", - "start": 32, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":32,"end":44,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":25}}, "expression": { "type": "YieldExpression", - "start": 32, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":32,"end":39,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":20}}, "delegate": false, "argument": { "type": "NumericLiteral", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":38,"end":39,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20}}, "extra": { "rawValue": 3, "raw": "3" @@ -194,32 +59,10 @@ }, "typeAnnotation": { "type": "TypeAnnotation", - "start": 39, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":39,"end":44,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":25}}, "typeAnnotation": { "type": "AnyTypeAnnotation", - "start": 41, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 25 - } - } + "start":41,"end":44,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":25}} } }, "extra": { diff --git a/packages/babel-parser/test/fixtures/jsx/basic/1/output.json b/packages/babel-parser/test/fixtures/jsx/basic/1/output.json index ee713f49d1..43465f2513 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/1/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/1/output.json @@ -1,93 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "attributes": [], + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "a" }, + "attributes": [], "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/jsx/basic/10/output.json b/packages/babel-parser/test/fixtures/jsx/basic/10/output.json index 7c95fc951c..0f575bce29 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/10/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/10/output.json @@ -1,171 +1,50 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, - "attributes": [], + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "a" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 28, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":28,"end":32,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":32}}, "name": { "type": "JSXIdentifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31}}, "name": "a" } }, "children": [ { "type": "JSXExpressionContainer", - "start": 3, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":3,"end":28,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":28}}, "expression": { "type": "JSXEmptyExpression", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}}, "innerComments": [ { "type": "CommentBlock", "value": " this is a comment ", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}} } ] } @@ -180,18 +59,7 @@ { "type": "CommentBlock", "value": " this is a comment ", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/jsx/basic/11/output.json b/packages/babel-parser/test/fixtures/jsx/basic/11/output.json index acaecedbd1..28166db395 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/11/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/11/output.json @@ -1,141 +1,42 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "JSXElement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "attributes": [], + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "name": { "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "name": "div" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}}, "name": { "type": "JSXIdentifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23}}, "name": "div" } }, "children": [ { "type": "JSXText", - "start": 5, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":5,"end":18,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":18}}, "extra": { "rawValue": "@test content", "raw": "@test content" diff --git a/packages/babel-parser/test/fixtures/jsx/basic/12/output.json b/packages/babel-parser/test/fixtures/jsx/basic/12/output.json index 5a1709007f..d7438ce991 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/12/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/12/output.json @@ -1,172 +1,51 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "attributes": [], + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "name": { "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "name": "div" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":35,"end":41,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":41}}, "name": { "type": "JSXIdentifier", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":37,"end":40,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":40}}, "name": "div" } }, "children": [ { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 5, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "attributes": [], + "start":5,"end":11,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":11}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "br" }, + "attributes": [], "selfClosing": true }, "closingElement": null, @@ -174,18 +53,7 @@ }, { "type": "JSXText", - "start": 11, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":11,"end":35,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":35}}, "extra": { "rawValue": "7x invalid-js-identifier", "raw": "7x invalid-js-identifier" diff --git a/packages/babel-parser/test/fixtures/jsx/basic/13/output.json b/packages/babel-parser/test/fixtures/jsx/basic/13/output.json index 7655bc7e04..0f199c3576 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/13/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/13/output.json @@ -1,152 +1,47 @@ { "type": "File", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "program": { "type": "Program", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "expression": { "type": "JSXElement", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, + "name": { + "type": "JSXIdentifier", + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, + "name": "LeftRight" }, "attributes": [ { "type": "JSXAttribute", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21}}, "name": { "type": "JSXIdentifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15}}, "name": "left" }, "value": { "type": "JSXElement", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "openingElement": { "type": "JSXOpeningElement", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, - "attributes": [], + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "name": { "type": "JSXIdentifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "name": "a" }, + "attributes": [], "selfClosing": true }, "closingElement": null, @@ -155,127 +50,39 @@ }, { "type": "JSXAttribute", - "start": 22, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":22,"end":54,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":54}}, "name": { "type": "JSXIdentifier", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27}}, "name": "right" }, "value": { "type": "JSXElement", - "start": 28, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":28,"end":54,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":54}}, "openingElement": { "type": "JSXOpeningElement", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - } - }, - "attributes": [], + "start":28,"end":31,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":31}}, "name": { "type": "JSXIdentifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30}}, "name": "b" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 50, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":50,"end":54,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":54}}, "name": { "type": "JSXIdentifier", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":52,"end":53,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":53}}, "name": "b" } }, "children": [ { "type": "JSXText", - "start": 31, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":31,"end":50,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":50}}, "extra": { "rawValue": "monkeys /> gorillas", "raw": "monkeys /> gorillas" @@ -286,22 +93,6 @@ } } ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "LeftRight" - }, "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/jsx/basic/14/output.json b/packages/babel-parser/test/fixtures/jsx/basic/14/output.json index 2426208753..2e27043980 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/14/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/14/output.json @@ -1,184 +1,52 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "attributes": [], + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "name": { "type": "JSXMemberExpression", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "object": { "type": "JSXIdentifier", - "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}}, "name": "a" }, "property": { "type": "JSXIdentifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4}}, "name": "b" } }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "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}}, "name": { "type": "JSXMemberExpression", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "object": { "type": "JSXIdentifier", - "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}}, "name": "a" }, "property": { "type": "JSXIdentifier", - "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}}, "name": "b" } } diff --git a/packages/babel-parser/test/fixtures/jsx/basic/15/output.json b/packages/babel-parser/test/fixtures/jsx/basic/15/output.json index 3ee9c36533..a4bd5cb857 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/15/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/15/output.json @@ -1,246 +1,70 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "attributes": [], + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7}}, "name": { "type": "JSXMemberExpression", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "object": { "type": "JSXMemberExpression", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "object": { "type": "JSXIdentifier", - "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}}, "name": "a" }, "property": { "type": "JSXIdentifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4}}, "name": "b" } }, "property": { "type": "JSXIdentifier", - "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}}, "name": "c" } }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "name": { "type": "JSXMemberExpression", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "object": { "type": "JSXMemberExpression", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "object": { "type": "JSXIdentifier", - "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}}, "name": "a" }, "property": { "type": "JSXIdentifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "name": "b" } }, "property": { "type": "JSXIdentifier", - "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}}, "name": "c" } } diff --git a/packages/babel-parser/test/fixtures/jsx/basic/16/output.json b/packages/babel-parser/test/fixtures/jsx/basic/16/output.json index 8ecae0406b..57c6e3c2b4 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/16/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/16/output.json @@ -1,107 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "BinaryExpression", - "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}}, "left": { "type": "JSXElement", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "openingElement": { "type": "JSXOpeningElement", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, - "attributes": [], + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "name": { "type": "JSXIdentifier", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}}, "name": "div" }, + "attributes": [], "selfClosing": true }, "closingElement": null, @@ -114,19 +37,7 @@ "operator": "<", "right": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/jsx/basic/17/output.json b/packages/babel-parser/test/fixtures/jsx/basic/17/output.json index e48fcd5753..b7ce5fff4a 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/17/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/17/output.json @@ -1,126 +1,37 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "JSXElement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, + "name": { + "type": "JSXIdentifier", + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, + "name": "div" }, "attributes": [ { "type": "JSXSpreadAttribute", - "start": 5, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":5,"end":15,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":15}}, "argument": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "props" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"props"}, "name": "props" } } ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "name": "div" - }, "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/jsx/basic/18/output.json b/packages/babel-parser/test/fixtures/jsx/basic/18/output.json index ebcfbfdc73..05753aae0a 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/18/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/18/output.json @@ -1,153 +1,47 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "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}}, + "name": { + "type": "JSXIdentifier", + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, + "name": "div" }, "attributes": [ { "type": "JSXSpreadAttribute", - "start": 5, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":5,"end":15,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":15}}, "argument": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "props" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"props"}, "name": "props" } }, { "type": "JSXAttribute", - "start": 16, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":16,"end":32,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":32}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "post" }, "value": { "type": "StringLiteral", - "start": 21, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":21,"end":32,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":32}}, "extra": { "rawValue": "attribute", "raw": "\"attribute\"" @@ -156,22 +50,6 @@ } } ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "name": "div" - }, "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/jsx/basic/19/output.json b/packages/babel-parser/test/fixtures/jsx/basic/19/output.json index 1af0c7849b..969618c868 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/19/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/19/output.json @@ -1,121 +1,38 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "expression": { "type": "JSXElement", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":53}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, + "name": { + "type": "JSXIdentifier", + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, + "name": "div" }, "attributes": [ { "type": "JSXAttribute", - "start": 5, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":5,"end":18,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":18}}, "name": { "type": "JSXIdentifier", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "name": "pre" }, "value": { "type": "StringLiteral", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "extra": { "rawValue": "leading", "raw": "\"leading\"" @@ -125,48 +42,15 @@ }, { "type": "JSXAttribute", - "start": 19, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":19,"end":35,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":35}}, "name": { "type": "JSXIdentifier", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":19,"end":23,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":23}}, "name": "pre2" }, "value": { "type": "StringLiteral", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":24,"end":35,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":35}}, "extra": { "rawValue": "attribute", "raw": "\"attribute\"" @@ -176,83 +60,22 @@ }, { "type": "JSXSpreadAttribute", - "start": 36, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":36,"end":46,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":46}}, "argument": { "type": "Identifier", - "start": 40, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "props" - }, + "start":40,"end":45,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":45},"identifierName":"props"}, "name": "props" } } ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "name": "div" - }, "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 47, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":47,"end":53,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":53}}, "name": { "type": "JSXIdentifier", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":49,"end":52,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":52}}, "name": "div" } }, diff --git a/packages/babel-parser/test/fixtures/jsx/basic/2/output.json b/packages/babel-parser/test/fixtures/jsx/basic/2/output.json index b07a503ba5..6f5c8aa7b9 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/2/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/2/output.json @@ -1,188 +1,56 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, + "name": { + "type": "JSXNamespacedName", + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, + "namespace": { + "type": "JSXIdentifier", + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2}}, + "name": "n" }, - "end": { - "line": 1, - "column": 11 + "name": { + "type": "JSXIdentifier", + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4}}, + "name": "a" } }, "attributes": [ { "type": "JSXAttribute", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "name": { "type": "JSXNamespacedName", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "namespace": { "type": "JSXIdentifier", - "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}}, "name": "n" }, "name": { "type": "JSXIdentifier", - "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}}, "name": "v" } }, "value": null } ], - "name": { - "type": "JSXNamespacedName", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "namespace": { - "type": "JSXIdentifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - }, - "name": "n" - }, - "name": { - "type": "JSXIdentifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "name": "a" - } - }, "selfClosing": true }, "closingElement": null, 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 a781728b23..c1de95224e 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/20/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/20/output.json @@ -1,200 +1,59 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "expression": { "type": "JSXElement", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, + "name": { + "type": "JSXIdentifier", + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2}}, + "name": "A" }, "attributes": [ { "type": "JSXAttribute", - "start": 3, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":3,"end":16,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":16}}, "name": { "type": "JSXIdentifier", - "start": 3, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":3,"end":5,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":5}}, "name": "aa" }, "value": { "type": "JSXExpressionContainer", - "start": 6, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":6,"end":16,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":16}}, "expression": { "type": "MemberExpression", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "object": { "type": "MemberExpression", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "object": { "type": "Identifier", - "start": 7, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "aa" - }, + "start":7,"end":9,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":9},"identifierName":"aa"}, "name": "aa" }, "property": { "type": "Identifier", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "bb" - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12},"identifierName":"bb"}, "name": "bb" }, "computed": false }, "property": { "type": "Identifier", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "cc" - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15},"identifierName":"cc"}, "name": "cc" }, "computed": false @@ -203,127 +62,36 @@ }, { "type": "JSXAttribute", - "start": 17, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":17,"end":30,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":30}}, "name": { "type": "JSXIdentifier", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "name": "bb" }, "value": { "type": "JSXExpressionContainer", - "start": 20, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":20,"end":30,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":30}}, "expression": { "type": "MemberExpression", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "object": { "type": "MemberExpression", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26}}, "object": { "type": "Identifier", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "bb" - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23},"identifierName":"bb"}, "name": "bb" }, "property": { "type": "Identifier", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "cc" - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26},"identifierName":"cc"}, "name": "cc" }, "computed": false }, "property": { "type": "Identifier", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "dd" - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29},"identifierName":"dd"}, "name": "dd" }, "computed": false @@ -331,195 +99,56 @@ } } ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - }, - "name": "A" - }, "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 48, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":48,"end":52,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":52}}, "name": { "type": "JSXIdentifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":50,"end":51,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":51}}, "name": "A" } }, "children": [ { "type": "JSXElement", - "start": 31, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":31,"end":48,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":48}}, "openingElement": { "type": "JSXOpeningElement", - "start": 31, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 36 - } - }, - "attributes": [], + "start":31,"end":36,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":36}}, "name": { "type": "JSXIdentifier", - "start": 32, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":32,"end":35,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":35}}, "name": "div" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 42, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":42,"end":48,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":48}}, "name": { "type": "JSXIdentifier", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":44,"end":47,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":47}}, "name": "div" } }, "children": [ { "type": "JSXExpressionContainer", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":36,"end":42,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":42}}, "expression": { "type": "MemberExpression", - "start": 37, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":37,"end":41,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":41}}, "object": { "type": "Identifier", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "aa" - }, + "start":37,"end":39,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":39},"identifierName":"aa"}, "name": "aa" }, "property": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "b" - }, + "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/21/output.json b/packages/babel-parser/test/fixtures/jsx/basic/21/output.json index c32f7d50f5..e50d64b1f5 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/21/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/21/output.json @@ -1,174 +1,52 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "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}}, + "name": { + "type": "JSXIdentifier", + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, + "name": "div" }, "attributes": [ { "type": "JSXSpreadAttribute", - "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}}, "argument": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "c" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"c"}, "name": "c" } } ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "name": "div" - }, "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":35,"end":41,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":41}}, "name": { "type": "JSXIdentifier", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":37,"end":40,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":40}}, "name": "div" } }, "children": [ { "type": "JSXText", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "extra": { "rawValue": " ", "raw": " " @@ -177,97 +55,28 @@ }, { "type": "JSXSpreadChild", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "expression": { "type": "Identifier", - "start": 17, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "children" - }, + "start":17,"end":25,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":25},"identifierName":"children"}, "name": "children" } }, { "type": "JSXExpressionContainer", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29}}, "expression": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "a" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"a"}, "name": "a" } }, { "type": "JSXSpreadChild", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":29,"end":35,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":35}}, "expression": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "b" - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"b"}, "name": "b" } } diff --git a/packages/babel-parser/test/fixtures/jsx/basic/3/output.json b/packages/babel-parser/test/fixtures/jsx/basic/3/output.json index cd5d3b3888..306715c7ea 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/3/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/3/output.json @@ -1,152 +1,47 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "expression": { "type": "JSXElement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "openingElement": { "type": "JSXOpeningElement", - "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}}, + "name": { + "type": "JSXIdentifier", + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2}}, + "name": "a" }, "attributes": [ { "type": "JSXAttribute", - "start": 3, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":3,"end":14,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":14}}, "name": { "type": "JSXNamespacedName", - "start": 3, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":3,"end":8,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":8}}, "namespace": { "type": "JSXIdentifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4}}, "name": "n" }, "name": { "type": "JSXIdentifier", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "name": "foo" } }, "value": { "type": "StringLiteral", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" @@ -155,70 +50,21 @@ } } ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - }, - "name": "a" - }, "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 36, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":36,"end":40,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":40}}, "name": { "type": "JSXIdentifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39}}, "name": "a" } }, "children": [ { "type": "JSXText", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": " ", "raw": " " @@ -227,50 +73,16 @@ }, { "type": "JSXExpressionContainer", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":16,"end":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23}}, "expression": { "type": "Identifier", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "value" - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22},"identifierName":"value"}, "name": "value" } }, { "type": "JSXText", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "extra": { "rawValue": " ", "raw": " " @@ -279,128 +91,40 @@ }, { "type": "JSXElement", - "start": 24, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":24,"end":36,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":36}}, "openingElement": { "type": "JSXOpeningElement", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - }, - "attributes": [], + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27}}, "name": { "type": "JSXIdentifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":25,"end":26,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":26}}, "name": "b" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":32,"end":36,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":36}}, "name": { "type": "JSXIdentifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35}}, "name": "b" } }, "children": [ { "type": "JSXElement", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32}}, "openingElement": { "type": "JSXOpeningElement", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - }, - "attributes": [], + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32}}, "name": { "type": "JSXIdentifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29}}, "name": "c" }, + "attributes": [], "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/jsx/basic/4/output.json b/packages/babel-parser/test/fixtures/jsx/basic/4/output.json index 417106c499..b6a7ec4bf1 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/4/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/4/output.json @@ -1,135 +1,41 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "expression": { "type": "JSXElement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, + "name": { + "type": "JSXIdentifier", + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2}}, + "name": "a" }, "attributes": [ { "type": "JSXAttribute", - "start": 3, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":3,"end":10,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":10}}, "name": { "type": "JSXIdentifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4}}, "name": "b" }, "value": { "type": "JSXExpressionContainer", - "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}}, "expression": { "type": "StringLiteral", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9}}, "extra": { "rawValue": " ", "raw": "\" \"" @@ -140,48 +46,15 @@ }, { "type": "JSXAttribute", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, "name": { "type": "JSXIdentifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "name": "c" }, "value": { "type": "StringLiteral", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16}}, "extra": { "rawValue": " ", "raw": "\" \"" @@ -191,48 +64,15 @@ }, { "type": "JSXAttribute", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":17,"end":26,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":26}}, "name": { "type": "JSXIdentifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "name": "d" }, "value": { "type": "StringLiteral", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}}, "extra": { "rawValue": "&", "raw": "\"&\"" @@ -242,48 +82,15 @@ }, { "type": "JSXAttribute", - "start": 27, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":27,"end":37,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":37}}, "name": { "type": "JSXIdentifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28}}, "name": "e" }, "value": { "type": "StringLiteral", - "start": 29, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":29,"end":37,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":37}}, "extra": { "rawValue": "&r;", "raw": "\"&r;\"" @@ -292,22 +99,6 @@ } } ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - }, - "name": "a" - }, "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/jsx/basic/5/output.json b/packages/babel-parser/test/fixtures/jsx/basic/5/output.json index 5fa0e0d0fc..5cf9215fec 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/5/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/5/output.json @@ -1,93 +1,27 @@ { "type": "File", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "expression": { "type": "JSXElement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, - "attributes": [], + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "a" }, + "attributes": [], "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/jsx/basic/6/output.json b/packages/babel-parser/test/fixtures/jsx/basic/6/output.json index d67b18f899..86f8bc59e3 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/6/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/6/output.json @@ -1,123 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "attributes": [], + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "name": { "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "name": "日本語" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "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}}, "name": { "type": "JSXIdentifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "name": "日本語" } }, diff --git a/packages/babel-parser/test/fixtures/jsx/basic/7/output.json b/packages/babel-parser/test/fixtures/jsx/basic/7/output.json index 152cea1d6c..075fd8fbaa 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/7/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/7/output.json @@ -1,121 +1,38 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":10}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":10}}, "expression": { "type": "JSXElement", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":10}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":23}}, + "name": { + "type": "JSXIdentifier", + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, + "name": "AbC-def" }, "attributes": [ { "type": "JSXAttribute", - "start": 11, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":11,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":22}}, "name": { "type": "JSXIdentifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":11,"end":15,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":6}}, "name": "test" }, "value": { "type": "StringLiteral", - "start": 16, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":16,"end":31,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":22}}, "extra": { "rawValue": "&&", "raw": "\"&&\"" @@ -124,70 +41,21 @@ } } ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, - "name": "AbC-def" - }, "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 41, - "end": 51, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":41,"end":51,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":10}}, "name": { "type": "JSXIdentifier", - "start": 43, - "end": 50, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 9 - } - }, + "start":43,"end":50,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":9}}, "name": "AbC-def" } }, "children": [ { "type": "JSXText", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 5, - "column": 0 - } - }, + "start":32,"end":41,"loc":{"start":{"line":2,"column":23},"end":{"line":5,"column":0}}, "extra": { "rawValue": "\nbar\nbaz\n", "raw": "\nbar\nbaz\n" diff --git a/packages/babel-parser/test/fixtures/jsx/basic/8/output.json b/packages/babel-parser/test/fixtures/jsx/basic/8/output.json index 2306ee643e..4a0689eac5 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/8/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/8/output.json @@ -1,197 +1,58 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "JSXElement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, + "name": { + "type": "JSXIdentifier", + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2}}, + "name": "a" }, "attributes": [ { "type": "JSXAttribute", - "start": 3, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":3,"end":24,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":24}}, "name": { "type": "JSXIdentifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4}}, "name": "b" }, "value": { "type": "JSXExpressionContainer", - "start": 5, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":5,"end":24,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":24}}, "expression": { "type": "ConditionalExpression", - "start": 6, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":6,"end":23,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":23}}, "test": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "consequent": { "type": "JSXElement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "openingElement": { "type": "JSXOpeningElement", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "attributes": [], + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "name": { "type": "JSXIdentifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "name": "c" }, + "attributes": [], "selfClosing": true }, "closingElement": null, @@ -199,49 +60,16 @@ }, "alternate": { "type": "JSXElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "openingElement": { "type": "JSXOpeningElement", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, - "attributes": [], + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "name": { "type": "JSXIdentifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "name": "d" }, + "attributes": [], "selfClosing": true }, "closingElement": null, @@ -251,22 +79,6 @@ } } ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - } - }, - "name": "a" - }, "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/jsx/basic/asi/output.json b/packages/babel-parser/test/fixtures/jsx/basic/asi/output.json index b7046c70fc..3546f044c8 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/asi/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/asi/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x" }, "generator": false, @@ -65,63 +20,18 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":13,"end":34,"loc":{"start":{"line":1,"column":13},"end":{"line":4,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":17,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7}}, "declarations": [ { "type": "VariableDeclarator", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"x"}, "name": "x" }, "init": null @@ -131,63 +41,19 @@ }, { "type": "ExpressionStatement", - "start": 25, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":25,"end":32,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "expression": { "type": "JSXElement", - "start": 25, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":25,"end":32,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "openingElement": { "type": "JSXOpeningElement", - "start": 25, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 9 - } - }, - "attributes": [], + "start":25,"end":32,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":9}}, "name": { "type": "JSXIdentifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":26,"end":29,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":6}}, "name": "div" }, + "attributes": [], "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/jsx/basic/empty-expression-container/output.json b/packages/babel-parser/test/fixtures/jsx/basic/empty-expression-container/output.json index da7d2b16d9..29e49e74ef 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/empty-expression-container/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/empty-expression-container/output.json @@ -1,155 +1,45 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, - "attributes": [], + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "a" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "a" } }, "children": [ { "type": "JSXExpressionContainer", - "start": 3, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":3,"end":5,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":5}}, "expression": { "type": "JSXEmptyExpression", - "start": 4, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 4 - } - } + "start":4,"end":4,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":4}} } } ] diff --git a/packages/babel-parser/test/fixtures/jsx/basic/entity/output.json b/packages/babel-parser/test/fixtures/jsx/basic/entity/output.json index e027610427..02bcd5df34 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/entity/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/entity/output.json @@ -1,141 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, - "attributes": [], + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "A" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "A" } }, "children": [ { "type": "JSXText", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12}}, "extra": { "rawValue": "💩", "raw": "💩" diff --git a/packages/babel-parser/test/fixtures/jsx/basic/fragment-1/output.json b/packages/babel-parser/test/fixtures/jsx/basic/fragment-1/output.json index fe57b763fa..7a6af65611 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/fragment-1/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/fragment-1/output.json @@ -1,91 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXFragment", - "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}}, "openingFragment": { "type": "JSXOpeningFragment", - "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}} }, "closingFragment": { "type": "JSXClosingFragment", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - } - } + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5}} }, "children": [] } diff --git a/packages/babel-parser/test/fixtures/jsx/basic/fragment-2/output.json b/packages/babel-parser/test/fixtures/jsx/basic/fragment-2/output.json index d3a3336597..b018b26610 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/fragment-2/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/fragment-2/output.json @@ -1,107 +1,30 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "JSXFragment", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "openingFragment": { "type": "JSXOpeningFragment", - "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}} }, "closingFragment": { "type": "JSXClosingFragment", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}} }, "children": [ { "type": "JSXText", - "start": 2, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":2,"end":19,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":19}}, "extra": { "rawValue": "Hi, I'm a string!", "raw": "Hi, I'm a string!" diff --git a/packages/babel-parser/test/fixtures/jsx/basic/fragment-3/output.json b/packages/babel-parser/test/fixtures/jsx/basic/fragment-3/output.json index a6202bce9c..217844f829 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/fragment-3/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/fragment-3/output.json @@ -1,107 +1,30 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":3}}, "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":3}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":3}}, "expression": { "type": "JSXFragment", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":3}}, "openingFragment": { "type": "JSXOpeningFragment", - "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}} }, "closingFragment": { "type": "JSXClosingFragment", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - } + "start":47,"end":50,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":3}} }, "children": [ { "type": "JSXText", - "start": 3, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":3,"end":6,"loc":{"start":{"line":1,"column":3},"end":{"line":2,"column":2}}, "extra": { "rawValue": "\n ", "raw": "\n " @@ -110,97 +33,31 @@ }, { "type": "JSXElement", - "start": 6, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":6,"end":29,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":9}}, "openingElement": { "type": "JSXOpeningElement", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - } - }, - "attributes": [], + "start":6,"end":12,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8}}, "name": { "type": "JSXIdentifier", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":7,"end":11,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":7}}, "name": "span" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 9 - } - }, + "start":22,"end":29,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":9}}, "name": { "type": "JSXIdentifier", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 8 - } - }, + "start":24,"end":28,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":8}}, "name": "span" } }, "children": [ { "type": "JSXText", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":12,"end":22,"loc":{"start":{"line":2,"column":8},"end":{"line":4,"column":2}}, "extra": { "rawValue": "\n hi\n ", "raw": "\n hi\n " @@ -211,18 +68,7 @@ }, { "type": "JSXText", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":29,"end":32,"loc":{"start":{"line":4,"column":9},"end":{"line":5,"column":2}}, "extra": { "rawValue": "\n ", "raw": "\n " @@ -231,97 +77,31 @@ }, { "type": "JSXElement", - "start": 32, - "end": 46, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 16 - } - }, + "start":32,"end":46,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":16}}, "openingElement": { "type": "JSXOpeningElement", - "start": 32, - "end": 37, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 7 - } - }, - "attributes": [], + "start":32,"end":37,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":7}}, "name": { "type": "JSXIdentifier", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 5, - "column": 3 - }, - "end": { - "line": 5, - "column": 6 - } - }, + "start":33,"end":36,"loc":{"start":{"line":5,"column":3},"end":{"line":5,"column":6}}, "name": "div" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 40, - "end": 46, - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 16 - } - }, + "start":40,"end":46,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":16}}, "name": { "type": "JSXIdentifier", - "start": 42, - "end": 45, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":42,"end":45,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":15}}, "name": "div" } }, "children": [ { "type": "JSXText", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":37,"end":40,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":10}}, "extra": { "rawValue": "bye", "raw": "bye" @@ -332,18 +112,7 @@ }, { "type": "JSXText", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 6, - "column": 0 - } - }, + "start":46,"end":47,"loc":{"start":{"line":5,"column":16},"end":{"line":6,"column":0}}, "extra": { "rawValue": "\n", "raw": "\n" diff --git a/packages/babel-parser/test/fixtures/jsx/basic/fragment-4/output.json b/packages/babel-parser/test/fixtures/jsx/basic/fragment-4/output.json index f590db4113..1b8ec9dd36 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/fragment-4/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/fragment-4/output.json @@ -1,107 +1,30 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":3}}, "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":3}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":3}}, "expression": { "type": "JSXFragment", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":3}}, "openingFragment": { "type": "JSXOpeningFragment", - "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}} }, "closingFragment": { "type": "JSXClosingFragment", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 3 - } - } + "start":46,"end":49,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":3}} }, "children": [ { "type": "JSXText", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":2,"column":2}}, "extra": { "rawValue": "\n ", "raw": "\n " @@ -110,63 +33,19 @@ }, { "type": "JSXFragment", - "start": 5, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 6, - "column": 5 - } - }, + "start":5,"end":45,"loc":{"start":{"line":2,"column":2},"end":{"line":6,"column":5}}, "openingFragment": { "type": "JSXOpeningFragment", - "start": 5, - "end": 7, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - } + "start":5,"end":7,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}} }, "closingFragment": { "type": "JSXClosingFragment", - "start": 42, - "end": 45, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 5 - } - } + "start":42,"end":45,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":5}} }, "children": [ { "type": "JSXText", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":7,"end":12,"loc":{"start":{"line":2,"column":4},"end":{"line":3,"column":4}}, "extra": { "rawValue": "\n ", "raw": "\n " @@ -175,63 +54,19 @@ }, { "type": "JSXFragment", - "start": 12, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 5, - "column": 7 - } - }, + "start":12,"end":39,"loc":{"start":{"line":3,"column":4},"end":{"line":5,"column":7}}, "openingFragment": { "type": "JSXOpeningFragment", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 6 - } - } + "start":12,"end":14,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":6}} }, "closingFragment": { "type": "JSXClosingFragment", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 7 - } - } + "start":36,"end":39,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":7}} }, "children": [ { "type": "JSXText", - "start": 14, - "end": 36, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 5, - "column": 4 - } - }, + "start":14,"end":36,"loc":{"start":{"line":3,"column":6},"end":{"line":5,"column":4}}, "extra": { "rawValue": "\n super deep\n ", "raw": "\n super deep\n " @@ -242,18 +77,7 @@ }, { "type": "JSXText", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":39,"end":42,"loc":{"start":{"line":5,"column":7},"end":{"line":6,"column":2}}, "extra": { "rawValue": "\n ", "raw": "\n " @@ -264,18 +88,7 @@ }, { "type": "JSXText", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 7, - "column": 0 - } - }, + "start":45,"end":46,"loc":{"start":{"line":6,"column":5},"end":{"line":7,"column":0}}, "extra": { "rawValue": "\n", "raw": "\n" diff --git a/packages/babel-parser/test/fixtures/jsx/basic/fragment-5/output.json b/packages/babel-parser/test/fixtures/jsx/basic/fragment-5/output.json index c1d60cb1be..161d3dcb81 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/fragment-5/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/fragment-5/output.json @@ -1,141 +1,42 @@ { "type": "File", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":3}}, "program": { "type": "Program", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":3}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":3}}, "expression": { "type": "JSXFragment", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":3}}, "openingFragment": { "type": "JSXOpeningFragment", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "innerComments": [ { "type": "CommentLine", "value": " comment1", - "start": 2, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - } + "start":2,"end":13,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}} }, { "type": "CommentBlock", "value": " comment2 ", - "start": 14, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - } + "start":14,"end":28,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":14}} } ] }, "closingFragment": { "type": "JSXClosingFragment", - "start": 59, - "end": 62, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 3 - } - } + "start":59,"end":62,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":3}} }, "children": [ { "type": "JSXText", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":30,"end":33,"loc":{"start":{"line":4,"column":1},"end":{"line":5,"column":2}}, "extra": { "rawValue": "\n ", "raw": "\n " @@ -144,79 +45,24 @@ }, { "type": "JSXElement", - "start": 33, - "end": 44, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":33,"end":44,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":13}}, "openingElement": { "type": "JSXOpeningElement", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 7 - } - }, - "attributes": [], + "start":33,"end":38,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":7}}, "name": { "type": "JSXIdentifier", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 5, - "column": 3 - }, - "end": { - "line": 5, - "column": 6 - } - }, + "start":34,"end":37,"loc":{"start":{"line":5,"column":3},"end":{"line":5,"column":6}}, "name": "div" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 38, - "end": 44, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":38,"end":44,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":13}}, "name": { "type": "JSXIdentifier", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 12 - } - }, + "start":40,"end":43,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":12}}, "name": "div" } }, @@ -224,18 +70,7 @@ }, { "type": "JSXText", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":44,"end":47,"loc":{"start":{"line":5,"column":13},"end":{"line":6,"column":2}}, "extra": { "rawValue": "\n ", "raw": "\n " @@ -244,79 +79,24 @@ }, { "type": "JSXElement", - "start": 47, - "end": 58, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 13 - } - }, + "start":47,"end":58,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":13}}, "openingElement": { "type": "JSXOpeningElement", - "start": 47, - "end": 52, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 7 - } - }, - "attributes": [], + "start":47,"end":52,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":7}}, "name": { "type": "JSXIdentifier", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 6, - "column": 3 - }, - "end": { - "line": 6, - "column": 6 - } - }, + "start":48,"end":51,"loc":{"start":{"line":6,"column":3},"end":{"line":6,"column":6}}, "name": "div" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 52, - "end": 58, - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 13 - } - }, + "start":52,"end":58,"loc":{"start":{"line":6,"column":7},"end":{"line":6,"column":13}}, "name": { "type": "JSXIdentifier", - "start": 54, - "end": 57, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 12 - } - }, + "start":54,"end":57,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":12}}, "name": "div" } }, @@ -324,18 +104,7 @@ }, { "type": "JSXText", - "start": 58, - "end": 59, - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 7, - "column": 0 - } - }, + "start":58,"end":59,"loc":{"start":{"line":6,"column":13},"end":{"line":7,"column":0}}, "extra": { "rawValue": "\n", "raw": "\n" @@ -352,34 +121,12 @@ { "type": "CommentLine", "value": " comment1", - "start": 2, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - } + "start":2,"end":13,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}} }, { "type": "CommentBlock", "value": " comment2 ", - "start": 14, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - } + "start":14,"end":28,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":14}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/jsx/basic/fragment-6/output.json b/packages/babel-parser/test/fixtures/jsx/basic/fragment-6/output.json index c5a33e2bb6..00c80d5af7 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/fragment-6/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/fragment-6/output.json @@ -1,186 +1,54 @@ { "type": "File", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "program": { "type": "Program", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "expression": { "type": "JSXFragment", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":59}}, "openingFragment": { "type": "JSXOpeningFragment", - "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}} }, "closingFragment": { "type": "JSXClosingFragment", - "start": 56, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 56 - }, - "end": { - "line": 1, - "column": 59 - } - } + "start":56,"end":59,"loc":{"start":{"line":1,"column":56},"end":{"line":1,"column":59}} }, "children": [ { "type": "JSXElement", - "start": 2, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":2,"end":23,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":23}}, "openingElement": { "type": "JSXOpeningElement", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, - "attributes": [], + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "name": { "type": "JSXIdentifier", - "start": 3, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":3,"end":6,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":6}}, "name": "div" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}}, "name": { "type": "JSXIdentifier", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, "name": "div" } }, "children": [ { "type": "JSXText", - "start": 7, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":7,"end":17,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":17}}, "extra": { "rawValue": "JSXElement", "raw": "JSXElement" @@ -191,18 +59,7 @@ }, { "type": "JSXText", - "start": 23, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":23,"end":30,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":30}}, "extra": { "rawValue": "JSXText", "raw": "JSXText" @@ -211,32 +68,10 @@ }, { "type": "JSXExpressionContainer", - "start": 30, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":30,"end":56,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":56}}, "expression": { "type": "StringLiteral", - "start": 31, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":31,"end":55,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":55}}, "extra": { "rawValue": "JSXExpressionContainer", "raw": "'JSXExpressionContainer'" diff --git a/packages/babel-parser/test/fixtures/jsx/basic/keyword-tag/output.json b/packages/babel-parser/test/fixtures/jsx/basic/keyword-tag/output.json index b5eae7fc06..e8b60debcc 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/keyword-tag/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/keyword-tag/output.json @@ -1,123 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "attributes": [], + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "name": { "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "name": "var" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "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}}, "name": { "type": "JSXIdentifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "name": "var" } }, diff --git a/packages/babel-parser/test/fixtures/jsx/basic/namespace-tag/output.json b/packages/babel-parser/test/fixtures/jsx/basic/namespace-tag/output.json index be21c68891..4ab9e3b82d 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/namespace-tag/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/namespace-tag/output.json @@ -1,124 +1,36 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - } - }, - "attributes": [], + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11}}, "name": { "type": "JSXNamespacedName", - "start": 1, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":1,"end":8,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":8}}, "namespace": { "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "name": "Foo" }, "name": { "type": "JSXIdentifier", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "name": "Bar" } }, + "attributes": [], "selfClosing": true }, "closingElement": null, @@ -127,154 +39,44 @@ }, { "type": "ExpressionStatement", - "start": 13, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":13,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "expression": { "type": "JSXElement", - "start": 13, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":13,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "openingElement": { "type": "JSXOpeningElement", - "start": 13, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, - "attributes": [], + "start":13,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":9}}, "name": { "type": "JSXNamespacedName", - "start": 14, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":14,"end":21,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":8}}, "namespace": { "type": "JSXIdentifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":4}}, "name": "Foo" }, "name": { "type": "JSXIdentifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":18,"end":21,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8}}, "name": "Bar" } }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 22, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":22,"end":32,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":19}}, "name": { "type": "JSXNamespacedName", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":24,"end":31,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":18}}, "namespace": { "type": "JSXIdentifier", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":24,"end":27,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14}}, "name": "Foo" }, "name": { "type": "JSXIdentifier", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":28,"end":31,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, "name": "Bar" } } diff --git a/packages/babel-parser/test/fixtures/jsx/basic/nonentity-decimal/output.json b/packages/babel-parser/test/fixtures/jsx/basic/nonentity-decimal/output.json index b759f48d26..6776368925 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/nonentity-decimal/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/nonentity-decimal/output.json @@ -1,141 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, - "attributes": [], + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "A" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "A" } }, "children": [ { "type": "JSXText", - "start": 3, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":3,"end":11,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":11}}, "extra": { "rawValue": "f4a9;", "raw": "f4a9;" diff --git a/packages/babel-parser/test/fixtures/jsx/basic/nonentity/output.json b/packages/babel-parser/test/fixtures/jsx/basic/nonentity/output.json index fc694e099d..bf5d832829 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/nonentity/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/nonentity/output.json @@ -1,141 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, - "attributes": [], + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "A" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 12, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":12,"end":16,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":16}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "A" } }, "children": [ { "type": "JSXText", - "start": 3, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":3,"end":12,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":12}}, "extra": { "rawValue": "g4q9;", "raw": "g4q9;" diff --git a/packages/babel-parser/test/fixtures/jsx/basic/yield-tag/output.json b/packages/babel-parser/test/fixtures/jsx/basic/yield-tag/output.json index 4b7a168fcb..02bc04d35a 100644 --- a/packages/babel-parser/test/fixtures/jsx/basic/yield-tag/output.json +++ b/packages/babel-parser/test/fixtures/jsx/basic/yield-tag/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "it" - }, + "start":9,"end":11,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":11},"identifierName":"it"}, "name": "it" }, "generator": true, @@ -65,123 +20,35 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":13,"end":35,"loc":{"start":{"line":1,"column":13},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 19, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":19,"end":33,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":18}}, "expression": { "type": "YieldExpression", - "start": 19, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":19,"end":32,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":17}}, "delegate": false, "argument": { "type": "JSXElement", - "start": 25, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":25,"end":32,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":17}}, "openingElement": { "type": "JSXOpeningElement", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - } - }, - "attributes": [], + "start":25,"end":28,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13}}, "name": { "type": "JSXIdentifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12}}, "name": "a" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 28, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":28,"end":32,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":17}}, "name": { "type": "JSXIdentifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":30,"end":31,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16}}, "name": "a" } }, diff --git a/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/output.json b/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/output.json index a58504569c..404503d865 100644 --- a/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/output.json +++ b/packages/babel-parser/test/fixtures/jsx/errors/attribute-empty-expression/output.json @@ -1,154 +1,44 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: JSX attributes must only be assigned a non-empty expression (1:9)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "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}}, "name": { "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "name": "foo" }, "attributes": [ { "type": "JSXAttribute", - "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}}, "name": { "type": "JSXIdentifier", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "name": "bar" }, "value": { "type": "JSXExpressionContainer", - "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}}, "expression": { "type": "JSXEmptyExpression", - "start": 10, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 10 - } - } + "start":10,"end":10,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":10}} } } } diff --git a/packages/babel-parser/test/fixtures/jsx/errors/html-comment/output.json b/packages/babel-parser/test/fixtures/jsx/errors/html-comment/output.json index cf95c18b54..a47ee63bb9 100644 --- a/packages/babel-parser/test/fixtures/jsx/errors/html-comment/output.json +++ b/packages/babel-parser/test/fixtures/jsx/errors/html-comment/output.json @@ -1,31 +1,9 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [], @@ -34,18 +12,7 @@ { "type": "CommentLine", "value": "a", - "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}} } ] }, @@ -53,18 +20,7 @@ { "type": "CommentLine", "value": "a", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/output.json b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/output.json index 8a88583570..d70e7d0fc1 100644 --- a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/output.json +++ b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag-fragment/output.json @@ -1,108 +1,31 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected corresponding JSX closing tag for <> (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXFragment", - "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}}, "openingFragment": { "type": "JSXOpeningFragment", - "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}} }, "closingFragment": { "type": "JSXClosingElement", - "start": 2, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":2,"end":14,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":14}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "something" } }, diff --git a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/output.json b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/output.json index 29ab569654..54ddb9bae0 100644 --- a/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/output.json +++ b/packages/babel-parser/test/fixtures/jsx/errors/wrong-closing-tag/output.json @@ -1,93 +1,27 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected corresponding JSX closing tag for (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "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}}, "name": { "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "name": "Foo" }, "attributes": [], @@ -95,32 +29,10 @@ }, "closingElement": { "type": "JSXClosingElement", - "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}}, "name": { "type": "JSXIdentifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "name": "Bar" } }, diff --git a/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/output.json b/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/output.json index 63350c9eb5..a5d5ef8d53 100644 --- a/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/output.json +++ b/packages/babel-parser/test/fixtures/jsx/errors/wrong-opening-tag-fragment/output.json @@ -1,93 +1,27 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Expected corresponding JSX closing tag for (1:11)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "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}}, "name": { "type": "JSXIdentifier", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, "name": "something" }, "attributes": [], @@ -95,18 +29,7 @@ }, "closingElement": { "type": "JSXClosingFragment", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - } + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}} }, "children": [] } diff --git a/packages/babel-parser/test/fixtures/jsx/regression/1/output.json b/packages/babel-parser/test/fixtures/jsx/regression/1/output.json index bc8730300d..bdb2bc1053 100644 --- a/packages/babel-parser/test/fixtures/jsx/regression/1/output.json +++ b/packages/babel-parser/test/fixtures/jsx/regression/1/output.json @@ -1,141 +1,42 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 3 - } - }, - "attributes": [], + "start":0,"end":3,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":3}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "p" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 34, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":34,"end":38,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":38}}, "name": { "type": "JSXIdentifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37}}, "name": "p" } }, "children": [ { "type": "JSXText", - "start": 3, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":3,"end":7,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":7}}, "extra": { "rawValue": "foo ", "raw": "foo " @@ -144,77 +45,27 @@ }, { "type": "JSXElement", - "start": 7, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":7,"end":30,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":30}}, "openingElement": { "type": "JSXOpeningElement", - "start": 7, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 22 - } + "start":7,"end":22,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":22}}, + "name": { + "type": "JSXIdentifier", + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9}}, + "name": "a" }, "attributes": [ { "type": "JSXAttribute", - "start": 10, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":10,"end":21,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":21}}, "name": { "type": "JSXIdentifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14}}, "name": "href" }, "value": { "type": "StringLiteral", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}}, "extra": { "rawValue": "test", "raw": "\"test\"" @@ -223,70 +74,21 @@ } } ], - "name": { - "type": "JSXIdentifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - } - }, - "name": "a" - }, "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 26, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":26,"end":30,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":30}}, "name": { "type": "JSXIdentifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29}}, "name": "a" } }, "children": [ { "type": "JSXText", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":22,"end":26,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":26}}, "extra": { "rawValue": " bar", "raw": " bar" @@ -297,18 +99,7 @@ }, { "type": "JSXText", - "start": 30, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":30,"end":34,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":34}}, "extra": { "rawValue": " baz", "raw": " baz" diff --git a/packages/babel-parser/test/fixtures/jsx/regression/2/output.json b/packages/babel-parser/test/fixtures/jsx/regression/2/output.json index 9445bee4ea..d32da25e67 100644 --- a/packages/babel-parser/test/fixtures/jsx/regression/2/output.json +++ b/packages/babel-parser/test/fixtures/jsx/regression/2/output.json @@ -1,219 +1,64 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expression": { "type": "JSXElement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "attributes": [], + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "name": { "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "name": "div" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}}, "name": { "type": "JSXIdentifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29}}, "name": "div" } }, "children": [ { "type": "JSXExpressionContainer", - "start": 5, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":5,"end":24,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":24}}, "expression": { "type": "JSXElement", - "start": 6, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":6,"end":23,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":23}}, "openingElement": { "type": "JSXOpeningElement", - "start": 6, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 23 - } + "start":6,"end":23,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":23}}, + "name": { + "type": "JSXIdentifier", + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, + "name": "div" }, "attributes": [ { "type": "JSXSpreadAttribute", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20}}, "argument": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "test" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"test"}, "name": "test" } } ], - "name": { - "type": "JSXIdentifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, - "name": "div" - }, "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/jsx/regression/3/output.json b/packages/babel-parser/test/fixtures/jsx/regression/3/output.json index 80bc377df5..74552206a9 100644 --- a/packages/babel-parser/test/fixtures/jsx/regression/3/output.json +++ b/packages/babel-parser/test/fixtures/jsx/regression/3/output.json @@ -1,205 +1,60 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "JSXElement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "attributes": [], + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "name": { "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "name": "div" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}}, "name": { "type": "JSXIdentifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "name": "div" } }, "children": [ { "type": "JSXExpressionContainer", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "expression": { "type": "ObjectExpression", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "a" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"a"}, "name": "a" }, "extra": { diff --git a/packages/babel-parser/test/fixtures/jsx/regression/4/output.json b/packages/babel-parser/test/fixtures/jsx/regression/4/output.json index 15e5a1a862..de8ce5791d 100644 --- a/packages/babel-parser/test/fixtures/jsx/regression/4/output.json +++ b/packages/babel-parser/test/fixtures/jsx/regression/4/output.json @@ -1,141 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "attributes": [], + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "name": { "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "name": "div" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}}, "name": { "type": "JSXIdentifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15}}, "name": "div" } }, "children": [ { "type": "JSXText", - "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}}, "extra": { "rawValue": "/text", "raw": "/text" diff --git a/packages/babel-parser/test/fixtures/jsx/regression/5/output.json b/packages/babel-parser/test/fixtures/jsx/regression/5/output.json index 54bfbadc9d..07b4719ab5 100644 --- a/packages/babel-parser/test/fixtures/jsx/regression/5/output.json +++ b/packages/babel-parser/test/fixtures/jsx/regression/5/output.json @@ -1,188 +1,54 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "attributes": [], + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "name": { "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "name": "div" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "name": { "type": "JSXIdentifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16}}, "name": "div" } }, "children": [ { "type": "JSXExpressionContainer", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "expression": { "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" } }, { "type": "JSXExpressionContainer", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "expression": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "b" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"b"}, "name": "b" } } diff --git a/packages/babel-parser/test/fixtures/jsx/regression/6/output.json b/packages/babel-parser/test/fixtures/jsx/regression/6/output.json index bfae92192f..bbf531aefe 100644 --- a/packages/babel-parser/test/fixtures/jsx/regression/6/output.json +++ b/packages/babel-parser/test/fixtures/jsx/regression/6/output.json @@ -1,121 +1,38 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "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}}, + "name": { + "type": "JSXIdentifier", + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, + "name": "div" }, "attributes": [ { "type": "JSXAttribute", - "start": 5, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":5,"end":18,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":18}}, "name": { "type": "JSXIdentifier", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "name": "pre" }, "value": { "type": "StringLiteral", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "extra": { "rawValue": "leading", "raw": "\"leading\"" @@ -125,53 +42,14 @@ }, { "type": "JSXSpreadAttribute", - "start": 19, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":19,"end":29,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":29}}, "argument": { "type": "Identifier", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "props" - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28},"identifierName":"props"}, "name": "props" } } ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "name": "div" - }, "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/jsx/regression/7/output.json b/packages/babel-parser/test/fixtures/jsx/regression/7/output.json index 8017ec8fa0..50b7af00aa 100644 --- a/packages/babel-parser/test/fixtures/jsx/regression/7/output.json +++ b/packages/babel-parser/test/fixtures/jsx/regression/7/output.json @@ -1,121 +1,38 @@ { "type": "File", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":17}}, "program": { "type": "Program", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":17}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":17}}, "expression": { "type": "JSXElement", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":17}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":17}}, + "name": { + "type": "JSXIdentifier", + "start":1,"end":5,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":5}}, + "name": "path" }, "attributes": [ { "type": "JSXAttribute", - "start": 6, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":6,"end":60,"loc":{"start":{"line":1,"column":6},"end":{"line":3,"column":15}}, "name": { "type": "JSXIdentifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "name": "d" }, "value": { "type": "StringLiteral", - "start": 8, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":8,"end":60,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":15}}, "extra": { "rawValue": "M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z", "raw": "\"M230 80\n\t\tA 45 45, 0, 1, 0, 275 125\n L 275 80 Z\"" @@ -124,22 +41,6 @@ } } ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "name": "path" - }, "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/jsx/regression/issue-2083/output.json b/packages/babel-parser/test/fixtures/jsx/regression/issue-2083/output.json index d695f1c4ea..7d804c8dde 100644 --- a/packages/babel-parser/test/fixtures/jsx/regression/issue-2083/output.json +++ b/packages/babel-parser/test/fixtures/jsx/regression/issue-2083/output.json @@ -1,123 +1,35 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "ConditionalExpression", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "test": { "type": "BooleanLiteral", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "value": true }, "consequent": { "type": "JSXElement", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15}}, "openingElement": { "type": "JSXOpeningElement", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - } - }, - "attributes": [], + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15}}, "name": { "type": "JSXIdentifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "name": "div" }, + "attributes": [], "selfClosing": true }, "closingElement": null, @@ -129,49 +41,16 @@ }, "alternate": { "type": "JSXElement", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}}, "openingElement": { "type": "JSXOpeningElement", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - }, - "attributes": [], + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}}, "name": { "type": "JSXIdentifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23}}, "name": "div" }, + "attributes": [], "selfClosing": true }, "closingElement": null, diff --git a/packages/babel-parser/test/fixtures/jsx/regression/issue-2114/output.json b/packages/babel-parser/test/fixtures/jsx/regression/issue-2114/output.json index 8bb402e431..c87ad6b98b 100644 --- a/packages/babel-parser/test/fixtures/jsx/regression/issue-2114/output.json +++ b/packages/babel-parser/test/fixtures/jsx/regression/issue-2114/output.json @@ -1,121 +1,38 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "expression": { "type": "JSXElement", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, + "name": { + "type": "JSXIdentifier", + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, + "name": "div" }, "attributes": [ { "type": "JSXAttribute", - "start": 5, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":5,"end":43,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":43}}, "name": { "type": "JSXIdentifier", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "name": "pattern" }, "value": { "type": "StringLiteral", - "start": 13, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":13,"end":43,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":43}}, "extra": { "rawValue": "^([\\w\\.\\-]+\\s)*[\\w\\.\\-]+\\s?$", "raw": "\"^([\\w\\.\\-]+\\s)*[\\w\\.\\-]+\\s?$\"" @@ -124,52 +41,14 @@ } } ], - "name": { - "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, - "name": "div" - }, "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 44, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":44,"end":50,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":50}}, "name": { "type": "JSXIdentifier", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":46,"end":49,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":49}}, "name": "div" } }, diff --git a/packages/babel-parser/test/fixtures/jsx/regression/issue-8891/output.json b/packages/babel-parser/test/fixtures/jsx/regression/issue-8891/output.json index abafdf5c87..29cc385116 100644 --- a/packages/babel-parser/test/fixtures/jsx/regression/issue-8891/output.json +++ b/packages/babel-parser/test/fixtures/jsx/regression/issue-8891/output.json @@ -1,107 +1,30 @@ { "type": "File", - "start": 0, - "end": 153, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":0,"end":153,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":3}}, "program": { "type": "Program", - "start": 0, - "end": 153, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":0,"end":153,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":3}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 153, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":0,"end":153,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":3}}, "expression": { "type": "JSXFragment", - "start": 0, - "end": 153, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - }, + "start":0,"end":153,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":3}}, "openingFragment": { "type": "JSXOpeningFragment", - "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}} }, "closingFragment": { "type": "JSXClosingFragment", - "start": 150, - "end": 153, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 3 - } - } + "start":150,"end":153,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":3}} }, "children": [ { "type": "JSXText", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 2, - "column": 0 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":2,"column":0}}, "extra": { "rawValue": "\n", "raw": "\n" @@ -110,156 +33,45 @@ }, { "type": "JSXElement", - "start": 3, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":3,"end":41,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":38}}, "openingElement": { "type": "JSXOpeningElement", - "start": 3, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":3,"end":41,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":38}}, "name": { "type": "JSXIdentifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":4,"end":10,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":7}}, "name": "Select" }, "attributes": [ { "type": "JSXAttribute", - "start": 11, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":11,"end":38,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":35}}, "name": { "type": "JSXIdentifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":11,"end":15,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":12}}, "name": "prop" }, "value": { "type": "JSXExpressionContainer", - "start": 16, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":16,"end":38,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":35}}, "expression": { "type": "ObjectExpression", - "start": 17, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":17,"end":37,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":34}}, "properties": [ { "type": "ObjectProperty", - "start": 19, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":19,"end":35,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":32}}, "method": false, "key": { "type": "Identifier", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 24 - }, - "identifierName": "function" - }, + "start":19,"end":27,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":24},"identifierName":"function"}, "name": "function" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":29,"end":35,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":32}}, "extra": { "rawValue": "test", "raw": "'test'" @@ -279,18 +91,7 @@ }, { "type": "JSXText", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 3, - "column": 0 - } - }, + "start":41,"end":42,"loc":{"start":{"line":2,"column":38},"end":{"line":3,"column":0}}, "extra": { "rawValue": "\n", "raw": "\n" @@ -299,156 +100,45 @@ }, { "type": "JSXElement", - "start": 42, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":42,"end":77,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":35}}, "openingElement": { "type": "JSXOpeningElement", - "start": 42, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":42,"end":77,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":35}}, "name": { "type": "JSXIdentifier", - "start": 43, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":43,"end":49,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":7}}, "name": "Select" }, "attributes": [ { "type": "JSXAttribute", - "start": 50, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 32 - } - }, + "start":50,"end":74,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":32}}, "name": { "type": "JSXIdentifier", - "start": 50, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":50,"end":54,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":12}}, "name": "prop" }, "value": { "type": "JSXExpressionContainer", - "start": 55, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 32 - } - }, + "start":55,"end":74,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":32}}, "expression": { "type": "ObjectExpression", - "start": 56, - "end": 73, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 31 - } - }, + "start":56,"end":73,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":31}}, "properties": [ { "type": "ObjectProperty", - "start": 58, - "end": 71, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":58,"end":71,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 58, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 21 - }, - "identifierName": "class" - }, + "start":58,"end":63,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":21},"identifierName":"class"}, "name": "class" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 65, - "end": 71, - "loc": { - "start": { - "line": 3, - "column": 23 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":65,"end":71,"loc":{"start":{"line":3,"column":23},"end":{"line":3,"column":29}}, "extra": { "rawValue": "test", "raw": "'test'" @@ -468,18 +158,7 @@ }, { "type": "JSXText", - "start": 77, - "end": 78, - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 4, - "column": 0 - } - }, + "start":77,"end":78,"loc":{"start":{"line":3,"column":35},"end":{"line":4,"column":0}}, "extra": { "rawValue": "\n", "raw": "\n" @@ -488,156 +167,45 @@ }, { "type": "JSXElement", - "start": 78, - "end": 114, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 36 - } - }, + "start":78,"end":114,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":36}}, "openingElement": { "type": "JSXOpeningElement", - "start": 78, - "end": 114, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 36 - } - }, + "start":78,"end":114,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":36}}, "name": { "type": "JSXIdentifier", - "start": 79, - "end": 85, - "loc": { - "start": { - "line": 4, - "column": 1 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":79,"end":85,"loc":{"start":{"line":4,"column":1},"end":{"line":4,"column":7}}, "name": "Select" }, "attributes": [ { "type": "JSXAttribute", - "start": 86, - "end": 111, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 33 - } - }, + "start":86,"end":111,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":33}}, "name": { "type": "JSXIdentifier", - "start": 86, - "end": 90, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 12 - } - }, + "start":86,"end":90,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":12}}, "name": "prop" }, "value": { "type": "JSXExpressionContainer", - "start": 91, - "end": 111, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 33 - } - }, + "start":91,"end":111,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":33}}, "expression": { "type": "ObjectExpression", - "start": 92, - "end": 110, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 32 - } - }, + "start":92,"end":110,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":32}}, "properties": [ { "type": "ObjectProperty", - "start": 94, - "end": 108, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 30 - } - }, + "start":94,"end":108,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":30}}, "method": false, "key": { "type": "Identifier", - "start": 94, - "end": 100, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 22 - }, - "identifierName": "delete" - }, + "start":94,"end":100,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":22},"identifierName":"delete"}, "name": "delete" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 102, - "end": 108, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 30 - } - }, + "start":102,"end":108,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":30}}, "extra": { "rawValue": "test", "raw": "'test'" @@ -657,18 +225,7 @@ }, { "type": "JSXText", - "start": 114, - "end": 115, - "loc": { - "start": { - "line": 4, - "column": 36 - }, - "end": { - "line": 5, - "column": 0 - } - }, + "start":114,"end":115,"loc":{"start":{"line":4,"column":36},"end":{"line":5,"column":0}}, "extra": { "rawValue": "\n", "raw": "\n" @@ -677,156 +234,45 @@ }, { "type": "JSXElement", - "start": 115, - "end": 149, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 34 - } - }, + "start":115,"end":149,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":34}}, "openingElement": { "type": "JSXOpeningElement", - "start": 115, - "end": 149, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 34 - } - }, + "start":115,"end":149,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":34}}, "name": { "type": "JSXIdentifier", - "start": 116, - "end": 122, - "loc": { - "start": { - "line": 5, - "column": 1 - }, - "end": { - "line": 5, - "column": 7 - } - }, + "start":116,"end":122,"loc":{"start":{"line":5,"column":1},"end":{"line":5,"column":7}}, "name": "Select" }, "attributes": [ { "type": "JSXAttribute", - "start": 123, - "end": 146, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 31 - } - }, + "start":123,"end":146,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":31}}, "name": { "type": "JSXIdentifier", - "start": 123, - "end": 127, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 12 - } - }, + "start":123,"end":127,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":12}}, "name": "prop" }, "value": { "type": "JSXExpressionContainer", - "start": 128, - "end": 146, - "loc": { - "start": { - "line": 5, - "column": 13 - }, - "end": { - "line": 5, - "column": 31 - } - }, + "start":128,"end":146,"loc":{"start":{"line":5,"column":13},"end":{"line":5,"column":31}}, "expression": { "type": "ObjectExpression", - "start": 129, - "end": 145, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 30 - } - }, + "start":129,"end":145,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":30}}, "properties": [ { "type": "ObjectProperty", - "start": 131, - "end": 143, - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 5, - "column": 28 - } - }, + "start":131,"end":143,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":28}}, "method": false, "key": { "type": "Identifier", - "start": 131, - "end": 135, - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 5, - "column": 20 - }, - "identifierName": "enum" - }, + "start":131,"end":135,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":20},"identifierName":"enum"}, "name": "enum" }, "computed": false, "shorthand": false, "value": { "type": "StringLiteral", - "start": 137, - "end": 143, - "loc": { - "start": { - "line": 5, - "column": 22 - }, - "end": { - "line": 5, - "column": 28 - } - }, + "start":137,"end":143,"loc":{"start":{"line":5,"column":22},"end":{"line":5,"column":28}}, "extra": { "rawValue": "test", "raw": "'test'" @@ -846,18 +292,7 @@ }, { "type": "JSXText", - "start": 149, - "end": 150, - "loc": { - "start": { - "line": 5, - "column": 34 - }, - "end": { - "line": 6, - "column": 0 - } - }, + "start":149,"end":150,"loc":{"start":{"line":5,"column":34},"end":{"line":6,"column":0}}, "extra": { "rawValue": "\n", "raw": "\n" diff --git a/packages/babel-parser/test/fixtures/jsx/regression/nbsp/output.json b/packages/babel-parser/test/fixtures/jsx/regression/nbsp/output.json index c4315832f0..c06d0a7228 100644 --- a/packages/babel-parser/test/fixtures/jsx/regression/nbsp/output.json +++ b/packages/babel-parser/test/fixtures/jsx/regression/nbsp/output.json @@ -1,141 +1,42 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - } - }, - "attributes": [], + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5}}, "name": { "type": "JSXIdentifier", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "name": "div" }, + "attributes": [], "selfClosing": false }, "closingElement": { "type": "JSXClosingElement", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "name": { "type": "JSXIdentifier", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16}}, "name": "div" } }, "children": [ { "type": "JSXText", - "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}}, "extra": { "rawValue": " ", "raw": " " diff --git a/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/output.json b/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/output.json index 4d13018c30..dc0f88188d 100644 --- a/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/_errors/space-after/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected space in placeholder. (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "Placeholder", - "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}}, "name": { "type": "Identifier", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "FOO" - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5},"identifierName":"FOO"}, "name": "FOO" }, "expectedNode": "Statement" diff --git a/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/output.json b/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/output.json index 0bd5ffb6bd..1855819ef9 100644 --- a/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/_errors/space-before/output.json @@ -1,66 +1,21 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected space in placeholder. (1:2)" ], "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "Placeholder", - "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}}, "name": { "type": "Identifier", - "start": 3, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "FOO" - }, + "start":3,"end":6,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":6},"identifierName":"FOO"}, "name": "FOO" }, "expectedNode": "Statement" diff --git a/packages/babel-parser/test/fixtures/placeholders/arrow/async/output.json b/packages/babel-parser/test/fixtures/placeholders/arrow/async/output.json index 4896328afd..b0e63aa6ac 100644 --- a/packages/babel-parser/test/fixtures/placeholders/arrow/async/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/arrow/async/output.json @@ -1,95 +1,28 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": true, "params": [ { "type": "Placeholder", - "start": 7, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":7,"end":16,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":16}}, "name": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "PARAM" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"PARAM"}, "name": "PARAM" }, "expectedNode": "Pattern" @@ -97,33 +30,10 @@ ], "body": { "type": "Placeholder", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "name": { "type": "Identifier", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "BODY" - }, + "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27},"identifierName":"BODY"}, "name": "BODY" }, "expectedNode": "Expression" diff --git a/packages/babel-parser/test/fixtures/placeholders/arrow/sync/output.json b/packages/babel-parser/test/fixtures/placeholders/arrow/sync/output.json index 6b0b16b70f..89b39b42d7 100644 --- a/packages/babel-parser/test/fixtures/placeholders/arrow/sync/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/arrow/sync/output.json @@ -1,95 +1,28 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Placeholder", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, "name": { "type": "Identifier", - "start": 3, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "PARAM" - }, + "start":3,"end":8,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":8},"identifierName":"PARAM"}, "name": "PARAM" }, "expectedNode": "Pattern" @@ -97,33 +30,10 @@ ], "body": { "type": "Placeholder", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "name": { "type": "Identifier", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "BODY" - }, + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21},"identifierName":"BODY"}, "name": "BODY" }, "expectedNode": "Expression" diff --git a/packages/babel-parser/test/fixtures/placeholders/class/body_expression/output.json b/packages/babel-parser/test/fixtures/placeholders/class/body_expression/output.json index 6196640684..d8d6d4bb59 100644 --- a/packages/babel-parser/test/fixtures/placeholders/class/body_expression/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/class/body_expression/output.json @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "UnaryExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "operator": "void", "prefix": true, "argument": { "type": "ClassExpression", - "start": 5, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":5,"end":19,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":19}}, "id": null, "body": { "type": "Placeholder", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19}}, "name": { "type": "Identifier", - "start": 13, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "BODY" - }, + "start":13,"end":17,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":17},"identifierName":"BODY"}, "name": "BODY" }, "expectedNode": "ClassBody" diff --git a/packages/babel-parser/test/fixtures/placeholders/class/body_statement/output.json b/packages/babel-parser/test/fixtures/placeholders/class/body_statement/output.json index 70f4a63652..649a06dcc0 100644 --- a/packages/babel-parser/test/fixtures/placeholders/class/body_statement/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/class/body_statement/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 6, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "Cl" - }, + "start":6,"end":8,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":8},"identifierName":"Cl"}, "name": "Cl" }, "superClass": null, "body": { "type": "Placeholder", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "name": { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "BODY" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"BODY"}, "name": "BODY" }, "expectedNode": "ClassBody" diff --git a/packages/babel-parser/test/fixtures/placeholders/class/decorators/output.json b/packages/babel-parser/test/fixtures/placeholders/class/decorators/output.json index 459dacb35f..693f74878a 100644 --- a/packages/babel-parser/test/fixtures/placeholders/class/decorators/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/class/decorators/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "decorators": [ { "type": "Decorator", - "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}}, "expression": { "type": "Placeholder", - "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}}, "name": { "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" }, "expectedNode": "Expression" @@ -95,36 +28,13 @@ ], "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "A" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":10}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/placeholders/class/id-body/output.json b/packages/babel-parser/test/fixtures/placeholders/class/id-body/output.json index 0fe8c71d47..0d6cc4d186 100644 --- a/packages/babel-parser/test/fixtures/placeholders/class/id-body/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/class/id-body/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "type": "Placeholder", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "name": { "type": "Identifier", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "ID" - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10},"identifierName":"ID"}, "name": "ID" }, "expectedNode": "Identifier" @@ -79,33 +23,10 @@ "superClass": null, "body": { "type": "Placeholder", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21}}, "name": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "BODY" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"BODY"}, "name": "BODY" }, "expectedNode": "ClassBody" diff --git a/packages/babel-parser/test/fixtures/placeholders/class/id-super-body/output.json b/packages/babel-parser/test/fixtures/placeholders/class/id-super-body/output.json index b891fe7c30..e193ed51d8 100644 --- a/packages/babel-parser/test/fixtures/placeholders/class/id-super-body/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/class/id-super-body/output.json @@ -1,143 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "type": "Placeholder", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "name": { "type": "Identifier", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "ID" - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10},"identifierName":"ID"}, "name": "ID" }, "expectedNode": "Identifier" }, "superClass": { "type": "Placeholder", - "start": 21, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":21,"end":30,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":30}}, "name": { "type": "Identifier", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "SUPER" - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28},"identifierName":"SUPER"}, "name": "SUPER" }, "expectedNode": "Expression" }, "body": { "type": "Placeholder", - "start": 31, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":31,"end":39,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":39}}, "name": { "type": "Identifier", - "start": 33, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "BODY" - }, + "start":33,"end":37,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":37},"identifierName":"BODY"}, "name": "BODY" }, "expectedNode": "ClassBody" diff --git a/packages/babel-parser/test/fixtures/placeholders/class/id-super/output.json b/packages/babel-parser/test/fixtures/placeholders/class/id-super/output.json index cde4f271b7..8a3a9f6457 100644 --- a/packages/babel-parser/test/fixtures/placeholders/class/id-super/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/class/id-super/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": { "type": "Placeholder", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "name": { "type": "Identifier", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "ID" - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10},"identifierName":"ID"}, "name": "ID" }, "expectedNode": "Identifier" }, "superClass": { "type": "Placeholder", - "start": 21, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":21,"end":30,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":30}}, "name": { "type": "Identifier", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "SUPER" - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28},"identifierName":"SUPER"}, "name": "SUPER" }, "expectedNode": "Expression" }, "body": { "type": "ClassBody", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/placeholders/class/id_expression/output.json b/packages/babel-parser/test/fixtures/placeholders/class/id_expression/output.json index 8ec0bdeaeb..d52bbba588 100644 --- a/packages/babel-parser/test/fixtures/placeholders/class/id_expression/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/class/id_expression/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "UnaryExpression", - "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}}, "operator": "void", "prefix": true, "argument": { "type": "ClassExpression", - "start": 5, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":5,"end":20,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":20}}, "id": { "type": "Placeholder", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}}, "name": { "type": "Identifier", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "ID" - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15},"identifierName":"ID"}, "name": "ID" }, "expectedNode": "Identifier" @@ -109,18 +31,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/placeholders/class/id_statement/output.json b/packages/babel-parser/test/fixtures/placeholders/class/id_statement/output.json index 61ecc899ae..f435f0a370 100644 --- a/packages/babel-parser/test/fixtures/placeholders/class/id_statement/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/class/id_statement/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "type": "Placeholder", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "name": { "type": "Identifier", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "ID" - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10},"identifierName":"ID"}, "name": "ID" }, "expectedNode": "Identifier" @@ -79,18 +23,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/placeholders/class/super/output.json b/packages/babel-parser/test/fixtures/placeholders/class/super/output.json index 966639d5d3..b28056e898 100644 --- a/packages/babel-parser/test/fixtures/placeholders/class/super/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/class/super/output.json @@ -1,112 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 6, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "Cl" - }, + "start":6,"end":8,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":8},"identifierName":"Cl"}, "name": "Cl" }, "superClass": { "type": "Placeholder", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":17,"end":26,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":26}}, "name": { "type": "Identifier", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "SUPER" - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24},"identifierName":"SUPER"}, "name": "SUPER" }, "expectedNode": "Expression" }, "body": { "type": "ClassBody", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/placeholders/export/declaration/output.json b/packages/babel-parser/test/fixtures/placeholders/export/declaration/output.json index a0cc4fb211..4887a8756c 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/declaration/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/declaration/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [], "source": null, "declaration": { "type": "Placeholder", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "name": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "DECL" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"DECL"}, "name": "DECL" }, "expectedNode": "Declaration" @@ -81,18 +25,7 @@ }, { "type": "EmptyStatement", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}} } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/placeholders/export/named-alias-2/output.json b/packages/babel-parser/test/fixtures/placeholders/export/named-alias-2/output.json index 3da7a5b3b5..272f92504b 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/named-alias-2/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/named-alias-2/output.json @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":9,"end":26,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":26}}, "local": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "name" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"name"}, "name": "name" }, "exported": { "type": "Placeholder", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":17,"end":26,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":26}}, "name": { "type": "Identifier", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "ALIAS" - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24},"identifierName":"ALIAS"}, "name": "ALIAS" }, "expectedNode": "Identifier" diff --git a/packages/babel-parser/test/fixtures/placeholders/export/named-alias-3/output.json b/packages/babel-parser/test/fixtures/placeholders/export/named-alias-3/output.json index 79bf65de11..6b4908e154 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/named-alias-3/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/named-alias-3/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":9,"end":30,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":30}}, "local": { "type": "Placeholder", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "name": { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "NAME" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"NAME"}, "name": "NAME" }, "expectedNode": "Identifier" }, "exported": { "type": "Placeholder", - "start": 21, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":21,"end":30,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":30}}, "name": { "type": "Identifier", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "ALIAS" - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28},"identifierName":"ALIAS"}, "name": "ALIAS" }, "expectedNode": "Identifier" diff --git a/packages/babel-parser/test/fixtures/placeholders/export/named-alias/output.json b/packages/babel-parser/test/fixtures/placeholders/export/named-alias/output.json index ddabad2b64..254503184b 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/named-alias/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/named-alias/output.json @@ -1,111 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":9,"end":26,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":26}}, "local": { "type": "Placeholder", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "name": { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "NAME" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"NAME"}, "name": "NAME" }, "expectedNode": "Identifier" }, "exported": { "type": "Identifier", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "alias" - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26},"identifierName":"alias"}, "name": "alias" } } diff --git a/packages/babel-parser/test/fixtures/placeholders/export/named-from-2/output.json b/packages/babel-parser/test/fixtures/placeholders/export/named-from-2/output.json index 5d7db268eb..55842e9c46 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/named-from-2/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/named-from-2/output.json @@ -1,128 +1,37 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "local": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "name" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"name"}, "name": "name" }, "exported": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "name" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"name"}, "name": "name" } } ], "source": { "type": "Placeholder", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "name": { "type": "Identifier", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "FILE" - }, + "start":23,"end":27,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":27},"identifierName":"FILE"}, "name": "FILE" }, "expectedNode": "StringLiteral" diff --git a/packages/babel-parser/test/fixtures/placeholders/export/named-from-3/output.json b/packages/babel-parser/test/fixtures/placeholders/export/named-from-3/output.json index f89643fc0a..69e81274c9 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/named-from-3/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/named-from-3/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "local": { "type": "Placeholder", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "name": { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "NAME" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"NAME"}, "name": "NAME" }, "expectedNode": "Identifier" }, "exported": { "type": "Placeholder", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "name": { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "NAME" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"NAME"}, "name": "NAME" }, "expectedNode": "Identifier" @@ -128,33 +38,10 @@ ], "source": { "type": "Placeholder", - "start": 25, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":25,"end":33,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":33}}, "name": { "type": "Identifier", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "FILE" - }, + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31},"identifierName":"FILE"}, "name": "FILE" }, "expectedNode": "StringLiteral" diff --git a/packages/babel-parser/test/fixtures/placeholders/export/named-from-alias-2/output.json b/packages/babel-parser/test/fixtures/placeholders/export/named-from-alias-2/output.json index 637b5256b8..cb1bc9f9c9 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/named-from-alias-2/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/named-from-alias-2/output.json @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":9,"end":26,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":26}}, "local": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "name" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"name"}, "name": "name" }, "exported": { "type": "Placeholder", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":17,"end":26,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":26}}, "name": { "type": "Identifier", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "ALIAS" - }, + "start":19,"end":24,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":24},"identifierName":"ALIAS"}, "name": "ALIAS" }, "expectedNode": "Identifier" @@ -112,18 +33,7 @@ ], "source": { "type": "StringLiteral", - "start": 34, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":34,"end":40,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":40}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/export/named-from-alias-3/output.json b/packages/babel-parser/test/fixtures/placeholders/export/named-from-alias-3/output.json index 2fd4cc6f3a..7960edf4ba 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/named-from-alias-3/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/named-from-alias-3/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":9,"end":30,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":30}}, "local": { "type": "Placeholder", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "name": { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "NAME" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"NAME"}, "name": "NAME" }, "expectedNode": "Identifier" }, "exported": { "type": "Placeholder", - "start": 21, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":21,"end":30,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":30}}, "name": { "type": "Identifier", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "ALIAS" - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28},"identifierName":"ALIAS"}, "name": "ALIAS" }, "expectedNode": "Identifier" @@ -128,18 +38,7 @@ ], "source": { "type": "StringLiteral", - "start": 38, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":38,"end":44,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":44}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/export/named-from-alias/output.json b/packages/babel-parser/test/fixtures/placeholders/export/named-from-alias/output.json index 34e8dd6e3a..17aec6b585 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/named-from-alias/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/named-from-alias/output.json @@ -1,129 +1,39 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":9,"end":26,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":26}}, "local": { "type": "Placeholder", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "name": { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "NAME" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"NAME"}, "name": "NAME" }, "expectedNode": "Identifier" }, "exported": { "type": "Identifier", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "alias" - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26},"identifierName":"alias"}, "name": "alias" } } ], "source": { "type": "StringLiteral", - "start": 34, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":34,"end":40,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":40}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/export/named-from/output.json b/packages/babel-parser/test/fixtures/placeholders/export/named-from/output.json index 5c9ae8516d..a33db15edb 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/named-from/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/named-from/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "local": { "type": "Placeholder", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "name": { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "NAME" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"NAME"}, "name": "NAME" }, "expectedNode": "Identifier" }, "exported": { "type": "Placeholder", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "name": { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "NAME" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"NAME"}, "name": "NAME" }, "expectedNode": "Identifier" @@ -128,18 +38,7 @@ ], "source": { "type": "StringLiteral", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":25,"end":31,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":31}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/export/named/output.json b/packages/babel-parser/test/fixtures/placeholders/export/named/output.json index 67b0f0429f..251f78d866 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/named/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/named/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "local": { "type": "Placeholder", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "name": { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "NAME" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"NAME"}, "name": "NAME" }, "expectedNode": "Identifier" }, "exported": { "type": "Placeholder", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "name": { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "NAME" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"NAME"}, "name": "NAME" }, "expectedNode": "Identifier" diff --git a/packages/babel-parser/test/fixtures/placeholders/export/star-from-2/output.json b/packages/babel-parser/test/fixtures/placeholders/export/star-from-2/output.json index b89f3e8dec..1e90f81ce4 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/star-from-2/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/star-from-2/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "specifiers": [ { "type": "ExportNamespaceSpecifier", - "start": 7, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":7,"end":20,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":20}}, "exported": { "type": "Placeholder", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "name": { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "STAR" - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"STAR"}, "name": "STAR" }, "expectedNode": "Identifier" @@ -95,18 +28,7 @@ ], "source": { "type": "StringLiteral", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":26,"end":32,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":32}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/export/star-from-3/output.json b/packages/babel-parser/test/fixtures/placeholders/export/star-from-3/output.json index 2391c0c770..4ea4409c06 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/star-from-3/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/star-from-3/output.json @@ -1,92 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "specifiers": [ { "type": "ExportNamespaceSpecifier", - "start": 7, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":7,"end":20,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":20}}, "exported": { "type": "Placeholder", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "name": { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "STAR" - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"STAR"}, "name": "STAR" }, "expectedNode": "Identifier" @@ -95,33 +28,10 @@ ], "source": { "type": "Placeholder", - "start": 26, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":26,"end":34,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":34}}, "name": { "type": "Identifier", - "start": 28, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "FILE" - }, + "start":28,"end":32,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":32},"identifierName":"FILE"}, "name": "FILE" }, "expectedNode": "StringLiteral" diff --git a/packages/babel-parser/test/fixtures/placeholders/export/star-from/output.json b/packages/babel-parser/test/fixtures/placeholders/export/star-from/output.json index 87a3012121..68d516b0d9 100644 --- a/packages/babel-parser/test/fixtures/placeholders/export/star-from/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/export/star-from/output.json @@ -1,77 +1,21 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportAllDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "source": { "type": "Placeholder", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":14,"end":22,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":22}}, "name": { "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "FILE" - }, + "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"FILE"}, "name": "FILE" }, "expectedNode": "StringLiteral" diff --git a/packages/babel-parser/test/fixtures/placeholders/expression/01/output.json b/packages/babel-parser/test/fixtures/placeholders/expression/01/output.json index 9de9b6f77e..186d0eead5 100644 --- a/packages/babel-parser/test/fixtures/placeholders/expression/01/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/expression/01/output.json @@ -1,91 +1,24 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "expression": { "type": "BinaryExpression", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "left": { "type": "Placeholder", - "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}}, "name": { "type": "Identifier", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "FOO" - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5},"identifierName":"FOO"}, "name": "FOO" }, "expectedNode": "Expression" @@ -93,47 +26,13 @@ "operator": "+", "right": { "type": "CallExpression", - "start": 10, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":10,"end":26,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":26}}, "callee": { "type": "Placeholder", - "start": 10, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":10,"end":17,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":17}}, "name": { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "BAR" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"BAR"}, "name": "BAR" }, "expectedNode": "Expression" @@ -141,33 +40,10 @@ "arguments": [ { "type": "Placeholder", - "start": 18, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":18,"end":25,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":25}}, "name": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "BAZ" - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23},"identifierName":"BAZ"}, "name": "BAZ" }, "expectedNode": "Expression" diff --git a/packages/babel-parser/test/fixtures/placeholders/function/body/output.json b/packages/babel-parser/test/fixtures/placeholders/function/body/output.json index 3139e31321..a7122229e1 100644 --- a/packages/babel-parser/test/fixtures/placeholders/function/body/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/function/body/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,33 +20,10 @@ "params": [], "body": { "type": "Placeholder", - "start": 13, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":13,"end":21,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":21}}, "name": { "type": "Identifier", - "start": 15, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "BODY" - }, + "start":15,"end":19,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":19},"identifierName":"BODY"}, "name": "BODY" }, "expectedNode": "BlockStatement" diff --git a/packages/babel-parser/test/fixtures/placeholders/function/id-params-body/output.json b/packages/babel-parser/test/fixtures/placeholders/function/id-params-body/output.json index fd6205f7ab..d8b659b178 100644 --- a/packages/babel-parser/test/fixtures/placeholders/function/id-params-body/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/function/id-params-body/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Placeholder", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "name": { "type": "Identifier", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "ID" - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13},"identifierName":"ID"}, "name": "ID" }, "expectedNode": "Identifier" @@ -81,66 +25,20 @@ "params": [ { "type": "Placeholder", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":16,"end":25,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":25}}, "name": { "type": "Identifier", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "PARAM" - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23},"identifierName":"PARAM"}, "name": "PARAM" }, "expectedNode": "Pattern" }, { "type": "Placeholder", - "start": 27, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":27,"end":36,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":36}}, "name": { "type": "Identifier", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "PARAM" - }, + "start":29,"end":34,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":34},"identifierName":"PARAM"}, "name": "PARAM" }, "expectedNode": "Pattern" @@ -148,33 +46,10 @@ ], "body": { "type": "Placeholder", - "start": 38, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":38,"end":46,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":46}}, "name": { "type": "Identifier", - "start": 40, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "BODY" - }, + "start":40,"end":44,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":44},"identifierName":"BODY"}, "name": "BODY" }, "expectedNode": "BlockStatement" diff --git a/packages/babel-parser/test/fixtures/placeholders/function/id_declaration/output.json b/packages/babel-parser/test/fixtures/placeholders/function/id_declaration/output.json index a07531190e..e0b4961dfe 100644 --- a/packages/babel-parser/test/fixtures/placeholders/function/id_declaration/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/function/id_declaration/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Placeholder", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}}, "name": { "type": "Identifier", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "ID" - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13},"identifierName":"ID"}, "name": "ID" }, "expectedNode": "Identifier" @@ -81,18 +25,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/placeholders/function/id_expression/output.json b/packages/babel-parser/test/fixtures/placeholders/function/id_expression/output.json index 1bc90cefa7..673783c39e 100644 --- a/packages/babel-parser/test/fixtures/placeholders/function/id_expression/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/function/id_expression/output.json @@ -1,107 +1,29 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expression": { "type": "UnaryExpression", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "operator": "void", "prefix": true, "argument": { "type": "FunctionExpression", - "start": 5, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":5,"end":25,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":25}}, "id": { "type": "Placeholder", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}}, "name": { "type": "Identifier", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "ID" - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18},"identifierName":"ID"}, "name": "ID" }, "expectedNode": "Identifier" @@ -111,18 +33,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/placeholders/function/param/output.json b/packages/babel-parser/test/fixtures/placeholders/function/param/output.json index 9026f46c40..0bf00557e7 100644 --- a/packages/babel-parser/test/fixtures/placeholders/function/param/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/function/param/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,33 +20,10 @@ "params": [ { "type": "Placeholder", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20}}, "name": { "type": "Identifier", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "PARAM" - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18},"identifierName":"PARAM"}, "name": "PARAM" }, "expectedNode": "Pattern" @@ -99,18 +31,7 @@ ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/placeholders/import/default-file/output.json b/packages/babel-parser/test/fixtures/placeholders/import/default-file/output.json index b4fdc7e984..75a10d9171 100644 --- a/packages/babel-parser/test/fixtures/placeholders/import/default-file/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/import/default-file/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "local": { "type": "Placeholder", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "name": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "DEFAULT" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"DEFAULT"}, "name": "DEFAULT" }, "expectedNode": "Identifier" @@ -95,33 +28,10 @@ ], "source": { "type": "Placeholder", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":24,"end":32,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":32}}, "name": { "type": "Identifier", - "start": 26, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "FILE" - }, + "start":26,"end":30,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":30},"identifierName":"FILE"}, "name": "FILE" }, "expectedNode": "StringLiteral" diff --git a/packages/babel-parser/test/fixtures/placeholders/import/default-named-2/output.json b/packages/babel-parser/test/fixtures/placeholders/import/default-named-2/output.json index 3ec417645b..807b8ef9e4 100644 --- a/packages/babel-parser/test/fixtures/placeholders/import/default-named-2/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/import/default-named-2/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "local": { "type": "Placeholder", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "name": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "DEFAULT" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"DEFAULT"}, "name": "DEFAULT" }, "expectedNode": "Identifier" @@ -94,68 +27,22 @@ }, { "type": "ImportSpecifier", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27}}, "imported": { "type": "Identifier", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "named" - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27},"identifierName":"named"}, "name": "named" }, "local": { "type": "Identifier", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "named" - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27},"identifierName":"named"}, "name": "named" } } ], "source": { "type": "StringLiteral", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":35,"end":41,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":41}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/import/default-named-3/output.json b/packages/babel-parser/test/fixtures/placeholders/import/default-named-3/output.json index e681ffb184..fe0e247d12 100644 --- a/packages/babel-parser/test/fixtures/placeholders/import/default-named-3/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/import/default-named-3/output.json @@ -1,92 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "local": { "type": "Placeholder", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "name": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "DEFAULT" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"DEFAULT"}, "name": "DEFAULT" }, "expectedNode": "Identifier" @@ -94,80 +27,23 @@ }, { "type": "ImportSpecifier", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31}}, "imported": { "type": "Placeholder", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31}}, "name": { "type": "Identifier", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "NAMED" - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29},"identifierName":"NAMED"}, "name": "NAMED" }, "expectedNode": "Identifier" }, "local": { "type": "Placeholder", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31}}, "name": { "type": "Identifier", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "NAMED" - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29},"identifierName":"NAMED"}, "name": "NAMED" }, "expectedNode": "Identifier" @@ -176,18 +52,7 @@ ], "source": { "type": "StringLiteral", - "start": 39, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":39,"end":45,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":45}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/import/default-named/output.json b/packages/babel-parser/test/fixtures/placeholders/import/default-named/output.json index 62d764263d..d46d85c826 100644 --- a/packages/babel-parser/test/fixtures/placeholders/import/default-named/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/import/default-named/output.json @@ -1,157 +1,44 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "local": { "type": "Identifier", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "_default" - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15},"identifierName":"_default"}, "name": "_default" } }, { "type": "ImportSpecifier", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":19,"end":28,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":28}}, "imported": { "type": "Placeholder", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":19,"end":28,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":28}}, "name": { "type": "Identifier", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "NAMED" - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26},"identifierName":"NAMED"}, "name": "NAMED" }, "expectedNode": "Identifier" }, "local": { "type": "Placeholder", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":19,"end":28,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":28}}, "name": { "type": "Identifier", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - }, - "identifierName": "NAMED" - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26},"identifierName":"NAMED"}, "name": "NAMED" }, "expectedNode": "Identifier" @@ -160,18 +47,7 @@ ], "source": { "type": "StringLiteral", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":36,"end":42,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":42}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/import/default-star-2/output.json b/packages/babel-parser/test/fixtures/placeholders/import/default-star-2/output.json index 6fd8a2dbed..1fb751ada3 100644 --- a/packages/babel-parser/test/fixtures/placeholders/import/default-star-2/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/import/default-star-2/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "local": { "type": "Identifier", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "_default" - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15},"identifierName":"_default"}, "name": "_default" } }, { "type": "ImportNamespaceSpecifier", - "start": 17, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":17,"end":30,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":30}}, "local": { "type": "Placeholder", - "start": 22, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":22,"end":30,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":30}}, "name": { "type": "Identifier", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "STAR" - }, + "start":24,"end":28,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":28},"identifierName":"STAR"}, "name": "STAR" }, "expectedNode": "Identifier" @@ -127,18 +37,7 @@ ], "source": { "type": "StringLiteral", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":36,"end":42,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":42}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/import/default-star-3/output.json b/packages/babel-parser/test/fixtures/placeholders/import/default-star-3/output.json index a92281d074..c77899f262 100644 --- a/packages/babel-parser/test/fixtures/placeholders/import/default-star-3/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/import/default-star-3/output.json @@ -1,92 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "local": { "type": "Placeholder", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "name": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "DEFAULT" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"DEFAULT"}, "name": "DEFAULT" }, "expectedNode": "Identifier" @@ -94,47 +27,13 @@ }, { "type": "ImportNamespaceSpecifier", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":20,"end":33,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":33}}, "local": { "type": "Placeholder", - "start": 25, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":25,"end":33,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":33}}, "name": { "type": "Identifier", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "STAR" - }, + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31},"identifierName":"STAR"}, "name": "STAR" }, "expectedNode": "Identifier" @@ -143,18 +42,7 @@ ], "source": { "type": "StringLiteral", - "start": 39, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":39,"end":45,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":45}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/import/default-star/output.json b/packages/babel-parser/test/fixtures/placeholders/import/default-star/output.json index 3976944a46..7426dbf774 100644 --- a/packages/babel-parser/test/fixtures/placeholders/import/default-star/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/import/default-star/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "local": { "type": "Placeholder", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "name": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "DEFAULT" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"DEFAULT"}, "name": "DEFAULT" }, "expectedNode": "Identifier" @@ -94,51 +27,17 @@ }, { "type": "ImportNamespaceSpecifier", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":20,"end":29,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":29}}, "local": { "type": "Identifier", - "start": 25, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "star" - }, + "start":25,"end":29,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":29},"identifierName":"star"}, "name": "star" } } ], "source": { "type": "StringLiteral", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":35,"end":41,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":41}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/import/default/output.json b/packages/babel-parser/test/fixtures/placeholders/import/default/output.json index 4ff0689564..81e351c1d3 100644 --- a/packages/babel-parser/test/fixtures/placeholders/import/default/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/import/default/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "local": { "type": "Placeholder", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "name": { "type": "Identifier", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "DEFAULT" - }, + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16},"identifierName":"DEFAULT"}, "name": "DEFAULT" }, "expectedNode": "Identifier" @@ -95,18 +28,7 @@ ], "source": { "type": "StringLiteral", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/import/file-empty/output.json b/packages/babel-parser/test/fixtures/placeholders/import/file-empty/output.json index 5690ee81f0..2b7e673506 100644 --- a/packages/babel-parser/test/fixtures/placeholders/import/file-empty/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/import/file-empty/output.json @@ -1,78 +1,22 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "specifiers": [], "source": { "type": "Placeholder", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "name": { "type": "Identifier", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "FILE" - }, + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21},"identifierName":"FILE"}, "name": "FILE" }, "expectedNode": "StringLiteral" diff --git a/packages/babel-parser/test/fixtures/placeholders/import/file/output.json b/packages/babel-parser/test/fixtures/placeholders/import/file/output.json index e33e48771a..d4af9626aa 100644 --- a/packages/babel-parser/test/fixtures/placeholders/import/file/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/import/file/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [], "source": { "type": "Placeholder", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "name": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "FILE" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"FILE"}, "name": "FILE" }, "expectedNode": "StringLiteral" diff --git a/packages/babel-parser/test/fixtures/placeholders/import/named-alias-2/output.json b/packages/babel-parser/test/fixtures/placeholders/import/named-alias-2/output.json index c7d936e96c..b52ba4d5dd 100644 --- a/packages/babel-parser/test/fixtures/placeholders/import/named-alias-2/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/import/named-alias-2/output.json @@ -1,129 +1,39 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":9,"end":27,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":27}}, "imported": { "type": "Placeholder", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "name": { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "NAMED" - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"NAMED"}, "name": "NAMED" }, "expectedNode": "Identifier" }, "local": { "type": "Identifier", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "alias" - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27},"identifierName":"alias"}, "name": "alias" } } ], "source": { "type": "StringLiteral", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":35,"end":41,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":41}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/import/named-alias-3/output.json b/packages/babel-parser/test/fixtures/placeholders/import/named-alias-3/output.json index bfae4a0444..fe0f44bed2 100644 --- a/packages/babel-parser/test/fixtures/placeholders/import/named-alias-3/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/import/named-alias-3/output.json @@ -1,125 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31}}, "imported": { "type": "Placeholder", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "name": { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "NAMED" - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"NAMED"}, "name": "NAMED" }, "expectedNode": "Identifier" }, "local": { "type": "Placeholder", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31}}, "name": { "type": "Identifier", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "ALIAS" - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29},"identifierName":"ALIAS"}, "name": "ALIAS" }, "expectedNode": "Identifier" @@ -128,18 +38,7 @@ ], "source": { "type": "StringLiteral", - "start": 39, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":39,"end":45,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":45}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/import/named-alias/output.json b/packages/babel-parser/test/fixtures/placeholders/import/named-alias/output.json index 5477bef4ca..aa6ab6e293 100644 --- a/packages/babel-parser/test/fixtures/placeholders/import/named-alias/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/import/named-alias/output.json @@ -1,109 +1,30 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":9,"end":27,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":27}}, "imported": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "named" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"named"}, "name": "named" }, "local": { "type": "Placeholder", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":18,"end":27,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":27}}, "name": { "type": "Identifier", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "ALIAS" - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"ALIAS"}, "name": "ALIAS" }, "expectedNode": "Identifier" @@ -112,18 +33,7 @@ ], "source": { "type": "StringLiteral", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":35,"end":41,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":41}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/import/named/output.json b/packages/babel-parser/test/fixtures/placeholders/import/named/output.json index 9b3f08486a..1508f63de6 100644 --- a/packages/babel-parser/test/fixtures/placeholders/import/named/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/import/named/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "imported": { "type": "Placeholder", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "name": { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "NAMED" - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"NAMED"}, "name": "NAMED" }, "expectedNode": "Identifier" }, "local": { "type": "Placeholder", - "start": 9, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":9,"end":18,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, "name": { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "NAMED" - }, + "start":11,"end":16,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":16},"identifierName":"NAMED"}, "name": "NAMED" }, "expectedNode": "Identifier" @@ -128,18 +38,7 @@ ], "source": { "type": "StringLiteral", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":26,"end":32,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":32}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/import/star/output.json b/packages/babel-parser/test/fixtures/placeholders/import/star/output.json index 7ff6bfd058..2d8f5acbca 100644 --- a/packages/babel-parser/test/fixtures/placeholders/import/star/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/import/star/output.json @@ -1,92 +1,25 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "specifiers": [ { "type": "ImportNamespaceSpecifier", - "start": 7, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":7,"end":20,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":20}}, "local": { "type": "Placeholder", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "name": { "type": "Identifier", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "STAR" - }, + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18},"identifierName":"STAR"}, "name": "STAR" }, "expectedNode": "Identifier" @@ -95,18 +28,7 @@ ], "source": { "type": "StringLiteral", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":26,"end":32,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":32}}, "extra": { "rawValue": "file", "raw": "\"file\"" diff --git a/packages/babel-parser/test/fixtures/placeholders/labels/asi/output.json b/packages/babel-parser/test/fixtures/placeholders/labels/asi/output.json index f1e2f16147..c95cb6187a 100644 --- a/packages/babel-parser/test/fixtures/placeholders/labels/asi/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/labels/asi/output.json @@ -1,76 +1,21 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "body": { "type": "WhileStatement", - "start": 6, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":6,"end":40,"loc":{"start":{"line":1,"column":6},"end":{"line":4,"column":1}}, "test": { "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": 0, "raw": "0" @@ -79,64 +24,19 @@ }, "body": { "type": "BlockStatement", - "start": 16, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":16,"end":40,"loc":{"start":{"line":1,"column":16},"end":{"line":4,"column":1}}, "body": [ { "type": "BreakStatement", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":20,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7}}, "label": null }, { "type": "Placeholder", - "start": 28, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":28,"end":38,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":12}}, "name": { "type": "Identifier", - "start": 30, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "LABEL" - }, + "start":30,"end":35,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":9},"identifierName":"LABEL"}, "name": "LABEL" }, "expectedNode": "Statement" @@ -147,19 +47,7 @@ }, "label": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "loop" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"loop"}, "name": "loop" } } diff --git a/packages/babel-parser/test/fixtures/placeholders/labels/break/output.json b/packages/babel-parser/test/fixtures/placeholders/labels/break/output.json index ab4488d5a0..d6e17d6f2a 100644 --- a/packages/babel-parser/test/fixtures/placeholders/labels/break/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/labels/break/output.json @@ -1,106 +1,28 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "body": { "type": "BlockStatement", - "start": 7, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":7,"end":29,"loc":{"start":{"line":1,"column":7},"end":{"line":3,"column":1}}, "body": [ { "type": "BreakStatement", - "start": 11, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":11,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, "label": { "type": "Placeholder", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":17,"end":26,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":17}}, "name": { "type": "Identifier", - "start": 19, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "LABEL" - }, + "start":19,"end":24,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":15},"identifierName":"LABEL"}, "name": "LABEL" }, "expectedNode": "Identifier" @@ -111,19 +33,7 @@ }, "label": { "type": "Identifier", - "start": 0, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "block" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"block"}, "name": "block" } } diff --git a/packages/babel-parser/test/fixtures/placeholders/labels/continue/output.json b/packages/babel-parser/test/fixtures/placeholders/labels/continue/output.json index b687697919..6410a2a4d3 100644 --- a/packages/babel-parser/test/fixtures/placeholders/labels/continue/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/labels/continue/output.json @@ -1,76 +1,21 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "body": { "type": "WhileStatement", - "start": 6, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":6,"end":40,"loc":{"start":{"line":1,"column":6},"end":{"line":3,"column":1}}, "test": { "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": 0, "raw": "0" @@ -79,62 +24,17 @@ }, "body": { "type": "BlockStatement", - "start": 16, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":40,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "body": [ { "type": "ContinueStatement", - "start": 20, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":20,"end":38,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "label": { "type": "Placeholder", - "start": 29, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":29,"end":37,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":19}}, "name": { "type": "Identifier", - "start": 31, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "LOOP" - }, + "start":31,"end":35,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":17},"identifierName":"LOOP"}, "name": "LOOP" }, "expectedNode": "Identifier" @@ -146,19 +46,7 @@ }, "label": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "loop" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"loop"}, "name": "loop" } } diff --git a/packages/babel-parser/test/fixtures/placeholders/labels/labeled-statement/output.json b/packages/babel-parser/test/fixtures/placeholders/labels/labeled-statement/output.json index 5974689885..43a860dc78 100644 --- a/packages/babel-parser/test/fixtures/placeholders/labels/labeled-statement/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/labels/labeled-statement/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "LabeledStatement", - "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}}, "label": { "type": "Placeholder", - "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}}, "name": { "type": "Identifier", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "FOO" - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5},"identifierName":"FOO"}, "name": "FOO" }, "expectedNode": "Identifier" }, "body": { "type": "ExpressionStatement", - "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}}, "expression": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/placeholders/statement/asi/output.json b/packages/babel-parser/test/fixtures/placeholders/statement/asi/output.json index 9980b76f59..d3858004d2 100644 --- a/packages/babel-parser/test/fixtures/placeholders/statement/asi/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/statement/asi/output.json @@ -1,96 +1,28 @@ { "type": "File", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "program": { "type": "Program", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":7}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "Placeholder", - "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}}, "name": { "type": "Identifier", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "FOO" - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5},"identifierName":"FOO"}, "name": "FOO" }, "expectedNode": "Statement" }, { "type": "Placeholder", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":8,"end":15,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":7}}, "name": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "BAR" - }, + "start":10,"end":13,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"BAR"}, "name": "BAR" }, "expectedNode": "Statement" diff --git a/packages/babel-parser/test/fixtures/placeholders/statement/nested/output.json b/packages/babel-parser/test/fixtures/placeholders/statement/nested/output.json index 1f071964bf..7a9984f207 100644 --- a/packages/babel-parser/test/fixtures/placeholders/statement/nested/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/statement/nested/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "IfStatement", - "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}}, "test": { "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": 0, "raw": "0" @@ -65,33 +21,10 @@ }, "consequent": { "type": "Placeholder", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "name": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "FOO" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"FOO"}, "name": "FOO" }, "expectedNode": "Statement" diff --git a/packages/babel-parser/test/fixtures/placeholders/statement/top-level/output.json b/packages/babel-parser/test/fixtures/placeholders/statement/top-level/output.json index d5f19f4035..9e6544a780 100644 --- a/packages/babel-parser/test/fixtures/placeholders/statement/top-level/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/statement/top-level/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "Placeholder", - "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}}, "name": { "type": "Identifier", - "start": 2, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "FOO" - }, + "start":2,"end":5,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":5},"identifierName":"FOO"}, "name": "FOO" }, "expectedNode": "Statement" diff --git a/packages/babel-parser/test/fixtures/placeholders/try/try-catch-finally/output.json b/packages/babel-parser/test/fixtures/placeholders/try/try-catch-finally/output.json index 133cd26c2b..8a3deaca0b 100644 --- a/packages/babel-parser/test/fixtures/placeholders/try/try-catch-finally/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/try/try-catch-finally/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "block": { "type": "Placeholder", - "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}}, "name": { "type": "Identifier", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "TRY" - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9},"identifierName":"TRY"}, "name": "TRY" }, "expectedNode": "BlockStatement" }, "handler": { "type": "CatchClause", - "start": 12, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":12,"end":27,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":27}}, "param": null, "body": { "type": "Placeholder", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":18,"end":27,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":27}}, "name": { "type": "Identifier", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "CATCH" - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"CATCH"}, "name": "CATCH" }, "expectedNode": "BlockStatement" @@ -127,33 +37,10 @@ }, "finalizer": { "type": "Placeholder", - "start": 36, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":36,"end":47,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":47}}, "name": { "type": "Identifier", - "start": 38, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "FINALLY" - }, + "start":38,"end":45,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":45},"identifierName":"FINALLY"}, "name": "FINALLY" }, "expectedNode": "BlockStatement" diff --git a/packages/babel-parser/test/fixtures/placeholders/try/with-catch-param/output.json b/packages/babel-parser/test/fixtures/placeholders/try/with-catch-param/output.json index 8c1574395e..85e58ce03b 100644 --- a/packages/babel-parser/test/fixtures/placeholders/try/with-catch-param/output.json +++ b/packages/babel-parser/test/fixtures/placeholders/try/with-catch-param/output.json @@ -1,141 +1,40 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "TryStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "block": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] }, "handler": { "type": "CatchClause", - "start": 7, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":7,"end":34,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":34}}, "param": { "type": "Placeholder", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}}, "name": { "type": "Identifier", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "PARAM" - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21},"identifierName":"PARAM"}, "name": "PARAM" }, "expectedNode": "Pattern" }, "body": { "type": "Placeholder", - "start": 25, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":25,"end":34,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":34}}, "name": { "type": "Identifier", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "CATCH" - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32},"identifierName":"CATCH"}, "name": "CATCH" }, "expectedNode": "BlockStatement" diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-array/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-array/output.json index a2ca569516..a13e68e19c 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-array/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-array/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "emptyWithArray" - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23},"identifierName":"emptyWithArray"}, "name": "emptyWithArray" }, "generator": false, @@ -65,47 +20,14 @@ "params": [ { "type": "RestElement", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}}, "argument": { "type": "ArrayPattern", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31}}, "elements": [ { "type": "ArrayPattern", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":28,"end":30,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":30}}, "elements": [] } ] @@ -114,18 +36,7 @@ ], "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-leading/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-leading/output.json index e7a3e39921..9569219454 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-leading/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-leading/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "emptyWithLeading" - }, + "start":9,"end":25,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":25},"identifierName":"emptyWithLeading"}, "name": "emptyWithLeading" }, "generator": false, @@ -65,67 +20,22 @@ "params": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "x" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"x"}, "name": "x" }, { "type": "RestElement", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":29,"end":34,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":34}}, "argument": { "type": "ArrayPattern", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "elements": [] } } ], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-object/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-object/output.json index d021e73d9a..0a1042e0b6 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-object/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-object/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "emptyWithObject" - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24},"identifierName":"emptyWithObject"}, "name": "emptyWithObject" }, "generator": false, @@ -65,47 +20,14 @@ "params": [ { "type": "RestElement", - "start": 25, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32}}, "argument": { "type": "ArrayPattern", - "start": 28, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":28,"end":32,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":32}}, "elements": [ { "type": "ObjectPattern", - "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}}, "properties": [] } ] @@ -114,18 +36,7 @@ ], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-rest/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-rest/output.json index ff9112b64a..c97e162198 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-rest/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty-with-rest/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "emptyWithRest" - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22},"identifierName":"emptyWithRest"}, "name": "emptyWithRest" }, "generator": false, @@ -65,61 +20,17 @@ "params": [ { "type": "RestElement", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":23,"end":33,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":33}}, "argument": { "type": "ArrayPattern", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":26,"end":33,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":33}}, "elements": [ { "type": "RestElement", - "start": 27, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":27,"end":32,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":32}}, "argument": { "type": "ArrayPattern", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":30,"end":32,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":32}}, "elements": [] } } @@ -129,18 +40,7 @@ ], "body": { "type": "BlockStatement", - "start": 35, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":35,"end":37,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":37}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty/output.json index 10ad99945b..9ec467375c 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-empty/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "empty" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"empty"}, "name": "empty" }, "generator": false, @@ -65,50 +20,17 @@ "params": [ { "type": "RestElement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "argument": { "type": "ArrayPattern", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "elements": [] } } ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/output.json index 2ab16fb389..eaeda97017 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-array/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "id": { "type": "Identifier", - "start": 9, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "multiElementWithArray" - }, + "start":9,"end":30,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":30},"identifierName":"multiElementWithArray"}, "name": "multiElementWithArray" }, "generator": false, @@ -65,114 +20,34 @@ "params": [ { "type": "RestElement", - "start": 31, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":31,"end":47,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":47}}, "argument": { "type": "ArrayPattern", - "start": 34, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":34,"end":47,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":47}}, "elements": [ { "type": "ArrayPattern", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":35,"end":38,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":38}}, "elements": [ { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "a" - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37},"identifierName":"a"}, "name": "a" } ] }, { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "b" - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"b"}, "name": "b" }, { "type": "ArrayPattern", - "start": 43, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":43,"end":46,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":46}}, "elements": [ { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "c" - }, + "start":44,"end":45,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":45},"identifierName":"c"}, "name": "c" } ] @@ -183,18 +58,7 @@ ], "body": { "type": "BlockStatement", - "start": 49, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":49,"end":51,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":51}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-initializer/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-initializer/output.json index 857c56d8be..a7010d53bd 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-initializer/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-initializer/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "program": { "type": "Program", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "id": { "type": "Identifier", - "start": 9, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "multiElementWithInitializer" - }, + "start":9,"end":36,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":36},"identifierName":"multiElementWithInitializer"}, "name": "multiElementWithInitializer" }, "generator": false, @@ -65,78 +20,22 @@ "params": [ { "type": "RestElement", - "start": 37, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":37,"end":57,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":57}}, "argument": { "type": "ArrayPattern", - "start": 40, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":40,"end":57,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":57}}, "elements": [ { "type": "AssignmentPattern", - "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": "a" - }, + "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42},"identifierName":"a"}, "name": "a" }, "right": { "type": "NumericLiteral", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":45,"end":46,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":46}}, "extra": { "rawValue": 0, "raw": "0" @@ -146,66 +45,20 @@ }, { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 49 - }, - "identifierName": "b" - }, + "start":48,"end":49,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":49},"identifierName":"b"}, "name": "b" }, { "type": "AssignmentPattern", - "start": 51, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":51,"end":56,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":56}}, "left": { "type": "Identifier", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 52 - }, - "identifierName": "c" - }, + "start":51,"end":52,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":52},"identifierName":"c"}, "name": "c" }, "right": { "type": "NumericLiteral", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":55,"end":56,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":56}}, "extra": { "rawValue": 1, "raw": "1" @@ -219,18 +72,7 @@ ], "body": { "type": "BlockStatement", - "start": 59, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 59 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":59,"end":61,"loc":{"start":{"line":1,"column":59},"end":{"line":1,"column":61}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-leading/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-leading/output.json index aca1e46181..4a4fb0ec74 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-leading/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-leading/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "id": { "type": "Identifier", - "start": 9, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "multiElementWithLeading" - }, + "start":9,"end":32,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":32},"identifierName":"multiElementWithLeading"}, "name": "multiElementWithLeading" }, "generator": false, @@ -65,116 +20,34 @@ "params": [ { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "x" - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"x"}, "name": "x" }, { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "y" - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37},"identifierName":"y"}, "name": "y" }, { "type": "RestElement", - "start": 39, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":39,"end":51,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":51}}, "argument": { "type": "ArrayPattern", - "start": 42, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":42,"end":51,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":51}}, "elements": [ { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "a" - }, + "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "b" - }, + "start":46,"end":47,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":47},"identifierName":"b"}, "name": "b" }, { "type": "Identifier", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 50 - }, - "identifierName": "c" - }, + "start":49,"end":50,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":50},"identifierName":"c"}, "name": "c" } ] @@ -183,18 +56,7 @@ ], "body": { "type": "BlockStatement", - "start": 53, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":53,"end":55,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":55}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-object/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-object/output.json index e13c89c6e1..61041ac807 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-object/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-object/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "program": { "type": "Program", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":61}}, "id": { "type": "Identifier", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "multiElementWithObject" - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31},"identifierName":"multiElementWithObject"}, "name": "multiElementWithObject" }, "generator": false, @@ -65,97 +20,29 @@ "params": [ { "type": "RestElement", - "start": 32, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":32,"end":57,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":57}}, "argument": { "type": "ArrayPattern", - "start": 35, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":35,"end":57,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":57}}, "elements": [ { "type": "ObjectPattern", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":36,"end":42,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":42}}, "properties": [ { "type": "ObjectProperty", - "start": 37, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":37,"end":41,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":41}}, "method": false, "key": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "p" - }, + "start":37,"end":38,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":38},"identifierName":"p"}, "name": "p" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "q" - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"q"}, "name": "q" } } @@ -163,68 +50,22 @@ }, { "type": "ObjectPattern", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":44,"end":47,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":47}}, "properties": [ { "type": "ObjectProperty", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":45,"end":46,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":46}}, "method": false, "key": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "r" - }, + "start":45,"end":46,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":46},"identifierName":"r"}, "name": "r" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "r" - }, + "start":45,"end":46,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":46},"identifierName":"r"}, "name": "r" }, "extra": { @@ -235,98 +76,30 @@ }, { "type": "ObjectPattern", - "start": 49, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":49,"end":56,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":56}}, "properties": [ { "type": "ObjectProperty", - "start": 50, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":50,"end":55,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":55}}, "method": false, "key": { "type": "Identifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "s" - }, + "start":50,"end":51,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":51},"identifierName":"s"}, "name": "s" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 50, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":50,"end":55,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":55}}, "left": { "type": "Identifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "s" - }, + "start":50,"end":51,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":51},"identifierName":"s"}, "name": "s" }, "right": { "type": "NumericLiteral", - "start": 54, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":54,"end":55,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":55}}, "extra": { "rawValue": 0, "raw": "0" @@ -346,18 +119,7 @@ ], "body": { "type": "BlockStatement", - "start": 59, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 59 - }, - "end": { - "line": 1, - "column": 61 - } - }, + "start":59,"end":61,"loc":{"start":{"line":1,"column":59},"end":{"line":1,"column":61}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-rest/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-rest/output.json index cedea33cfd..6adfc56458 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-rest/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element-with-rest/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "id": { "type": "Identifier", - "start": 9, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "multiElementWithRest" - }, + "start":9,"end":29,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":29},"identifierName":"multiElementWithRest"}, "name": "multiElementWithRest" }, "generator": false, @@ -65,96 +20,27 @@ "params": [ { "type": "RestElement", - "start": 30, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":30,"end":45,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":45}}, "argument": { "type": "ArrayPattern", - "start": 33, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":33,"end":45,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":45}}, "elements": [ { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "a" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "b" - }, + "start":37,"end":38,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":38},"identifierName":"b"}, "name": "b" }, { "type": "RestElement", - "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}}, "argument": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "c" - }, + "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44},"identifierName":"c"}, "name": "c" } } @@ -164,18 +50,7 @@ ], "body": { "type": "BlockStatement", - "start": 47, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":47,"end":49,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":49}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element/output.json index b526e3c8f4..02920dcb39 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-multi-element/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "multiElement" - }, + "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":21},"identifierName":"multiElement"}, "name": "multiElement" }, "generator": false, @@ -65,82 +20,24 @@ "params": [ { "type": "RestElement", - "start": 22, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":22,"end":34,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":34}}, "argument": { "type": "ArrayPattern", - "start": 25, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":25,"end":34,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":34}}, "elements": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "a" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"a"}, "name": "a" }, { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "b" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"b"}, "name": "b" }, { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "c" - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"c"}, "name": "c" } ] @@ -149,18 +46,7 @@ ], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-array/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-array/output.json index 81b1f64042..03f5f76415 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-array/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-array/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "singleElementWithArray" - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31},"identifierName":"singleElementWithArray"}, "name": "singleElementWithArray" }, "generator": false, @@ -65,63 +20,18 @@ "params": [ { "type": "RestElement", - "start": 32, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":32,"end":40,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":40}}, "argument": { "type": "ArrayPattern", - "start": 35, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":35,"end":40,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":40}}, "elements": [ { "type": "ArrayPattern", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":36,"end":39,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":39}}, "elements": [ { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "a" - }, + "start":37,"end":38,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":38},"identifierName":"a"}, "name": "a" } ] @@ -132,18 +42,7 @@ ], "body": { "type": "BlockStatement", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":42,"end":44,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":44}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-initializer/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-initializer/output.json index 0812973f79..9e6cd8f6b1 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-initializer/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-initializer/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "id": { "type": "Identifier", - "start": 9, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "singleElementWithInitializer" - }, + "start":9,"end":37,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":37},"identifierName":"singleElementWithInitializer"}, "name": "singleElementWithInitializer" }, "generator": false, @@ -65,78 +20,22 @@ "params": [ { "type": "RestElement", - "start": 38, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":38,"end":48,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":48}}, "argument": { "type": "ArrayPattern", - "start": 41, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":41,"end":48,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":48}}, "elements": [ { "type": "AssignmentPattern", - "start": 42, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":42,"end":47,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":47}}, "left": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "a" - }, + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"a"}, "name": "a" }, "right": { "type": "NumericLiteral", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":46,"end":47,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":47}}, "extra": { "rawValue": 0, "raw": "0" @@ -150,18 +49,7 @@ ], "body": { "type": "BlockStatement", - "start": 50, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":50,"end":52,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":52}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-leading/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-leading/output.json index 90dd3a2625..3f57651c4a 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-leading/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-leading/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "id": { "type": "Identifier", - "start": 9, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "singleElementWithLeading" - }, + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33},"identifierName":"singleElementWithLeading"}, "name": "singleElementWithLeading" }, "generator": false, @@ -65,65 +20,19 @@ "params": [ { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"x"}, "name": "x" }, { "type": "RestElement", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43}}, "argument": { "type": "ArrayPattern", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":40,"end":43,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":43}}, "elements": [ { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "a" - }, + "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42},"identifierName":"a"}, "name": "a" } ] @@ -132,18 +41,7 @@ ], "body": { "type": "BlockStatement", - "start": 45, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":45,"end":47,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":47}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-object/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-object/output.json index a2863b81f3..231ffe48c2 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-object/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-object/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "id": { "type": "Identifier", - "start": 9, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "singleElementWithObject" - }, + "start":9,"end":32,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":32},"identifierName":"singleElementWithObject"}, "name": "singleElementWithObject" }, "generator": false, @@ -65,97 +20,29 @@ "params": [ { "type": "RestElement", - "start": 33, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":33,"end":44,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":44}}, "argument": { "type": "ArrayPattern", - "start": 36, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":36,"end":44,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":44}}, "elements": [ { "type": "ObjectPattern", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43}}, "properties": [ { "type": "ObjectProperty", - "start": 38, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":38,"end":42,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":42}}, "method": false, "key": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "p" - }, + "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39},"identifierName":"p"}, "name": "p" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "q" - }, + "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42},"identifierName":"q"}, "name": "q" } } @@ -167,18 +54,7 @@ ], "body": { "type": "BlockStatement", - "start": 46, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":46,"end":48,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":48}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-rest/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-rest/output.json index 30f7f46638..a2993761b6 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-rest/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element-with-rest/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 9, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "singleElementWithRest" - }, + "start":9,"end":30,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":30},"identifierName":"singleElementWithRest"}, "name": "singleElementWithRest" }, "generator": false, @@ -65,62 +20,17 @@ "params": [ { "type": "RestElement", - "start": 31, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":31,"end":40,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":40}}, "argument": { "type": "ArrayPattern", - "start": 34, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":34,"end":40,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":40}}, "elements": [ { "type": "RestElement", - "start": 35, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":35,"end":39,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":39}}, "argument": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "a" - }, + "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39},"identifierName":"a"}, "name": "a" } } @@ -130,18 +40,7 @@ ], "body": { "type": "BlockStatement", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":42,"end":44,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":44}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element/output.json index 1e1d390dd1..6ecc2a7294 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/array-pattern-single-element/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":33}}, "id": { "type": "Identifier", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "singleElement" - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22},"identifierName":"singleElement"}, "name": "singleElement" }, "generator": false, @@ -65,48 +20,14 @@ "params": [ { "type": "RestElement", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":23,"end":29,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":29}}, "argument": { "type": "ArrayPattern", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29}}, "elements": [ { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "a" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"a"}, "name": "a" } ] @@ -115,18 +36,7 @@ ], "body": { "type": "BlockStatement", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty-with-array/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty-with-array/output.json index 9b97deac6b..6d666e5a46 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty-with-array/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty-with-array/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "emptyWithArray" - }, + "start":9,"end":23,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":23},"identifierName":"emptyWithArray"}, "name": "emptyWithArray" }, "generator": false, @@ -65,81 +20,25 @@ "params": [ { "type": "RestElement", - "start": 24, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":24,"end":34,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":34}}, "argument": { "type": "ObjectPattern", - "start": 27, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":27,"end":34,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":34}}, "properties": [ { "type": "ObjectProperty", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33}}, "method": false, "key": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "p" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"p"}, "name": "p" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":31,"end":33,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":33}}, "elements": [] } } @@ -149,18 +48,7 @@ ], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty-with-leading/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty-with-leading/output.json index 1dec0f7ede..ef2261c2c2 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty-with-leading/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty-with-leading/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "emptyWithLeading" - }, + "start":9,"end":25,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":25},"identifierName":"emptyWithLeading"}, "name": "emptyWithLeading" }, "generator": false, @@ -65,67 +20,22 @@ "params": [ { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "x" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"x"}, "name": "x" }, { "type": "RestElement", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":29,"end":34,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":34}}, "argument": { "type": "ObjectPattern", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "properties": [] } } ], "body": { "type": "BlockStatement", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":36,"end":38,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":38}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty-with-object/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty-with-object/output.json index 34756c1b31..02d071d323 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty-with-object/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty-with-object/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "emptyWithObject" - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24},"identifierName":"emptyWithObject"}, "name": "emptyWithObject" }, "generator": false, @@ -65,81 +20,25 @@ "params": [ { "type": "RestElement", - "start": 25, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":25,"end":35,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":35}}, "argument": { "type": "ObjectPattern", - "start": 28, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":28,"end":35,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":35}}, "properties": [ { "type": "ObjectProperty", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":29,"end":34,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":34}}, "method": false, "key": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "p" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"p"}, "name": "p" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "properties": [] } } @@ -149,18 +48,7 @@ ], "body": { "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":37,"end":39,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":39}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty/output.json index a8589a5f2d..cd7e8ac5f1 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-empty/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "empty" - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14},"identifierName":"empty"}, "name": "empty" }, "generator": false, @@ -65,50 +20,17 @@ "params": [ { "type": "RestElement", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20}}, "argument": { "type": "ObjectPattern", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "properties": [] } } ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/output.json index ee619e14ad..a9038fabb2 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-array/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "program": { "type": "Program", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "id": { "type": "Identifier", - "start": 9, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "multiElementWithArray" - }, + "start":9,"end":30,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":30},"identifierName":"multiElementWithArray"}, "name": "multiElementWithArray" }, "generator": false, @@ -65,97 +20,29 @@ "params": [ { "type": "RestElement", - "start": 31, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":31,"end":53,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":53}}, "argument": { "type": "ObjectPattern", - "start": 34, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":34,"end":53,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":53}}, "properties": [ { "type": "ObjectProperty", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":35,"end":41,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":41}}, "method": false, "key": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "p" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"p"}, "name": "p" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 38, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":38,"end":41,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":41}}, "elements": [ { "type": "Identifier", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - }, - "identifierName": "a" - }, + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40},"identifierName":"a"}, "name": "a" } ] @@ -163,53 +50,18 @@ }, { "type": "ObjectProperty", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44}}, "method": false, "key": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "b" - }, + "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "b" - }, + "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44},"identifierName":"b"}, "name": "b" }, "extra": { @@ -218,68 +70,22 @@ }, { "type": "ObjectProperty", - "start": 46, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":46,"end":52,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":52}}, "method": false, "key": { "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "q" - }, + "start":46,"end":47,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":47},"identifierName":"q"}, "name": "q" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":49,"end":52,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":52}}, "elements": [ { "type": "Identifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 51 - }, - "identifierName": "c" - }, + "start":50,"end":51,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":51},"identifierName":"c"}, "name": "c" } ] @@ -291,18 +97,7 @@ ], "body": { "type": "BlockStatement", - "start": 55, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":55,"end":57,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":57}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-initializer/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-initializer/output.json index 585a0f4a8a..9dbaf187ba 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-initializer/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-initializer/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 70 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":70}}, "program": { "type": "Program", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 70 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":70}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 70 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":70}}, "id": { "type": "Identifier", - "start": 9, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "multiElementWithInitializer" - }, + "start":9,"end":36,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":36},"identifierName":"multiElementWithInitializer"}, "name": "multiElementWithInitializer" }, "generator": false, @@ -65,112 +20,33 @@ "params": [ { "type": "RestElement", - "start": 37, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 66 - } - }, + "start":37,"end":66,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":66}}, "argument": { "type": "ObjectPattern", - "start": 40, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 66 - } - }, + "start":40,"end":66,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":66}}, "properties": [ { "type": "ObjectProperty", - "start": 41, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":41,"end":49,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":49}}, "method": false, "key": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "a" - }, + "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "AssignmentPattern", - "start": 44, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":44,"end":49,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":49}}, "left": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "r" - }, + "start":44,"end":45,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":45},"identifierName":"r"}, "name": "r" }, "right": { "type": "NumericLiteral", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":48,"end":49,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":49}}, "extra": { "rawValue": 0, "raw": "0" @@ -181,135 +57,43 @@ }, { "type": "ObjectProperty", - "start": 51, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":51,"end":55,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":55}}, "method": false, "key": { "type": "Identifier", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 52 - }, - "identifierName": "b" - }, + "start":51,"end":52,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":52},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 54, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 55 - }, - "identifierName": "s" - }, + "start":54,"end":55,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":55},"identifierName":"s"}, "name": "s" } }, { "type": "ObjectProperty", - "start": 57, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":57,"end":65,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":65}}, "method": false, "key": { "type": "Identifier", - "start": 57, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 58 - }, - "identifierName": "c" - }, + "start":57,"end":58,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":58},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": false, "value": { "type": "AssignmentPattern", - "start": 60, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 60 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":60,"end":65,"loc":{"start":{"line":1,"column":60},"end":{"line":1,"column":65}}, "left": { "type": "Identifier", - "start": 60, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 60 - }, - "end": { - "line": 1, - "column": 61 - }, - "identifierName": "t" - }, + "start":60,"end":61,"loc":{"start":{"line":1,"column":60},"end":{"line":1,"column":61},"identifierName":"t"}, "name": "t" }, "right": { "type": "NumericLiteral", - "start": 64, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 64 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":64,"end":65,"loc":{"start":{"line":1,"column":64},"end":{"line":1,"column":65}}, "extra": { "rawValue": 1, "raw": "1" @@ -324,18 +108,7 @@ ], "body": { "type": "BlockStatement", - "start": 68, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 68 - }, - "end": { - "line": 1, - "column": 70 - } - }, + "start":68,"end":70,"loc":{"start":{"line":1,"column":68},"end":{"line":1,"column":70}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-leading/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-leading/output.json index 0d6e9f64b8..a59cc05c31 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-leading/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-leading/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}}, "program": { "type": "Program", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":64}}, "id": { "type": "Identifier", - "start": 9, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "multiElementWithLeading" - }, + "start":9,"end":32,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":32},"identifierName":"multiElementWithLeading"}, "name": "multiElementWithLeading" }, "generator": false, @@ -65,220 +20,69 @@ "params": [ { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "x" - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"x"}, "name": "x" }, { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "y" - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37},"identifierName":"y"}, "name": "y" }, { "type": "RestElement", - "start": 39, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":39,"end":60,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":60}}, "argument": { "type": "ObjectPattern", - "start": 42, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 60 - } - }, + "start":42,"end":60,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":60}}, "properties": [ { "type": "ObjectProperty", - "start": 43, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":43,"end":47,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":47}}, "method": false, "key": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "a" - }, + "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "r" - }, + "start":46,"end":47,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":47},"identifierName":"r"}, "name": "r" } }, { "type": "ObjectProperty", - "start": 49, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":49,"end":53,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":53}}, "method": false, "key": { "type": "Identifier", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 50 - }, - "identifierName": "b" - }, + "start":49,"end":50,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":50},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 53 - }, - "identifierName": "s" - }, + "start":52,"end":53,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":53},"identifierName":"s"}, "name": "s" } }, { "type": "ObjectProperty", - "start": 55, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":55,"end":59,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":59}}, "method": false, "key": { "type": "Identifier", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 56 - }, - "identifierName": "c" - }, + "start":55,"end":56,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":56},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 58, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 58 - }, - "end": { - "line": 1, - "column": 59 - }, - "identifierName": "t" - }, + "start":58,"end":59,"loc":{"start":{"line":1,"column":58},"end":{"line":1,"column":59},"identifierName":"t"}, "name": "t" } } @@ -288,18 +92,7 @@ ], "body": { "type": "BlockStatement", - "start": 62, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 62 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":62,"end":64,"loc":{"start":{"line":1,"column":62},"end":{"line":1,"column":64}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-object/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-object/output.json index 4bca07d43f..c42f82ea12 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-object/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element-with-object/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 70 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":70}}, "program": { "type": "Program", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 70 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":70}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 70 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":70}}, "id": { "type": "Identifier", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "multiElementWithObject" - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31},"identifierName":"multiElementWithObject"}, "name": "multiElementWithObject" }, "generator": false, @@ -65,131 +20,40 @@ "params": [ { "type": "RestElement", - "start": 32, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 66 - } - }, + "start":32,"end":66,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":66}}, "argument": { "type": "ObjectPattern", - "start": 35, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 66 - } - }, + "start":35,"end":66,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":66}}, "properties": [ { "type": "ObjectProperty", - "start": 36, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":36,"end":45,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":45}}, "method": false, "key": { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "a" - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 39, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":39,"end":45,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":45}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "p" - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"p"}, "name": "p" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "q" - }, + "start":43,"end":44,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":44},"identifierName":"q"}, "name": "q" } } @@ -198,102 +62,33 @@ }, { "type": "ObjectProperty", - "start": 47, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":47,"end":53,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":53}}, "method": false, "key": { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "b" - }, + "start":47,"end":48,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":48},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 50, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 53 - } - }, + "start":50,"end":53,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":53}}, "properties": [ { "type": "ObjectProperty", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":51,"end":52,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":52}}, "method": false, "key": { "type": "Identifier", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 52 - }, - "identifierName": "r" - }, + "start":51,"end":52,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":52},"identifierName":"r"}, "name": "r" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 52 - }, - "identifierName": "r" - }, + "start":51,"end":52,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":52},"identifierName":"r"}, "name": "r" }, "extra": { @@ -305,132 +100,41 @@ }, { "type": "ObjectProperty", - "start": 55, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":55,"end":65,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":65}}, "method": false, "key": { "type": "Identifier", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 55 - }, - "end": { - "line": 1, - "column": 56 - }, - "identifierName": "c" - }, + "start":55,"end":56,"loc":{"start":{"line":1,"column":55},"end":{"line":1,"column":56},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 58, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 58 - }, - "end": { - "line": 1, - "column": 65 - } - }, + "start":58,"end":65,"loc":{"start":{"line":1,"column":58},"end":{"line":1,"column":65}}, "properties": [ { "type": "ObjectProperty", - "start": 59, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 59 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":59,"end":64,"loc":{"start":{"line":1,"column":59},"end":{"line":1,"column":64}}, "method": false, "key": { "type": "Identifier", - "start": 59, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 59 - }, - "end": { - "line": 1, - "column": 60 - }, - "identifierName": "s" - }, + "start":59,"end":60,"loc":{"start":{"line":1,"column":59},"end":{"line":1,"column":60},"identifierName":"s"}, "name": "s" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 59, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 59 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":59,"end":64,"loc":{"start":{"line":1,"column":59},"end":{"line":1,"column":64}}, "left": { "type": "Identifier", - "start": 59, - "end": 60, - "loc": { - "start": { - "line": 1, - "column": 59 - }, - "end": { - "line": 1, - "column": 60 - }, - "identifierName": "s" - }, + "start":59,"end":60,"loc":{"start":{"line":1,"column":59},"end":{"line":1,"column":60},"identifierName":"s"}, "name": "s" }, "right": { "type": "NumericLiteral", - "start": 63, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 63 - }, - "end": { - "line": 1, - "column": 64 - } - }, + "start":63,"end":64,"loc":{"start":{"line":1,"column":63},"end":{"line":1,"column":64}}, "extra": { "rawValue": 0, "raw": "0" @@ -451,18 +155,7 @@ ], "body": { "type": "BlockStatement", - "start": 68, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 68 - }, - "end": { - "line": 1, - "column": 70 - } - }, + "start":68,"end":70,"loc":{"start":{"line":1,"column":68},"end":{"line":1,"column":70}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element/output.json index 2df38bfb4c..b3302e7b3a 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-multi-element/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "id": { "type": "Identifier", - "start": 9, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "multiElement" - }, + "start":9,"end":21,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":21},"identifierName":"multiElement"}, "name": "multiElement" }, "generator": false, @@ -65,186 +20,59 @@ "params": [ { "type": "RestElement", - "start": 22, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":22,"end":43,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":43}}, "argument": { "type": "ObjectPattern", - "start": 25, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":25,"end":43,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":43}}, "properties": [ { "type": "ObjectProperty", - "start": 26, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":26,"end":30,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":30}}, "method": false, "key": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "a" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "r" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"r"}, "name": "r" } }, { "type": "ObjectProperty", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":32,"end":36,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":36}}, "method": false, "key": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "b" - }, + "start":32,"end":33,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":33},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "s" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"s"}, "name": "s" } }, { "type": "ObjectProperty", - "start": 38, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":38,"end":42,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":42}}, "method": false, "key": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "c" - }, + "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39},"identifierName":"c"}, "name": "c" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "t" - }, + "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42},"identifierName":"t"}, "name": "t" } } @@ -254,18 +82,7 @@ ], "body": { "type": "BlockStatement", - "start": 45, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":45,"end":47,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":47}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/output.json index 394be5e8a8..0311fd5cab 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-array/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "id": { "type": "Identifier", - "start": 9, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "singleElementWithArray" - }, + "start":9,"end":31,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":31},"identifierName":"singleElementWithArray"}, "name": "singleElementWithArray" }, "generator": false, @@ -65,97 +20,29 @@ "params": [ { "type": "RestElement", - "start": 32, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":32,"end":43,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":43}}, "argument": { "type": "ObjectPattern", - "start": 35, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":35,"end":43,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":43}}, "properties": [ { "type": "ObjectProperty", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":36,"end":42,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":42}}, "method": false, "key": { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "p" - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37},"identifierName":"p"}, "name": "p" }, "computed": false, "shorthand": false, "value": { "type": "ArrayPattern", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":39,"end":42,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":42}}, "elements": [ { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "a" - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"a"}, "name": "a" } ] @@ -167,18 +54,7 @@ ], "body": { "type": "BlockStatement", - "start": 45, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":45,"end":47,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":47}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/output.json index 20ac2d6fcb..23f152c7a9 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-initializer/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "id": { "type": "Identifier", - "start": 9, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "singleElementWithInitializer" - }, + "start":9,"end":37,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":37},"identifierName":"singleElementWithInitializer"}, "name": "singleElementWithInitializer" }, "generator": false, @@ -65,112 +20,33 @@ "params": [ { "type": "RestElement", - "start": 38, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":38,"end":51,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":51}}, "argument": { "type": "ObjectPattern", - "start": 41, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":41,"end":51,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":51}}, "properties": [ { "type": "ObjectProperty", - "start": 42, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":42,"end":50,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":50}}, "method": false, "key": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "a" - }, + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "AssignmentPattern", - "start": 45, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":45,"end":50,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":50}}, "left": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "b" - }, + "start":45,"end":46,"loc":{"start":{"line":1,"column":45},"end":{"line":1,"column":46},"identifierName":"b"}, "name": "b" }, "right": { "type": "NumericLiteral", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":49,"end":50,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":50}}, "extra": { "rawValue": 0, "raw": "0" @@ -185,18 +61,7 @@ ], "body": { "type": "BlockStatement", - "start": 53, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":53,"end":55,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":55}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-leading/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-leading/output.json index 6a8dc5942e..ca789048f3 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-leading/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-leading/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":50}}, "id": { "type": "Identifier", - "start": 9, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "singleElementWithLeading" - }, + "start":9,"end":33,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":33},"identifierName":"singleElementWithLeading"}, "name": "singleElementWithLeading" }, "generator": false, @@ -65,99 +20,30 @@ "params": [ { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "x" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"x"}, "name": "x" }, { "type": "RestElement", - "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}}, "argument": { "type": "ObjectPattern", - "start": 40, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":40,"end":46,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":46}}, "properties": [ { "type": "ObjectProperty", - "start": 41, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":41,"end":45,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":45}}, "method": false, "key": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "a" - }, + "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "b" - }, + "start":44,"end":45,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":45},"identifierName":"b"}, "name": "b" } } @@ -167,18 +53,7 @@ ], "body": { "type": "BlockStatement", - "start": 48, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":48,"end":50,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":50}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-object/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-object/output.json index aed5cd10d4..8612e11a8c 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-object/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element-with-object/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "id": { "type": "Identifier", - "start": 9, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 32 - }, - "identifierName": "singleElementWithObject" - }, + "start":9,"end":32,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":32},"identifierName":"singleElementWithObject"}, "name": "singleElementWithObject" }, "generator": false, @@ -65,131 +20,40 @@ "params": [ { "type": "RestElement", - "start": 33, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":33,"end":47,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":47}}, "argument": { "type": "ObjectPattern", - "start": 36, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":36,"end":47,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":47}}, "properties": [ { "type": "ObjectProperty", - "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}}, "method": false, "key": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "p" - }, + "start":37,"end":38,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":38},"identifierName":"p"}, "name": "p" }, "computed": false, "shorthand": false, "value": { "type": "ObjectPattern", - "start": 40, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":40,"end":46,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":46}}, "properties": [ { "type": "ObjectProperty", - "start": 41, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":41,"end":45,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":45}}, "method": false, "key": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 42 - }, - "identifierName": "a" - }, + "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "b" - }, + "start":44,"end":45,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":45},"identifierName":"b"}, "name": "b" } } @@ -202,18 +66,7 @@ ], "body": { "type": "BlockStatement", - "start": 49, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":49,"end":51,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":51}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element/output.json b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element/output.json index bc637103ee..f211a830b4 100644 --- a/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element/output.json +++ b/packages/babel-parser/test/fixtures/test262/rest-parameter/object-pattern-single-element/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "singleElement" - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22},"identifierName":"singleElement"}, "name": "singleElement" }, "generator": false, @@ -65,82 +20,25 @@ "params": [ { "type": "RestElement", - "start": 23, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":23,"end":32,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":32}}, "argument": { "type": "ObjectPattern", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":26,"end":32,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":32}}, "properties": [ { "type": "ObjectProperty", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":27,"end":31,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":31}}, "method": false, "key": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "a" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "b" - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"b"}, "name": "b" } } @@ -150,18 +48,7 @@ ], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":34,"end":36,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":36}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/annotated/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/annotated/output.json index 10d41548ff..21c9d62bc3 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/annotated/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/annotated/output.json @@ -1,90 +1,24 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "returnType": { "type": "TSTypeAnnotation", - "start": 11, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":11,"end":19,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":19}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}} } }, "id": null, @@ -93,67 +27,21 @@ "params": [ { "type": "Identifier", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 2, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":2,"end":10,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":10}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - } + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}} } } } ], "body": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/arrow-function-with-newline/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/arrow-function-with-newline/output.json index 01a056dd18..a8a69e55bf 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/arrow-function-with-newline/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/arrow-function-with-newline/output.json @@ -1,105 +1,27 @@ { "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "returnType": { "type": "TSTypeAnnotation", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":10,"end":13,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3}}, "typeName": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "t" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"t"}, "name": "t" } } @@ -110,36 +32,13 @@ "params": [ { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "f" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"f"}, "name": "f" } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":10}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/async-await-null/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/async-await-null/output.json index 8af1eae03c..980a142db1 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/async-await-null/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/async-await-null/output.json @@ -1,91 +1,25 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9}}, "params": [ { "type": "TSTypeParameter", - "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}}, "name": "T" } ] @@ -96,32 +30,10 @@ "async": true, "body": { "type": "AwaitExpression", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":15,"end":25,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":25}}, "argument": { "type": "NullLiteral", - "start": 21, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":21,"end":25,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":25}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/async-generic-after-await/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/async-generic-after-await/output.json index d3320bb415..f038e122ec 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/async-generic-after-await/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/async-generic-after-await/output.json @@ -1,183 +1,51 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 2 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":2}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": null, "generator": false, "async": true, "params": [], "body": { "type": "BlockStatement", - "start": 12, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":12,"end":52,"loc":{"start":{"line":1,"column":12},"end":{"line":4,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":16,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "expression": { "type": "AwaitExpression", - "start": 16, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":16,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "argument": { "type": "NullLiteral", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 12 - } - } + "start":22,"end":26,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":12}} } } }, { "type": "ExpressionStatement", - "start": 30, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":30,"end":50,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":22}}, "expression": { "type": "ArrowFunctionExpression", - "start": 30, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":30,"end":49,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":21}}, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":36,"end":39,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":11}}, "params": [ { "type": "TSTypeParameter", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":37,"end":38,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, "name": "T" } ] @@ -188,18 +56,7 @@ "async": true, "body": { "type": "NullLiteral", - "start": 45, - "end": 49, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 21 - } - } + "start":45,"end":49,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":21}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/async-generic-false-positive/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/async-generic-false-positive/output.json index b28655fb55..90c2313f7b 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/async-generic-false-positive/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/async-generic-false-positive/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 5, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "async" - }, + "start":0,"end":5,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":5},"identifierName":"async"}, "name": "async" }, "operator": "<", "right": { "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": 1, "raw": "1" @@ -99,108 +32,29 @@ }, { "type": "ExpressionStatement", - "start": 11, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":11,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "expression": { "type": "BinaryExpression", - "start": 11, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":11,"end":26,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":15}}, "left": { "type": "CallExpression", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":11,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "callee": { "type": "Identifier", - "start": 11, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "async" - }, + "start":11,"end":16,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5},"identifierName":"async"}, "name": "async" }, "arguments": [], "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":19,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8}}, "params": [ { "type": "TSTypeReference", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "typeName": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "T" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"T"}, "name": "T" } } @@ -210,18 +64,7 @@ "operator": "==", "right": { "type": "NumericLiteral", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/async-generic-tokens-true/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/async-generic-tokens-true/output.json index aa657ee84f..13a2d47498 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/async-generic-tokens-true/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/async-generic-tokens-true/output.json @@ -1,91 +1,25 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9}}, "params": [ { "type": "TSTypeParameter", - "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}}, "name": "T" } ] @@ -93,63 +27,17 @@ "params": [ { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "a" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "typeAnnotation": { "type": "TSTypeReference", - "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}}, "typeName": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"T"}, "name": "T" } } @@ -158,47 +46,13 @@ ], "returnType": { "type": "TSTypeAnnotation", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "typeName": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "T" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"T"}, "name": "T" } } @@ -208,19 +62,7 @@ "async": true, "body": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "a" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"a"}, "name": "a" } } @@ -242,18 +84,7 @@ "binop": null }, "value": "async", - "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}} }, { "type": { @@ -269,18 +100,7 @@ "updateContext": null }, "value": "<", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} }, { "type": { @@ -295,18 +115,7 @@ "binop": null }, "value": "T", - "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}} }, { "type": { @@ -322,18 +131,7 @@ "updateContext": null }, "value": ">", - "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}} }, { "type": { @@ -347,18 +145,7 @@ "postfix": false, "binop": null }, - "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}} }, { "type": { @@ -373,18 +160,7 @@ "binop": null }, "value": "a", - "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}} }, { "type": { @@ -399,18 +175,7 @@ "binop": null, "updateContext": null }, - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - } + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}} }, { "type": { @@ -425,18 +190,7 @@ "binop": null }, "value": "T", - "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}} }, { "type": { @@ -450,18 +204,7 @@ "postfix": false, "binop": null }, - "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}} }, { "type": { @@ -476,18 +219,7 @@ "binop": null, "updateContext": null }, - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - } + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}} }, { "type": { @@ -502,18 +234,7 @@ "binop": null }, "value": "T", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}} }, { "type": { @@ -528,18 +249,7 @@ "binop": null, "updateContext": null }, - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}} }, { "type": { @@ -554,18 +264,7 @@ "binop": null }, "value": "a", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}} }, { "type": { @@ -580,18 +279,7 @@ "binop": null, "updateContext": null }, - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}} }, { "type": { @@ -606,18 +294,7 @@ "binop": null, "updateContext": null }, - "start": 24, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":24,"end":24,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":24}} } ] -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/async-rest-optional-parameter/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/async-rest-optional-parameter/output.json index 816c9ca280..248e37e2e4 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/async-rest-optional-parameter/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/async-rest-optional-parameter/output.json @@ -1,90 +1,24 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "returnType": { "type": "TSTypeAnnotation", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":25,"end":28,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":28}} } }, "id": null, @@ -93,78 +27,22 @@ "params": [ { "type": "RestElement", - "start": 6, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":6,"end":21,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":21}}, "argument": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "args" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"args"}, "name": "args" }, "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 14, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":14,"end":21,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "TSArrayType", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "elementType": { "type": "TSAnyKeyword", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}} } } } @@ -172,18 +50,7 @@ ], "body": { "type": "BlockStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/async-rest/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/async-rest/output.json index eca1eab06f..9d9669f8ab 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/async-rest/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/async-rest/output.json @@ -1,90 +1,24 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "returnType": { "type": "TSTypeAnnotation", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":23,"end":28,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":28}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":25,"end":28,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":28}} } }, "id": null, @@ -93,77 +27,21 @@ "params": [ { "type": "RestElement", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "argument": { "type": "Identifier", - "start": 10, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "args" - }, + "start":10,"end":14,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":14},"identifierName":"args"}, "name": "args" }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 14, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":14,"end":21,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "TSArrayType", - "start": 16, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":16,"end":21,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":21}}, "elementType": { "type": "TSAnyKeyword", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}} } } } @@ -171,18 +49,7 @@ ], "body": { "type": "BlockStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/async/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/async/output.json index f4c66f0f4b..24454f584a 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/async/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/async/output.json @@ -1,90 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "returnType": { "type": "TSTypeAnnotation", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":18,"end":23,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23}} } }, "id": null, @@ -93,68 +27,22 @@ "params": [ { "type": "Identifier", - "start": 7, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "x" - }, + "start":7,"end":17,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":17},"identifierName":"x"}, "name": "x", "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}} } } } ], "body": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "x" - }, + "start":27,"end":28,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":28},"identifierName":"x"}, "name": "x" } } diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/default-parameter-values/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/default-parameter-values/output.json index e8a5f05eb6..1fc04d4b7d 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/default-parameter-values/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/default-parameter-values/output.json @@ -1,141 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "AssignmentPattern", - "start": 1, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":1,"end":14,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":14}}, "left": { "type": "Identifier", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "x" - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 2, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":2,"end":10,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":10}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - } + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}} } } }, "right": { "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": 0, "raw": "0" @@ -146,18 +46,7 @@ ], "body": { "type": "NumericLiteral", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/destructuring/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/destructuring/output.json index 9d4940d162..6cfc4d9f20 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/destructuring/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/destructuring/output.json @@ -1,160 +1,48 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "ObjectPattern", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10}}, "properties": [ { "type": "ObjectProperty", - "start": 3, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":3,"end":8,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":8}}, "method": false, "key": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "a" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": true, "value": { "type": "AssignmentPattern", - "start": 3, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":3,"end":8,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":8}}, "left": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "a" - }, + "start":3,"end":4,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":4},"identifierName":"a"}, "name": "a" }, "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": 0, "raw": "0" @@ -171,18 +59,7 @@ ], "body": { "type": "NumericLiteral", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "extra": { "rawValue": 0, "raw": "0" 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 58c3d96721..2d19c9f092 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 @@ -1,105 +1,27 @@ { "type": "File", - "start": 0, - "end": 79, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":79,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 79, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":79,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 61, - "end": 79, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":61,"end":79,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "expression": { "type": "ArrowFunctionExpression", - "start": 61, - "end": 78, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":61,"end":78,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "returnType": { "type": "TSTypeAnnotation", - "start": 70, - "end": 73, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":70,"end":73,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 72, - "end": 73, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":72,"end":73,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12}}, "typeName": { "type": "Identifier", - "start": 72, - "end": 73, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "T" - }, + "start":72,"end":73,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"T"}, "name": "T" } } @@ -110,63 +32,17 @@ "params": [ { "type": "Identifier", - "start": 65, - "end": 69, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "a" - }, + "start":65,"end":69,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":8},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 66, - "end": 69, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":66,"end":69,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 68, - "end": 69, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":68,"end":69,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8}}, "typeName": { "type": "Identifier", - "start": 68, - "end": 69, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "T" - }, + "start":68,"end":69,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"T"}, "name": "T" } } @@ -175,50 +51,16 @@ ], "body": { "type": "Identifier", - "start": 77, - "end": 78, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "a" - }, + "start":77,"end":78,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"a"}, "name": "a" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 61, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":61,"end":64,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "params": [ { "type": "TSTypeParameter", - "start": 62, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":62,"end":63,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":2}}, "name": "T" } ] @@ -228,18 +70,7 @@ { "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 - } - } + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":60}} } ] } @@ -250,18 +81,7 @@ { "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 - } - } + "start":0,"end":60,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":60}} } ] -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/generic/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/generic/output.json index 1f99918b7a..53c4a1b036 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/generic/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/generic/output.json @@ -1,105 +1,27 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "returnType": { "type": "TSTypeAnnotation", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "typeName": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "T" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"T"}, "name": "T" } } @@ -110,63 +32,17 @@ "params": [ { "type": "Identifier", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "typeAnnotation": { "type": "TSTypeReference", - "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}}, "typeName": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "T" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"T"}, "name": "T" } } @@ -175,50 +51,16 @@ ], "body": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "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}}, "params": [ { "type": "TSTypeParameter", - "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}}, "name": "T" } ] @@ -228,4 +70,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/optional-parameter/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/optional-parameter/output.json index 3a08e42c86..61083fd0e7 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/optional-parameter/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/optional-parameter/output.json @@ -1,90 +1,24 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "returnType": { "type": "TSTypeAnnotation", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}} } }, "id": null, @@ -93,183 +27,58 @@ "params": [ { "type": "Identifier", - "start": 1, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x", "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 3, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":3,"end":11,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":11}}, "typeAnnotation": { "type": "TSNumberKeyword", - "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}} } } } ], "body": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"x"}, "name": "x" } } }, { "type": "ExpressionStatement", - "start": 24, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":24,"end":42,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "expression": { "type": "CallExpression", - "start": 24, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":24,"end":41,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "callee": { "type": "ArrowFunctionExpression", - "start": 25, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":25,"end":38,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":14}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "k" - }, + "start":26,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4},"identifierName":"k"}, "name": "k", "optional": true } ], "body": { "type": "BinaryExpression", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":33,"end":38,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":14}}, "left": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "k" - }, + "start":33,"end":34,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"k"}, "name": "k" }, "operator": "+", "right": { "type": "NumericLiteral", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":37,"end":38,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/typescript/arrow-function/predicate-types/output.json b/packages/babel-parser/test/fixtures/typescript/arrow-function/predicate-types/output.json index 45239b7a0c..4cc69d94f7 100644 --- a/packages/babel-parser/test/fixtures/typescript/arrow-function/predicate-types/output.json +++ b/packages/babel-parser/test/fixtures/typescript/arrow-function/predicate-types/output.json @@ -1,135 +1,35 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "returnType": { "type": "TSTypeAnnotation", - "start": 8, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":8,"end":21,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 8, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":8,"end":21,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":21}}, "parameterName": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 21 - } - } + "start":15,"end":21,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":21}} } } } @@ -140,66 +40,21 @@ "params": [ { "type": "Identifier", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - } + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}} } } } ], "body": { "type": "BooleanLiteral", - "start": 25, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":25,"end":29,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":29}}, "value": true } } diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/output.json index f062584092..5c2fb6c0f6 100644 --- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/output.json +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/arrow-function/output.json @@ -1,167 +1,44 @@ { "type": "File", - "start": 0, - "end": 165, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 47 - } - }, + "start":0,"end":165,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":47}}, "program": { "type": "Program", - "start": 0, - "end": 165, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 47 - } - }, + "start":0,"end":165,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":47}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":6,"end":63,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":63}}, "id": { "type": "Identifier", - "start": 6, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "assert1" - }, + "start":6,"end":13,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":13},"identifierName":"assert1"}, "name": "assert1" }, "init": { "type": "ArrowFunctionExpression", - "start": 16, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":16,"end":63,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":63}}, "returnType": { "type": "TSTypeAnnotation", - "start": 32, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":32,"end":57,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":57}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 32, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":32,"end":57,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":57}}, "parameterName": { "type": "Identifier", - "start": 42, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "value" - }, + "start":42,"end":47,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":47},"identifierName":"value"}, "name": "value" }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 51, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":51,"end":57,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":57}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 51, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 57 - } - } + "start":51,"end":57,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":57}} } }, "asserts": true @@ -173,66 +50,21 @@ "params": [ { "type": "Identifier", - "start": 17, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "value" - }, + "start":17,"end":31,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":31},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 22, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":22,"end":31,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":31}}, "typeAnnotation": { "type": "TSUnknownKeyword", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 31 - } - } + "start":24,"end":31,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":31}} } } } ], "body": { "type": "BlockStatement", - "start": 61, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 61 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":61,"end":63,"loc":{"start":{"line":1,"column":61},"end":{"line":1,"column":63}}, "body": [], "directives": [] } @@ -243,107 +75,28 @@ }, { "type": "VariableDeclaration", - "start": 64, - "end": 117, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 53 - } - }, + "start":64,"end":117,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":53}}, "declarations": [ { "type": "VariableDeclarator", - "start": 70, - "end": 117, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 53 - } - }, + "start":70,"end":117,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":53}}, "id": { "type": "Identifier", - "start": 70, - "end": 77, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "assert2" - }, + "start":70,"end":77,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":13},"identifierName":"assert2"}, "name": "assert2" }, "init": { "type": "ArrowFunctionExpression", - "start": 80, - "end": 117, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 53 - } - }, + "start":80,"end":117,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":53}}, "returnType": { "type": "TSTypeAnnotation", - "start": 96, - "end": 111, - "loc": { - "start": { - "line": 2, - "column": 32 - }, - "end": { - "line": 2, - "column": 47 - } - }, + "start":96,"end":111,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":47}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 96, - "end": 111, - "loc": { - "start": { - "line": 2, - "column": 32 - }, - "end": { - "line": 2, - "column": 47 - } - }, + "start":96,"end":111,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":47}}, "parameterName": { "type": "Identifier", - "start": 106, - "end": 111, - "loc": { - "start": { - "line": 2, - "column": 42 - }, - "end": { - "line": 2, - "column": 47 - }, - "identifierName": "value" - }, + "start":106,"end":111,"loc":{"start":{"line":2,"column":42},"end":{"line":2,"column":47},"identifierName":"value"}, "name": "value" }, "asserts": true @@ -355,66 +108,21 @@ "params": [ { "type": "Identifier", - "start": 81, - "end": 95, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 31 - }, - "identifierName": "value" - }, + "start":81,"end":95,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":31},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 86, - "end": 95, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":86,"end":95,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":31}}, "typeAnnotation": { "type": "TSUnknownKeyword", - "start": 88, - "end": 95, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 31 - } - } + "start":88,"end":95,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":31}} } } } ], "body": { "type": "BlockStatement", - "start": 115, - "end": 117, - "loc": { - "start": { - "line": 2, - "column": 51 - }, - "end": { - "line": 2, - "column": 53 - } - }, + "start":115,"end":117,"loc":{"start":{"line":2,"column":51},"end":{"line":2,"column":53}}, "body": [], "directives": [] } @@ -425,107 +133,28 @@ }, { "type": "VariableDeclaration", - "start": 118, - "end": 165, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 47 - } - }, + "start":118,"end":165,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":47}}, "declarations": [ { "type": "VariableDeclarator", - "start": 124, - "end": 165, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 47 - } - }, + "start":124,"end":165,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":47}}, "id": { "type": "Identifier", - "start": 124, - "end": 131, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "assert3" - }, + "start":124,"end":131,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":13},"identifierName":"assert3"}, "name": "assert3" }, "init": { "type": "ArrowFunctionExpression", - "start": 134, - "end": 165, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 47 - } - }, + "start":134,"end":165,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":47}}, "returnType": { "type": "TSTypeAnnotation", - "start": 150, - "end": 159, - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":150,"end":159,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":41}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 152, - "end": 159, - "loc": { - "start": { - "line": 3, - "column": 34 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":152,"end":159,"loc":{"start":{"line":3,"column":34},"end":{"line":3,"column":41}}, "typeName": { "type": "Identifier", - "start": 152, - "end": 159, - "loc": { - "start": { - "line": 3, - "column": 34 - }, - "end": { - "line": 3, - "column": 41 - }, - "identifierName": "asserts" - }, + "start":152,"end":159,"loc":{"start":{"line":3,"column":34},"end":{"line":3,"column":41},"identifierName":"asserts"}, "name": "asserts" } } @@ -536,66 +165,21 @@ "params": [ { "type": "Identifier", - "start": 135, - "end": 149, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 31 - }, - "identifierName": "value" - }, + "start":135,"end":149,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":31},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 140, - "end": 149, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 31 - } - }, + "start":140,"end":149,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":31}}, "typeAnnotation": { "type": "TSUnknownKeyword", - "start": 142, - "end": 149, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 31 - } - } + "start":142,"end":149,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":31}} } } } ], "body": { "type": "BlockStatement", - "start": 163, - "end": 165, - "loc": { - "start": { - "line": 3, - "column": 45 - }, - "end": { - "line": 3, - "column": 47 - } - }, + "start":163,"end":165,"loc":{"start":{"line":3,"column":45},"end":{"line":3,"column":47}}, "body": [], "directives": [] } @@ -607,4 +191,4 @@ ], "directives": [] } -} +} \ No newline at end of file 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 dc6f8702bd..6fe5b08735 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "program": { "type": "Program", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSDeclareFunction", - "start": 0, - "end": 57, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 57 - } - }, + "start":0,"end":57,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":57}}, "id": { "type": "Identifier", - "start": 17, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "assertIsString" - }, + "start":17,"end":31,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":31},"identifierName":"assertIsString"}, "name": "assertIsString" }, "generator": false, @@ -65,95 +20,27 @@ "params": [ { "type": "Identifier", - "start": 32, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "value" - }, + "start":32,"end":46,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":46},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TSTypeAnnotation", - "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}}, "typeAnnotation": { "type": "TSUnknownKeyword", - "start": 39, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 46 - } - } + "start":39,"end":46,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":46}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 47, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":47,"end":56,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":56}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 49, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":49,"end":56,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":56}}, "typeName": { "type": "Identifier", - "start": 49, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 56 - }, - "identifierName": "asserts" - }, + "start":49,"end":56,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":56},"identifierName":"asserts"}, "name": "asserts" } } 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 bed7e168b3..a98a1eefa2 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 @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":10,"end":87,"loc":{"start":{"line":1,"column":10},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":14,"end":45,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":33}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "isBar" - }, + "start":14,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7},"identifierName":"isBar"}, "name": "isBar" }, "computed": false, @@ -116,90 +37,23 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 21, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":21,"end":42,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":30}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 31, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":31,"end":42,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":30}}, "parameterName": { "type": "TSThisType", - "start": 31, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 23 - } - } + "start":31,"end":35,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":23}} }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":39,"end":42,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":30}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":39,"end":42,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":30}}, "typeName": { "type": "Identifier", - "start": 39, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 30 - }, - "identifierName": "Foo" - }, + "start":39,"end":42,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":30},"identifierName":"Foo"}, "name": "Foo" } } @@ -209,155 +63,43 @@ }, "body": { "type": "BlockStatement", - "start": 43, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 31 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":43,"end":45,"loc":{"start":{"line":2,"column":31},"end":{"line":2,"column":33}}, "body": [], "directives": [] } }, { "type": "ClassProperty", - "start": 48, - "end": 85, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":48,"end":85,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":39}}, "static": false, "key": { "type": "Identifier", - "start": 48, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "isBaz" - }, + "start":48,"end":53,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":7},"identifierName":"isBaz"}, "name": "isBaz" }, "computed": false, "value": { "type": "ArrowFunctionExpression", - "start": 56, - "end": 85, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":56,"end":85,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":39}}, "returnType": { "type": "TSTypeAnnotation", - "start": 58, - "end": 79, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 33 - } - }, + "start":58,"end":79,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":33}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 68, - "end": 79, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 33 - } - }, + "start":68,"end":79,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":33}}, "parameterName": { "type": "TSThisType", - "start": 68, - "end": 72, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 26 - } - } + "start":68,"end":72,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":26}} }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 76, - "end": 79, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 33 - } - }, + "start":76,"end":79,"loc":{"start":{"line":3,"column":30},"end":{"line":3,"column":33}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 76, - "end": 79, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 33 - } - }, + "start":76,"end":79,"loc":{"start":{"line":3,"column":30},"end":{"line":3,"column":33}}, "typeName": { "type": "Identifier", - "start": 76, - "end": 79, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 33 - }, - "identifierName": "Foo" - }, + "start":76,"end":79,"loc":{"start":{"line":3,"column":30},"end":{"line":3,"column":33},"identifierName":"Foo"}, "name": "Foo" } } @@ -371,18 +113,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 83, - "end": 85, - "loc": { - "start": { - "line": 3, - "column": 37 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":83,"end":85,"loc":{"start":{"line":3,"column":37},"end":{"line":3,"column":39}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this/output.json index e9d5458c1c..46971ca25c 100644 --- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this/output.json +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-this/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":35,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":12,"end":32,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":22}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "m" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"m"}, "name": "m" }, "computed": false, @@ -116,64 +37,20 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":15,"end":29,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":19}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":15,"end":29,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":19}}, "parameterName": { "type": "TSThisType", - "start": 25, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 19 - } - } + "start":25,"end":29,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":19}} }, "asserts": true } }, "body": { "type": "BlockStatement", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":30,"end":32,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":22}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var-with-predicate/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var-with-predicate/output.json index f63a5e0581..b356931f8a 100644 --- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var-with-predicate/output.json +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var-with-predicate/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":72,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":72,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":72,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":72,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 60 - } - }, + "start":12,"end":70,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":60}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "assertIsString" - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16},"identifierName":"assertIsString"}, "name": "assertIsString" }, "computed": false, @@ -116,125 +37,35 @@ "params": [ { "type": "Identifier", - "start": 27, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 31 - }, - "identifierName": "value" - }, + "start":27,"end":41,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":31},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":32,"end":41,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":31}}, "typeAnnotation": { "type": "TSUnknownKeyword", - "start": 34, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 31 - } - } + "start":34,"end":41,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":31}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 42, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 32 - }, - "end": { - "line": 2, - "column": 57 - } - }, + "start":42,"end":67,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":57}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 42, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 32 - }, - "end": { - "line": 2, - "column": 57 - } - }, + "start":42,"end":67,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":57}}, "parameterName": { "type": "Identifier", - "start": 52, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 42 - }, - "end": { - "line": 2, - "column": 47 - }, - "identifierName": "value" - }, + "start":52,"end":57,"loc":{"start":{"line":2,"column":42},"end":{"line":2,"column":47},"identifierName":"value"}, "name": "value" }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 61, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 51 - }, - "end": { - "line": 2, - "column": 57 - } - }, + "start":61,"end":67,"loc":{"start":{"line":2,"column":51},"end":{"line":2,"column":57}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 61, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 51 - }, - "end": { - "line": 2, - "column": 57 - } - } + "start":61,"end":67,"loc":{"start":{"line":2,"column":51},"end":{"line":2,"column":57}} } }, "asserts": true @@ -242,18 +73,7 @@ }, "body": { "type": "BlockStatement", - "start": 68, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 58 - }, - "end": { - "line": 2, - "column": 60 - } - }, + "start":68,"end":70,"loc":{"start":{"line":2,"column":58},"end":{"line":2,"column":60}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/output.json index 62c634c7dc..438bfea02b 100644 --- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/output.json +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/asserts-var/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "program": { "type": "Program", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSDeclareFunction", - "start": 0, - "end": 63, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 63 - } - }, + "start":0,"end":63,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":63}}, "id": { "type": "Identifier", - "start": 17, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "assertIsString" - }, + "start":17,"end":31,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":31},"identifierName":"assertIsString"}, "name": "assertIsString" }, "generator": false, @@ -65,95 +20,27 @@ "params": [ { "type": "Identifier", - "start": 32, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "value" - }, + "start":32,"end":46,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":46},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TSTypeAnnotation", - "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}}, "typeAnnotation": { "type": "TSUnknownKeyword", - "start": 39, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 46 - } - } + "start":39,"end":46,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":46}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 47, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":47,"end":62,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":62}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 47, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":47,"end":62,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":62}}, "parameterName": { "type": "Identifier", - "start": 57, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 62 - }, - "identifierName": "value" - }, + "start":57,"end":62,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":62},"identifierName":"value"}, "name": "value" }, "asserts": true @@ -164,4 +51,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/declare-asserts-var-with-predicate/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/declare-asserts-var-with-predicate/output.json index 82cdaebbcf..6cfc63021f 100644 --- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/declare-asserts-var-with-predicate/output.json +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/declare-asserts-var-with-predicate/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 73 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":73}}, "program": { "type": "Program", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 73 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":73}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSDeclareFunction", - "start": 0, - "end": 73, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 73 - } - }, + "start":0,"end":73,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":73}}, "id": { "type": "Identifier", - "start": 17, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "assertIsString" - }, + "start":17,"end":31,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":31},"identifierName":"assertIsString"}, "name": "assertIsString" }, "generator": false, @@ -65,125 +20,35 @@ "params": [ { "type": "Identifier", - "start": 32, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "value" - }, + "start":32,"end":46,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":46},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TSTypeAnnotation", - "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}}, "typeAnnotation": { "type": "TSUnknownKeyword", - "start": 39, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 46 - } - } + "start":39,"end":46,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":46}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 47, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 72 - } - }, + "start":47,"end":72,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":72}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 47, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 72 - } - }, + "start":47,"end":72,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":72}}, "parameterName": { "type": "Identifier", - "start": 57, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 57 - }, - "end": { - "line": 1, - "column": 62 - }, - "identifierName": "value" - }, + "start":57,"end":62,"loc":{"start":{"line":1,"column":57},"end":{"line":1,"column":62},"identifierName":"value"}, "name": "value" }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 66, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 66 - }, - "end": { - "line": 1, - "column": 72 - } - }, + "start":66,"end":72,"loc":{"start":{"line":1,"column":66},"end":{"line":1,"column":72}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 66, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 66 - }, - "end": { - "line": 1, - "column": 72 - } - } + "start":66,"end":72,"loc":{"start":{"line":1,"column":66},"end":{"line":1,"column":72}} } }, "asserts": true @@ -194,4 +59,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/output.json index bea1caf3de..9e6d354155 100644 --- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/output.json +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/function-declaration/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 163, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 46 - } - }, + "start":0,"end":163,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":46}}, "program": { "type": "Program", - "start": 0, - "end": 163, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 46 - } - }, + "start":0,"end":163,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":46}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}}, "id": { "type": "Identifier", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "asserts1" - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17},"identifierName":"asserts1"}, "name": "asserts1" }, "generator": false, @@ -65,125 +20,35 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 33 - }, - "identifierName": "value" - }, + "start":19,"end":33,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":33},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 24, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":24,"end":33,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":33}}, "typeAnnotation": { "type": "TSUnknownKeyword", - "start": 26, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 33 - } - } + "start":26,"end":33,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":33}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 34, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":34,"end":59,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":59}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 34, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":34,"end":59,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":59}}, "parameterName": { "type": "Identifier", - "start": 44, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 44 - }, - "end": { - "line": 1, - "column": 49 - }, - "identifierName": "value" - }, + "start":44,"end":49,"loc":{"start":{"line":1,"column":44},"end":{"line":1,"column":49},"identifierName":"value"}, "name": "value" }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 53, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 59 - } - }, + "start":53,"end":59,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":59}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 53, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 53 - }, - "end": { - "line": 1, - "column": 59 - } - } + "start":53,"end":59,"loc":{"start":{"line":1,"column":53},"end":{"line":1,"column":59}} } }, "asserts": true @@ -191,51 +56,17 @@ }, "body": { "type": "BlockStatement", - "start": 60, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 60 - }, - "end": { - "line": 1, - "column": 62 - } - }, + "start":60,"end":62,"loc":{"start":{"line":1,"column":60},"end":{"line":1,"column":62}}, "body": [], "directives": [] } }, { "type": "FunctionDeclaration", - "start": 64, - "end": 116, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 52 - } - }, + "start":64,"end":116,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":52}}, "id": { "type": "Identifier", - "start": 73, - "end": 81, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "asserts2" - }, + "start":73,"end":81,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":17},"identifierName":"asserts2"}, "name": "asserts2" }, "generator": false, @@ -243,95 +74,27 @@ "params": [ { "type": "Identifier", - "start": 83, - "end": 97, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 33 - }, - "identifierName": "value" - }, + "start":83,"end":97,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":33},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 88, - "end": 97, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":88,"end":97,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":33}}, "typeAnnotation": { "type": "TSUnknownKeyword", - "start": 90, - "end": 97, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 33 - } - } + "start":90,"end":97,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":33}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 98, - "end": 113, - "loc": { - "start": { - "line": 2, - "column": 34 - }, - "end": { - "line": 2, - "column": 49 - } - }, + "start":98,"end":113,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":49}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 98, - "end": 113, - "loc": { - "start": { - "line": 2, - "column": 34 - }, - "end": { - "line": 2, - "column": 49 - } - }, + "start":98,"end":113,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":49}}, "parameterName": { "type": "Identifier", - "start": 108, - "end": 113, - "loc": { - "start": { - "line": 2, - "column": 44 - }, - "end": { - "line": 2, - "column": 49 - }, - "identifierName": "value" - }, + "start":108,"end":113,"loc":{"start":{"line":2,"column":44},"end":{"line":2,"column":49},"identifierName":"value"}, "name": "value" }, "asserts": true @@ -339,51 +102,17 @@ }, "body": { "type": "BlockStatement", - "start": 114, - "end": 116, - "loc": { - "start": { - "line": 2, - "column": 50 - }, - "end": { - "line": 2, - "column": 52 - } - }, + "start":114,"end":116,"loc":{"start":{"line":2,"column":50},"end":{"line":2,"column":52}}, "body": [], "directives": [] } }, { "type": "FunctionDeclaration", - "start": 117, - "end": 163, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 46 - } - }, + "start":117,"end":163,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":46}}, "id": { "type": "Identifier", - "start": 126, - "end": 134, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "asserts3" - }, + "start":126,"end":134,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":17},"identifierName":"asserts3"}, "name": "asserts3" }, "generator": false, @@ -391,113 +120,34 @@ "params": [ { "type": "Identifier", - "start": 136, - "end": 150, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 33 - }, - "identifierName": "value" - }, + "start":136,"end":150,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":33},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 141, - "end": 150, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 33 - } - }, + "start":141,"end":150,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":33}}, "typeAnnotation": { "type": "TSUnknownKeyword", - "start": 143, - "end": 150, - "loc": { - "start": { - "line": 3, - "column": 26 - }, - "end": { - "line": 3, - "column": 33 - } - } + "start":143,"end":150,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":33}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 151, - "end": 160, - "loc": { - "start": { - "line": 3, - "column": 34 - }, - "end": { - "line": 3, - "column": 43 - } - }, + "start":151,"end":160,"loc":{"start":{"line":3,"column":34},"end":{"line":3,"column":43}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 153, - "end": 160, - "loc": { - "start": { - "line": 3, - "column": 36 - }, - "end": { - "line": 3, - "column": 43 - } - }, + "start":153,"end":160,"loc":{"start":{"line":3,"column":36},"end":{"line":3,"column":43}}, "typeName": { "type": "Identifier", - "start": 153, - "end": 160, - "loc": { - "start": { - "line": 3, - "column": 36 - }, - "end": { - "line": 3, - "column": 43 - }, - "identifierName": "asserts" - }, + "start":153,"end":160,"loc":{"start":{"line":3,"column":36},"end":{"line":3,"column":43},"identifierName":"asserts"}, "name": "asserts" } } }, "body": { "type": "BlockStatement", - "start": 161, - "end": 163, - "loc": { - "start": { - "line": 3, - "column": 44 - }, - "end": { - "line": 3, - "column": 46 - } - }, + "start":161,"end":163,"loc":{"start":{"line":3,"column":44},"end":{"line":3,"column":46}}, "body": [], "directives": [] } @@ -505,4 +155,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/output.json b/packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/output.json index 90484c4b93..8caf5c9c34 100644 --- a/packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/output.json +++ b/packages/babel-parser/test/fixtures/typescript/assert-predicate/invalid-escaped-asserts-keyword/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 68 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":68}}, "errors": [ "SyntaxError: Escape sequence in keyword asserts (1:49)" ], "program": { "type": "Program", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 68 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":68}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSDeclareFunction", - "start": 0, - "end": 68, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 68 - } - }, + "start":0,"end":68,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":68}}, "id": { "type": "Identifier", - "start": 17, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "assertIsString" - }, + "start":17,"end":31,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":31},"identifierName":"assertIsString"}, "name": "assertIsString" }, "generator": false, @@ -68,95 +23,27 @@ "params": [ { "type": "Identifier", - "start": 32, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 46 - }, - "identifierName": "value" - }, + "start":32,"end":46,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":46},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TSTypeAnnotation", - "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}}, "typeAnnotation": { "type": "TSUnknownKeyword", - "start": 39, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 46 - } - } + "start":39,"end":46,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":46}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 47, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 67 - } - }, + "start":47,"end":67,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":67}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 47, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 67 - } - }, + "start":47,"end":67,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":67}}, "parameterName": { "type": "Identifier", - "start": 62, - "end": 67, - "loc": { - "start": { - "line": 1, - "column": 62 - }, - "end": { - "line": 1, - "column": 67 - }, - "identifierName": "value" - }, + "start":62,"end":67,"loc":{"start":{"line":1,"column":62},"end":{"line":1,"column":67},"identifierName":"value"}, "name": "value" }, "asserts": true diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/output.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/output.json index 84bb9f0482..e2c60e35e2 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-as/output.json @@ -1,129 +1,39 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected type cast in parameter position. (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": true, "params": [ { "type": "TSAsExpression", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "expression": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, "typeAnnotation": { "type": "TSTypeReference", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "typeName": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "T" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"T"}, "name": "T" } } @@ -131,18 +41,7 @@ ], "body": { "type": "BlockStatement", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/output.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/output.json index 5825bdc4db..399b0fb657 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/arrow-async-parameter-assertion/output.json @@ -1,148 +1,47 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected type cast in parameter position. (1:7)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": null, "generator": false, "async": true, "params": [ { "type": "TSTypeAssertion", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "typeAnnotation": { "type": "TSTypeReference", - "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}}, "typeName": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "T" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"T"}, "name": "T" } }, "expression": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a" } } ], "body": { "type": "BlockStatement", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-in-parens-with-parens-node/output.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-in-parens-with-parens-node/output.json index 29e413f17d..f94f25c9a0 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/arrow-in-parens-with-parens-node/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/arrow-in-parens-with-parens-node/output.json @@ -1,203 +1,57 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":4,"end":43,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":43}}, "id": { "type": "Identifier", - "start": 4, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "asserted1" - }, + "start":4,"end":13,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":13},"identifierName":"asserted1"}, "name": "asserted1" }, "init": { "type": "TSTypeAssertion", - "start": 16, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":16,"end":43,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":43}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}} }, "expression": { "type": "ParenthesizedExpression", - "start": 21, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":21,"end":43,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":43}}, "expression": { "type": "ArrowFunctionExpression", - "start": 22, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":22,"end":42,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":42}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "n" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"n"}, "name": "n" } ], "body": { "type": "BlockStatement", - "start": 29, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":29,"end":42,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":42}}, "body": [ { "type": "ReturnStatement", - "start": 31, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":31,"end":40,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":40}}, "argument": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "n" - }, + "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39},"identifierName":"n"}, "name": "n" } } diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-in-parens/output.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-in-parens/output.json index 08bffbefa0..ff31722aed 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/arrow-in-parens/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/arrow-in-parens/output.json @@ -1,189 +1,54 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":4,"end":43,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":43}}, "id": { "type": "Identifier", - "start": 4, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "asserted1" - }, + "start":4,"end":13,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":13},"identifierName":"asserted1"}, "name": "asserted1" }, "init": { "type": "TSTypeAssertion", - "start": 16, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":16,"end":43,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":43}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20}} }, "expression": { "type": "ArrowFunctionExpression", - "start": 22, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":22,"end":42,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":42}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "n" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"n"}, "name": "n" } ], "body": { "type": "BlockStatement", - "start": 29, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":29,"end":42,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":42}}, "body": [ { "type": "ReturnStatement", - "start": 31, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":31,"end":40,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":40}}, "argument": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "n" - }, + "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39},"identifierName":"n"}, "name": "n" } } diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/output.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/output.json index 369ec9d0eb..10d0beeb57 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-as/output.json @@ -1,129 +1,39 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected type cast in parameter position. (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "TSAsExpression", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}}, "expression": { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, "typeAnnotation": { "type": "TSTypeReference", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "typeName": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "T" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"T"}, "name": "T" } } @@ -131,18 +41,7 @@ ], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/output.json b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/output.json index 52cb7ee9d5..81af16cb09 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/arrow-parameter-assertion/output.json @@ -1,148 +1,47 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Unexpected type cast in parameter position. (1:1)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ArrowFunctionExpression", - "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}}, "id": null, "generator": false, "async": false, "params": [ { "type": "TSTypeAssertion", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "typeName": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "T" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"T"}, "name": "T" } }, "expression": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" } } ], "body": { "type": "BlockStatement", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":11,"end":13,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":13}}, "body": [], "directives": [] } 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 e1177f2c1e..b0aceac139 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 @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 1127, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 39, - "column": 34 - } - }, + "start":0,"end":1127,"loc":{"start":{"line":1,"column":0},"end":{"line":39,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 1127, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 39, - "column": 34 - } - }, + "start":0,"end":1127,"loc":{"start":{"line":1,"column":0},"end":{"line":39,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 143, - "end": 167, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":143,"end":167,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":24}}, "declarations": [ { "type": "VariableDeclarator", - "start": 147, - "end": 166, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":147,"end":166,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":23}}, "id": { "type": "Identifier", - "start": 147, - "end": 149, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "v1" - }, + "start":147,"end":149,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":6},"identifierName":"v1"}, "name": "v1" }, "init": { "type": "TSAsExpression", - "start": 152, - "end": 166, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":152,"end":166,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":23}}, "expression": { "type": "StringLiteral", - "start": 152, - "end": 157, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":152,"end":157,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":14}}, "extra": { "rawValue": "abc", "raw": "'abc'" @@ -111,33 +33,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 161, - "end": 166, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":161,"end":166,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":23}}, "typeName": { "type": "Identifier", - "start": 161, - "end": 166, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 23 - }, - "identifierName": "const" - }, + "start":161,"end":166,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":23},"identifierName":"const"}, "name": "const" } } @@ -149,127 +48,38 @@ { "type": "CommentLine", "value": " Copied over from TypeScript's test case", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - } + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}} }, { "type": "CommentLine", "value": " https://github.com/Microsoft/TypeScript/blob/master/tests/baselines/reference/constAssertions.js", - "start": 43, - "end": 142, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 99 - } - } + "start":43,"end":142,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":99}} } ] }, { "type": "VariableDeclaration", - "start": 168, - "end": 192, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 24 - } - }, + "start":168,"end":192,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":24}}, "declarations": [ { "type": "VariableDeclarator", - "start": 172, - "end": 191, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 23 - } - }, + "start":172,"end":191,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":23}}, "id": { "type": "Identifier", - "start": 172, - "end": 174, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 6 - }, - "identifierName": "v2" - }, + "start":172,"end":174,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":6},"identifierName":"v2"}, "name": "v2" }, "init": { "type": "TSAsExpression", - "start": 177, - "end": 191, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 23 - } - }, + "start":177,"end":191,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":23}}, "expression": { "type": "TemplateLiteral", - "start": 177, - "end": 182, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":177,"end":182,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":14}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 178, - "end": 181, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":178,"end":181,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":13}}, "value": { "raw": "abc", "cooked": "abc" @@ -280,33 +90,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 186, - "end": 191, - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 23 - } - }, + "start":186,"end":191,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":23}}, "typeName": { "type": "Identifier", - "start": 186, - "end": 191, - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 23 - }, - "identifierName": "const" - }, + "start":186,"end":191,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":23},"identifierName":"const"}, "name": "const" } } @@ -317,78 +104,22 @@ }, { "type": "VariableDeclaration", - "start": 193, - "end": 214, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 21 - } - }, + "start":193,"end":214,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 197, - "end": 213, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 20 - } - }, + "start":197,"end":213,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":20}}, "id": { "type": "Identifier", - "start": 197, - "end": 199, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 6 - }, - "identifierName": "v3" - }, + "start":197,"end":199,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":6},"identifierName":"v3"}, "name": "v3" }, "init": { "type": "TSAsExpression", - "start": 202, - "end": 213, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 20 - } - }, + "start":202,"end":213,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":20}}, "expression": { "type": "NumericLiteral", - "start": 202, - "end": 204, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":202,"end":204,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":11}}, "extra": { "rawValue": 10, "raw": "10" @@ -397,33 +128,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 208, - "end": 213, - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 20 - } - }, + "start":208,"end":213,"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":20}}, "typeName": { "type": "Identifier", - "start": 208, - "end": 213, - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 20 - }, - "identifierName": "const" - }, + "start":208,"end":213,"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":20},"identifierName":"const"}, "name": "const" } } @@ -434,94 +142,27 @@ }, { "type": "VariableDeclaration", - "start": 215, - "end": 237, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 22 - } - }, + "start":215,"end":237,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 219, - "end": 236, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 21 - } - }, + "start":219,"end":236,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":21}}, "id": { "type": "Identifier", - "start": 219, - "end": 221, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 6 - }, - "identifierName": "v4" - }, + "start":219,"end":221,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":6},"identifierName":"v4"}, "name": "v4" }, "init": { "type": "TSAsExpression", - "start": 224, - "end": 236, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 21 - } - }, + "start":224,"end":236,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":21}}, "expression": { "type": "UnaryExpression", - "start": 224, - "end": 227, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 12 - } - }, + "start":224,"end":227,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":12}}, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 225, - "end": 227, - "loc": { - "start": { - "line": 6, - "column": 10 - }, - "end": { - "line": 6, - "column": 12 - } - }, + "start":225,"end":227,"loc":{"start":{"line":6,"column":10},"end":{"line":6,"column":12}}, "extra": { "rawValue": 10, "raw": "10" @@ -531,33 +172,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 231, - "end": 236, - "loc": { - "start": { - "line": 6, - "column": 16 - }, - "end": { - "line": 6, - "column": 21 - } - }, + "start":231,"end":236,"loc":{"start":{"line":6,"column":16},"end":{"line":6,"column":21}}, "typeName": { "type": "Identifier", - "start": 231, - "end": 236, - "loc": { - "start": { - "line": 6, - "column": 16 - }, - "end": { - "line": 6, - "column": 21 - }, - "identifierName": "const" - }, + "start":231,"end":236,"loc":{"start":{"line":6,"column":16},"end":{"line":6,"column":21},"identifierName":"const"}, "name": "const" } } @@ -568,94 +186,27 @@ }, { "type": "VariableDeclaration", - "start": 238, - "end": 260, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 22 - } - }, + "start":238,"end":260,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 242, - "end": 259, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 21 - } - }, + "start":242,"end":259,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":21}}, "id": { "type": "Identifier", - "start": 242, - "end": 244, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 6 - }, - "identifierName": "v5" - }, + "start":242,"end":244,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":6},"identifierName":"v5"}, "name": "v5" }, "init": { "type": "TSAsExpression", - "start": 247, - "end": 259, - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 21 - } - }, + "start":247,"end":259,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":21}}, "expression": { "type": "UnaryExpression", - "start": 247, - "end": 250, - "loc": { - "start": { - "line": 7, - "column": 9 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":247,"end":250,"loc":{"start":{"line":7,"column":9},"end":{"line":7,"column":12}}, "operator": "+", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 248, - "end": 250, - "loc": { - "start": { - "line": 7, - "column": 10 - }, - "end": { - "line": 7, - "column": 12 - } - }, + "start":248,"end":250,"loc":{"start":{"line":7,"column":10},"end":{"line":7,"column":12}}, "extra": { "rawValue": 10, "raw": "10" @@ -665,33 +216,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 254, - "end": 259, - "loc": { - "start": { - "line": 7, - "column": 16 - }, - "end": { - "line": 7, - "column": 21 - } - }, + "start":254,"end":259,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":21}}, "typeName": { "type": "Identifier", - "start": 254, - "end": 259, - "loc": { - "start": { - "line": 7, - "column": 16 - }, - "end": { - "line": 7, - "column": 21 - }, - "identifierName": "const" - }, + "start":254,"end":259,"loc":{"start":{"line":7,"column":16},"end":{"line":7,"column":21},"identifierName":"const"}, "name": "const" } } @@ -702,78 +230,22 @@ }, { "type": "VariableDeclaration", - "start": 261, - "end": 282, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 21 - } - }, + "start":261,"end":282,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 265, - "end": 281, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 20 - } - }, + "start":265,"end":281,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":20}}, "id": { "type": "Identifier", - "start": 265, - "end": 267, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 6 - }, - "identifierName": "v6" - }, + "start":265,"end":267,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":6},"identifierName":"v6"}, "name": "v6" }, "init": { "type": "TSAsExpression", - "start": 270, - "end": 281, - "loc": { - "start": { - "line": 8, - "column": 9 - }, - "end": { - "line": 8, - "column": 20 - } - }, + "start":270,"end":281,"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":20}}, "expression": { "type": "NumericLiteral", - "start": 270, - "end": 272, - "loc": { - "start": { - "line": 8, - "column": 9 - }, - "end": { - "line": 8, - "column": 11 - } - }, + "start":270,"end":272,"loc":{"start":{"line":8,"column":9},"end":{"line":8,"column":11}}, "extra": { "rawValue": 10, "raw": "10" @@ -782,33 +254,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 276, - "end": 281, - "loc": { - "start": { - "line": 8, - "column": 15 - }, - "end": { - "line": 8, - "column": 20 - } - }, + "start":276,"end":281,"loc":{"start":{"line":8,"column":15},"end":{"line":8,"column":20}}, "typeName": { "type": "Identifier", - "start": 276, - "end": 281, - "loc": { - "start": { - "line": 8, - "column": 15 - }, - "end": { - "line": 8, - "column": 20 - }, - "identifierName": "const" - }, + "start":276,"end":281,"loc":{"start":{"line":8,"column":15},"end":{"line":8,"column":20},"identifierName":"const"}, "name": "const" } } @@ -819,94 +268,27 @@ }, { "type": "VariableDeclaration", - "start": 283, - "end": 305, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 22 - } - }, + "start":283,"end":305,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 287, - "end": 304, - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 9, - "column": 21 - } - }, + "start":287,"end":304,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":21}}, "id": { "type": "Identifier", - "start": 287, - "end": 289, - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 9, - "column": 6 - }, - "identifierName": "v7" - }, + "start":287,"end":289,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":6},"identifierName":"v7"}, "name": "v7" }, "init": { "type": "TSAsExpression", - "start": 292, - "end": 304, - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 9, - "column": 21 - } - }, + "start":292,"end":304,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":21}}, "expression": { "type": "UnaryExpression", - "start": 292, - "end": 295, - "loc": { - "start": { - "line": 9, - "column": 9 - }, - "end": { - "line": 9, - "column": 12 - } - }, + "start":292,"end":295,"loc":{"start":{"line":9,"column":9},"end":{"line":9,"column":12}}, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 293, - "end": 295, - "loc": { - "start": { - "line": 9, - "column": 10 - }, - "end": { - "line": 9, - "column": 12 - } - }, + "start":293,"end":295,"loc":{"start":{"line":9,"column":10},"end":{"line":9,"column":12}}, "extra": { "rawValue": 10, "raw": "10" @@ -916,33 +298,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 299, - "end": 304, - "loc": { - "start": { - "line": 9, - "column": 16 - }, - "end": { - "line": 9, - "column": 21 - } - }, + "start":299,"end":304,"loc":{"start":{"line":9,"column":16},"end":{"line":9,"column":21}}, "typeName": { "type": "Identifier", - "start": 299, - "end": 304, - "loc": { - "start": { - "line": 9, - "column": 16 - }, - "end": { - "line": 9, - "column": 21 - }, - "identifierName": "const" - }, + "start":299,"end":304,"loc":{"start":{"line":9,"column":16},"end":{"line":9,"column":21},"identifierName":"const"}, "name": "const" } } @@ -953,109 +312,30 @@ }, { "type": "VariableDeclaration", - "start": 306, - "end": 329, - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 10, - "column": 23 - } - }, + "start":306,"end":329,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 310, - "end": 328, - "loc": { - "start": { - "line": 10, - "column": 4 - }, - "end": { - "line": 10, - "column": 22 - } - }, + "start":310,"end":328,"loc":{"start":{"line":10,"column":4},"end":{"line":10,"column":22}}, "id": { "type": "Identifier", - "start": 310, - "end": 312, - "loc": { - "start": { - "line": 10, - "column": 4 - }, - "end": { - "line": 10, - "column": 6 - }, - "identifierName": "v8" - }, + "start":310,"end":312,"loc":{"start":{"line":10,"column":4},"end":{"line":10,"column":6},"identifierName":"v8"}, "name": "v8" }, "init": { "type": "TSAsExpression", - "start": 315, - "end": 328, - "loc": { - "start": { - "line": 10, - "column": 9 - }, - "end": { - "line": 10, - "column": 22 - } - }, + "start":315,"end":328,"loc":{"start":{"line":10,"column":9},"end":{"line":10,"column":22}}, "expression": { "type": "BooleanLiteral", - "start": 315, - "end": 319, - "loc": { - "start": { - "line": 10, - "column": 9 - }, - "end": { - "line": 10, - "column": 13 - } - }, + "start":315,"end":319,"loc":{"start":{"line":10,"column":9},"end":{"line":10,"column":13}}, "value": true }, "typeAnnotation": { "type": "TSTypeReference", - "start": 323, - "end": 328, - "loc": { - "start": { - "line": 10, - "column": 17 - }, - "end": { - "line": 10, - "column": 22 - } - }, + "start":323,"end":328,"loc":{"start":{"line":10,"column":17},"end":{"line":10,"column":22}}, "typeName": { "type": "Identifier", - "start": 323, - "end": 328, - "loc": { - "start": { - "line": 10, - "column": 17 - }, - "end": { - "line": 10, - "column": 22 - }, - "identifierName": "const" - }, + "start":323,"end":328,"loc":{"start":{"line":10,"column":17},"end":{"line":10,"column":22},"identifierName":"const"}, "name": "const" } } @@ -1066,109 +346,30 @@ }, { "type": "VariableDeclaration", - "start": 330, - "end": 354, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 24 - } - }, + "start":330,"end":354,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":24}}, "declarations": [ { "type": "VariableDeclarator", - "start": 334, - "end": 353, - "loc": { - "start": { - "line": 11, - "column": 4 - }, - "end": { - "line": 11, - "column": 23 - } - }, + "start":334,"end":353,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":23}}, "id": { "type": "Identifier", - "start": 334, - "end": 336, - "loc": { - "start": { - "line": 11, - "column": 4 - }, - "end": { - "line": 11, - "column": 6 - }, - "identifierName": "v9" - }, + "start":334,"end":336,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":6},"identifierName":"v9"}, "name": "v9" }, "init": { "type": "TSAsExpression", - "start": 339, - "end": 353, - "loc": { - "start": { - "line": 11, - "column": 9 - }, - "end": { - "line": 11, - "column": 23 - } - }, + "start":339,"end":353,"loc":{"start":{"line":11,"column":9},"end":{"line":11,"column":23}}, "expression": { "type": "BooleanLiteral", - "start": 339, - "end": 344, - "loc": { - "start": { - "line": 11, - "column": 9 - }, - "end": { - "line": 11, - "column": 14 - } - }, + "start":339,"end":344,"loc":{"start":{"line":11,"column":9},"end":{"line":11,"column":14}}, "value": false }, "typeAnnotation": { "type": "TSTypeReference", - "start": 348, - "end": 353, - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 23 - } - }, + "start":348,"end":353,"loc":{"start":{"line":11,"column":18},"end":{"line":11,"column":23}}, "typeName": { "type": "Identifier", - "start": 348, - "end": 353, - "loc": { - "start": { - "line": 11, - "column": 18 - }, - "end": { - "line": 11, - "column": 23 - }, - "identifierName": "const" - }, + "start":348,"end":353,"loc":{"start":{"line":11,"column":18},"end":{"line":11,"column":23},"identifierName":"const"}, "name": "const" } } @@ -1179,109 +380,30 @@ }, { "type": "VariableDeclaration", - "start": 356, - "end": 377, - "loc": { - "start": { - "line": 13, - "column": 0 - }, - "end": { - "line": 13, - "column": 21 - } - }, + "start":356,"end":377,"loc":{"start":{"line":13,"column":0},"end":{"line":13,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 360, - "end": 376, - "loc": { - "start": { - "line": 13, - "column": 4 - }, - "end": { - "line": 13, - "column": 20 - } - }, + "start":360,"end":376,"loc":{"start":{"line":13,"column":4},"end":{"line":13,"column":20}}, "id": { "type": "Identifier", - "start": 360, - "end": 362, - "loc": { - "start": { - "line": 13, - "column": 4 - }, - "end": { - "line": 13, - "column": 6 - }, - "identifierName": "a1" - }, + "start":360,"end":362,"loc":{"start":{"line":13,"column":4},"end":{"line":13,"column":6},"identifierName":"a1"}, "name": "a1" }, "init": { "type": "TSAsExpression", - "start": 365, - "end": 376, - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 20 - } - }, + "start":365,"end":376,"loc":{"start":{"line":13,"column":9},"end":{"line":13,"column":20}}, "expression": { "type": "ArrayExpression", - "start": 365, - "end": 367, - "loc": { - "start": { - "line": 13, - "column": 9 - }, - "end": { - "line": 13, - "column": 11 - } - }, + "start":365,"end":367,"loc":{"start":{"line":13,"column":9},"end":{"line":13,"column":11}}, "elements": [] }, "typeAnnotation": { "type": "TSTypeReference", - "start": 371, - "end": 376, - "loc": { - "start": { - "line": 13, - "column": 15 - }, - "end": { - "line": 13, - "column": 20 - } - }, + "start":371,"end":376,"loc":{"start":{"line":13,"column":15},"end":{"line":13,"column":20}}, "typeName": { "type": "Identifier", - "start": 371, - "end": 376, - "loc": { - "start": { - "line": 13, - "column": 15 - }, - "end": { - "line": 13, - "column": 20 - }, - "identifierName": "const" - }, + "start":371,"end":376,"loc":{"start":{"line":13,"column":15},"end":{"line":13,"column":20},"identifierName":"const"}, "name": "const" } } @@ -1292,93 +414,26 @@ }, { "type": "VariableDeclaration", - "start": 378, - "end": 406, - "loc": { - "start": { - "line": 14, - "column": 0 - }, - "end": { - "line": 14, - "column": 28 - } - }, + "start":378,"end":406,"loc":{"start":{"line":14,"column":0},"end":{"line":14,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 382, - "end": 405, - "loc": { - "start": { - "line": 14, - "column": 4 - }, - "end": { - "line": 14, - "column": 27 - } - }, + "start":382,"end":405,"loc":{"start":{"line":14,"column":4},"end":{"line":14,"column":27}}, "id": { "type": "Identifier", - "start": 382, - "end": 384, - "loc": { - "start": { - "line": 14, - "column": 4 - }, - "end": { - "line": 14, - "column": 6 - }, - "identifierName": "a2" - }, + "start":382,"end":384,"loc":{"start":{"line":14,"column":4},"end":{"line":14,"column":6},"identifierName":"a2"}, "name": "a2" }, "init": { "type": "TSAsExpression", - "start": 387, - "end": 405, - "loc": { - "start": { - "line": 14, - "column": 9 - }, - "end": { - "line": 14, - "column": 27 - } - }, + "start":387,"end":405,"loc":{"start":{"line":14,"column":9},"end":{"line":14,"column":27}}, "expression": { "type": "ArrayExpression", - "start": 387, - "end": 396, - "loc": { - "start": { - "line": 14, - "column": 9 - }, - "end": { - "line": 14, - "column": 18 - } - }, + "start":387,"end":396,"loc":{"start":{"line":14,"column":9},"end":{"line":14,"column":18}}, "elements": [ { "type": "NumericLiteral", - "start": 388, - "end": 389, - "loc": { - "start": { - "line": 14, - "column": 10 - }, - "end": { - "line": 14, - "column": 11 - } - }, + "start":388,"end":389,"loc":{"start":{"line":14,"column":10},"end":{"line":14,"column":11}}, "extra": { "rawValue": 1, "raw": "1" @@ -1387,18 +442,7 @@ }, { "type": "NumericLiteral", - "start": 391, - "end": 392, - "loc": { - "start": { - "line": 14, - "column": 13 - }, - "end": { - "line": 14, - "column": 14 - } - }, + "start":391,"end":392,"loc":{"start":{"line":14,"column":13},"end":{"line":14,"column":14}}, "extra": { "rawValue": 2, "raw": "2" @@ -1407,18 +451,7 @@ }, { "type": "NumericLiteral", - "start": 394, - "end": 395, - "loc": { - "start": { - "line": 14, - "column": 16 - }, - "end": { - "line": 14, - "column": 17 - } - }, + "start":394,"end":395,"loc":{"start":{"line":14,"column":16},"end":{"line":14,"column":17}}, "extra": { "rawValue": 3, "raw": "3" @@ -1429,33 +462,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 400, - "end": 405, - "loc": { - "start": { - "line": 14, - "column": 22 - }, - "end": { - "line": 14, - "column": 27 - } - }, + "start":400,"end":405,"loc":{"start":{"line":14,"column":22},"end":{"line":14,"column":27}}, "typeName": { "type": "Identifier", - "start": 400, - "end": 405, - "loc": { - "start": { - "line": 14, - "column": 22 - }, - "end": { - "line": 14, - "column": 27 - }, - "identifierName": "const" - }, + "start":400,"end":405,"loc":{"start":{"line":14,"column":22},"end":{"line":14,"column":27},"identifierName":"const"}, "name": "const" } } @@ -1466,93 +476,26 @@ }, { "type": "VariableDeclaration", - "start": 407, - "end": 445, - "loc": { - "start": { - "line": 15, - "column": 0 - }, - "end": { - "line": 15, - "column": 38 - } - }, + "start":407,"end":445,"loc":{"start":{"line":15,"column":0},"end":{"line":15,"column":38}}, "declarations": [ { "type": "VariableDeclarator", - "start": 411, - "end": 444, - "loc": { - "start": { - "line": 15, - "column": 4 - }, - "end": { - "line": 15, - "column": 37 - } - }, + "start":411,"end":444,"loc":{"start":{"line":15,"column":4},"end":{"line":15,"column":37}}, "id": { "type": "Identifier", - "start": 411, - "end": 413, - "loc": { - "start": { - "line": 15, - "column": 4 - }, - "end": { - "line": 15, - "column": 6 - }, - "identifierName": "a3" - }, + "start":411,"end":413,"loc":{"start":{"line":15,"column":4},"end":{"line":15,"column":6},"identifierName":"a3"}, "name": "a3" }, "init": { "type": "TSAsExpression", - "start": 416, - "end": 444, - "loc": { - "start": { - "line": 15, - "column": 9 - }, - "end": { - "line": 15, - "column": 37 - } - }, + "start":416,"end":444,"loc":{"start":{"line":15,"column":9},"end":{"line":15,"column":37}}, "expression": { "type": "ArrayExpression", - "start": 416, - "end": 435, - "loc": { - "start": { - "line": 15, - "column": 9 - }, - "end": { - "line": 15, - "column": 28 - } - }, + "start":416,"end":435,"loc":{"start":{"line":15,"column":9},"end":{"line":15,"column":28}}, "elements": [ { "type": "NumericLiteral", - "start": 417, - "end": 419, - "loc": { - "start": { - "line": 15, - "column": 10 - }, - "end": { - "line": 15, - "column": 12 - } - }, + "start":417,"end":419,"loc":{"start":{"line":15,"column":10},"end":{"line":15,"column":12}}, "extra": { "rawValue": 10, "raw": "10" @@ -1561,18 +504,7 @@ }, { "type": "StringLiteral", - "start": 421, - "end": 428, - "loc": { - "start": { - "line": 15, - "column": 14 - }, - "end": { - "line": 15, - "column": 21 - } - }, + "start":421,"end":428,"loc":{"start":{"line":15,"column":14},"end":{"line":15,"column":21}}, "extra": { "rawValue": "hello", "raw": "'hello'" @@ -1581,51 +513,17 @@ }, { "type": "BooleanLiteral", - "start": 430, - "end": 434, - "loc": { - "start": { - "line": 15, - "column": 23 - }, - "end": { - "line": 15, - "column": 27 - } - }, + "start":430,"end":434,"loc":{"start":{"line":15,"column":23},"end":{"line":15,"column":27}}, "value": true } ] }, "typeAnnotation": { "type": "TSTypeReference", - "start": 439, - "end": 444, - "loc": { - "start": { - "line": 15, - "column": 32 - }, - "end": { - "line": 15, - "column": 37 - } - }, + "start":439,"end":444,"loc":{"start":{"line":15,"column":32},"end":{"line":15,"column":37}}, "typeName": { "type": "Identifier", - "start": 439, - "end": 444, - "loc": { - "start": { - "line": 15, - "column": 32 - }, - "end": { - "line": 15, - "column": 37 - }, - "identifierName": "const" - }, + "start":439,"end":444,"loc":{"start":{"line":15,"column":32},"end":{"line":15,"column":37},"identifierName":"const"}, "name": "const" } } @@ -1636,122 +534,33 @@ }, { "type": "VariableDeclaration", - "start": 446, - "end": 479, - "loc": { - "start": { - "line": 16, - "column": 0 - }, - "end": { - "line": 16, - "column": 33 - } - }, + "start":446,"end":479,"loc":{"start":{"line":16,"column":0},"end":{"line":16,"column":33}}, "declarations": [ { "type": "VariableDeclarator", - "start": 450, - "end": 478, - "loc": { - "start": { - "line": 16, - "column": 4 - }, - "end": { - "line": 16, - "column": 32 - } - }, + "start":450,"end":478,"loc":{"start":{"line":16,"column":4},"end":{"line":16,"column":32}}, "id": { "type": "Identifier", - "start": 450, - "end": 452, - "loc": { - "start": { - "line": 16, - "column": 4 - }, - "end": { - "line": 16, - "column": 6 - }, - "identifierName": "a4" - }, + "start":450,"end":452,"loc":{"start":{"line":16,"column":4},"end":{"line":16,"column":6},"identifierName":"a4"}, "name": "a4" }, "init": { "type": "TSAsExpression", - "start": 455, - "end": 478, - "loc": { - "start": { - "line": 16, - "column": 9 - }, - "end": { - "line": 16, - "column": 32 - } - }, + "start":455,"end":478,"loc":{"start":{"line":16,"column":9},"end":{"line":16,"column":32}}, "expression": { "type": "ArrayExpression", - "start": 455, - "end": 469, - "loc": { - "start": { - "line": 16, - "column": 9 - }, - "end": { - "line": 16, - "column": 23 - } - }, + "start":455,"end":469,"loc":{"start":{"line":16,"column":9},"end":{"line":16,"column":23}}, "elements": [ { "type": "SpreadElement", - "start": 456, - "end": 468, - "loc": { - "start": { - "line": 16, - "column": 10 - }, - "end": { - "line": 16, - "column": 22 - } - }, + "start":456,"end":468,"loc":{"start":{"line":16,"column":10},"end":{"line":16,"column":22}}, "argument": { "type": "ArrayExpression", - "start": 459, - "end": 468, - "loc": { - "start": { - "line": 16, - "column": 13 - }, - "end": { - "line": 16, - "column": 22 - } - }, + "start":459,"end":468,"loc":{"start":{"line":16,"column":13},"end":{"line":16,"column":22}}, "elements": [ { "type": "NumericLiteral", - "start": 460, - "end": 461, - "loc": { - "start": { - "line": 16, - "column": 14 - }, - "end": { - "line": 16, - "column": 15 - } - }, + "start":460,"end":461,"loc":{"start":{"line":16,"column":14},"end":{"line":16,"column":15}}, "extra": { "rawValue": 1, "raw": "1" @@ -1760,18 +569,7 @@ }, { "type": "NumericLiteral", - "start": 463, - "end": 464, - "loc": { - "start": { - "line": 16, - "column": 17 - }, - "end": { - "line": 16, - "column": 18 - } - }, + "start":463,"end":464,"loc":{"start":{"line":16,"column":17},"end":{"line":16,"column":18}}, "extra": { "rawValue": 2, "raw": "2" @@ -1780,18 +578,7 @@ }, { "type": "NumericLiteral", - "start": 466, - "end": 467, - "loc": { - "start": { - "line": 16, - "column": 20 - }, - "end": { - "line": 16, - "column": 21 - } - }, + "start":466,"end":467,"loc":{"start":{"line":16,"column":20},"end":{"line":16,"column":21}}, "extra": { "rawValue": 3, "raw": "3" @@ -1805,33 +592,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 473, - "end": 478, - "loc": { - "start": { - "line": 16, - "column": 27 - }, - "end": { - "line": 16, - "column": 32 - } - }, + "start":473,"end":478,"loc":{"start":{"line":16,"column":27},"end":{"line":16,"column":32}}, "typeName": { "type": "Identifier", - "start": 473, - "end": 478, - "loc": { - "start": { - "line": 16, - "column": 27 - }, - "end": { - "line": 16, - "column": 32 - }, - "identifierName": "const" - }, + "start":473,"end":478,"loc":{"start":{"line":16,"column":27},"end":{"line":16,"column":32},"identifierName":"const"}, "name": "const" } } @@ -1842,79 +606,23 @@ }, { "type": "VariableDeclaration", - "start": 480, - "end": 499, - "loc": { - "start": { - "line": 17, - "column": 0 - }, - "end": { - "line": 17, - "column": 19 - } - }, + "start":480,"end":499,"loc":{"start":{"line":17,"column":0},"end":{"line":17,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 484, - "end": 498, - "loc": { - "start": { - "line": 17, - "column": 4 - }, - "end": { - "line": 17, - "column": 18 - } - }, + "start":484,"end":498,"loc":{"start":{"line":17,"column":4},"end":{"line":17,"column":18}}, "id": { "type": "Identifier", - "start": 484, - "end": 486, - "loc": { - "start": { - "line": 17, - "column": 4 - }, - "end": { - "line": 17, - "column": 6 - }, - "identifierName": "a5" - }, + "start":484,"end":486,"loc":{"start":{"line":17,"column":4},"end":{"line":17,"column":6},"identifierName":"a5"}, "name": "a5" }, "init": { "type": "ArrayExpression", - "start": 489, - "end": 498, - "loc": { - "start": { - "line": 17, - "column": 9 - }, - "end": { - "line": 17, - "column": 18 - } - }, + "start":489,"end":498,"loc":{"start":{"line":17,"column":9},"end":{"line":17,"column":18}}, "elements": [ { "type": "NumericLiteral", - "start": 490, - "end": 491, - "loc": { - "start": { - "line": 17, - "column": 10 - }, - "end": { - "line": 17, - "column": 11 - } - }, + "start":490,"end":491,"loc":{"start":{"line":17,"column":10},"end":{"line":17,"column":11}}, "extra": { "rawValue": 1, "raw": "1" @@ -1923,18 +631,7 @@ }, { "type": "NumericLiteral", - "start": 493, - "end": 494, - "loc": { - "start": { - "line": 17, - "column": 13 - }, - "end": { - "line": 17, - "column": 14 - } - }, + "start":493,"end":494,"loc":{"start":{"line":17,"column":13},"end":{"line":17,"column":14}}, "extra": { "rawValue": 2, "raw": "2" @@ -1943,18 +640,7 @@ }, { "type": "NumericLiteral", - "start": 496, - "end": 497, - "loc": { - "start": { - "line": 17, - "column": 16 - }, - "end": { - "line": 17, - "column": 17 - } - }, + "start":496,"end":497,"loc":{"start":{"line":17,"column":16},"end":{"line":17,"column":17}}, "extra": { "rawValue": 3, "raw": "3" @@ -1969,108 +655,29 @@ }, { "type": "VariableDeclaration", - "start": 500, - "end": 526, - "loc": { - "start": { - "line": 18, - "column": 0 - }, - "end": { - "line": 18, - "column": 26 - } - }, + "start":500,"end":526,"loc":{"start":{"line":18,"column":0},"end":{"line":18,"column":26}}, "declarations": [ { "type": "VariableDeclarator", - "start": 504, - "end": 525, - "loc": { - "start": { - "line": 18, - "column": 4 - }, - "end": { - "line": 18, - "column": 25 - } - }, + "start":504,"end":525,"loc":{"start":{"line":18,"column":4},"end":{"line":18,"column":25}}, "id": { "type": "Identifier", - "start": 504, - "end": 506, - "loc": { - "start": { - "line": 18, - "column": 4 - }, - "end": { - "line": 18, - "column": 6 - }, - "identifierName": "a6" - }, + "start":504,"end":506,"loc":{"start":{"line":18,"column":4},"end":{"line":18,"column":6},"identifierName":"a6"}, "name": "a6" }, "init": { "type": "TSAsExpression", - "start": 509, - "end": 525, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 25 - } - }, + "start":509,"end":525,"loc":{"start":{"line":18,"column":9},"end":{"line":18,"column":25}}, "expression": { "type": "ArrayExpression", - "start": 509, - "end": 516, - "loc": { - "start": { - "line": 18, - "column": 9 - }, - "end": { - "line": 18, - "column": 16 - } - }, + "start":509,"end":516,"loc":{"start":{"line":18,"column":9},"end":{"line":18,"column":16}}, "elements": [ { "type": "SpreadElement", - "start": 510, - "end": 515, - "loc": { - "start": { - "line": 18, - "column": 10 - }, - "end": { - "line": 18, - "column": 15 - } - }, + "start":510,"end":515,"loc":{"start":{"line":18,"column":10},"end":{"line":18,"column":15}}, "argument": { "type": "Identifier", - "start": 513, - "end": 515, - "loc": { - "start": { - "line": 18, - "column": 13 - }, - "end": { - "line": 18, - "column": 15 - }, - "identifierName": "a5" - }, + "start":513,"end":515,"loc":{"start":{"line":18,"column":13},"end":{"line":18,"column":15},"identifierName":"a5"}, "name": "a5" } } @@ -2078,33 +685,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 520, - "end": 525, - "loc": { - "start": { - "line": 18, - "column": 20 - }, - "end": { - "line": 18, - "column": 25 - } - }, + "start":520,"end":525,"loc":{"start":{"line":18,"column":20},"end":{"line":18,"column":25}}, "typeName": { "type": "Identifier", - "start": 520, - "end": 525, - "loc": { - "start": { - "line": 18, - "column": 20 - }, - "end": { - "line": 18, - "column": 25 - }, - "identifierName": "const" - }, + "start":520,"end":525,"loc":{"start":{"line":18,"column":20},"end":{"line":18,"column":25},"identifierName":"const"}, "name": "const" } } @@ -2115,93 +699,26 @@ }, { "type": "VariableDeclaration", - "start": 527, - "end": 560, - "loc": { - "start": { - "line": 19, - "column": 0 - }, - "end": { - "line": 19, - "column": 33 - } - }, + "start":527,"end":560,"loc":{"start":{"line":19,"column":0},"end":{"line":19,"column":33}}, "declarations": [ { "type": "VariableDeclarator", - "start": 531, - "end": 559, - "loc": { - "start": { - "line": 19, - "column": 4 - }, - "end": { - "line": 19, - "column": 32 - } - }, + "start":531,"end":559,"loc":{"start":{"line":19,"column":4},"end":{"line":19,"column":32}}, "id": { "type": "Identifier", - "start": 531, - "end": 533, - "loc": { - "start": { - "line": 19, - "column": 4 - }, - "end": { - "line": 19, - "column": 6 - }, - "identifierName": "a8" - }, + "start":531,"end":533,"loc":{"start":{"line":19,"column":4},"end":{"line":19,"column":6},"identifierName":"a8"}, "name": "a8" }, "init": { "type": "TSAsExpression", - "start": 536, - "end": 559, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 32 - } - }, + "start":536,"end":559,"loc":{"start":{"line":19,"column":9},"end":{"line":19,"column":32}}, "expression": { "type": "ArrayExpression", - "start": 536, - "end": 550, - "loc": { - "start": { - "line": 19, - "column": 9 - }, - "end": { - "line": 19, - "column": 23 - } - }, + "start":536,"end":550,"loc":{"start":{"line":19,"column":9},"end":{"line":19,"column":23}}, "elements": [ { "type": "StringLiteral", - "start": 537, - "end": 542, - "loc": { - "start": { - "line": 19, - "column": 10 - }, - "end": { - "line": 19, - "column": 15 - } - }, + "start":537,"end":542,"loc":{"start":{"line":19,"column":10},"end":{"line":19,"column":15}}, "extra": { "rawValue": "abc", "raw": "'abc'" @@ -2210,33 +727,10 @@ }, { "type": "SpreadElement", - "start": 544, - "end": 549, - "loc": { - "start": { - "line": 19, - "column": 17 - }, - "end": { - "line": 19, - "column": 22 - } - }, + "start":544,"end":549,"loc":{"start":{"line":19,"column":17},"end":{"line":19,"column":22}}, "argument": { "type": "Identifier", - "start": 547, - "end": 549, - "loc": { - "start": { - "line": 19, - "column": 20 - }, - "end": { - "line": 19, - "column": 22 - }, - "identifierName": "a7" - }, + "start":547,"end":549,"loc":{"start":{"line":19,"column":20},"end":{"line":19,"column":22},"identifierName":"a7"}, "name": "a7" } } @@ -2244,33 +738,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 554, - "end": 559, - "loc": { - "start": { - "line": 19, - "column": 27 - }, - "end": { - "line": 19, - "column": 32 - } - }, + "start":554,"end":559,"loc":{"start":{"line":19,"column":27},"end":{"line":19,"column":32}}, "typeName": { "type": "Identifier", - "start": 554, - "end": 559, - "loc": { - "start": { - "line": 19, - "column": 27 - }, - "end": { - "line": 19, - "column": 32 - }, - "identifierName": "const" - }, + "start":554,"end":559,"loc":{"start":{"line":19,"column":27},"end":{"line":19,"column":32},"identifierName":"const"}, "name": "const" } } @@ -2281,127 +752,37 @@ }, { "type": "VariableDeclaration", - "start": 562, - "end": 597, - "loc": { - "start": { - "line": 21, - "column": 0 - }, - "end": { - "line": 21, - "column": 35 - } - }, + "start":562,"end":597,"loc":{"start":{"line":21,"column":0},"end":{"line":21,"column":35}}, "declarations": [ { "type": "VariableDeclarator", - "start": 566, - "end": 596, - "loc": { - "start": { - "line": 21, - "column": 4 - }, - "end": { - "line": 21, - "column": 34 - } - }, + "start":566,"end":596,"loc":{"start":{"line":21,"column":4},"end":{"line":21,"column":34}}, "id": { "type": "Identifier", - "start": 566, - "end": 568, - "loc": { - "start": { - "line": 21, - "column": 4 - }, - "end": { - "line": 21, - "column": 6 - }, - "identifierName": "o1" - }, + "start":566,"end":568,"loc":{"start":{"line":21,"column":4},"end":{"line":21,"column":6},"identifierName":"o1"}, "name": "o1" }, "init": { "type": "TSAsExpression", - "start": 571, - "end": 596, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 34 - } - }, + "start":571,"end":596,"loc":{"start":{"line":21,"column":9},"end":{"line":21,"column":34}}, "expression": { "type": "ObjectExpression", - "start": 571, - "end": 587, - "loc": { - "start": { - "line": 21, - "column": 9 - }, - "end": { - "line": 21, - "column": 25 - } - }, + "start":571,"end":587,"loc":{"start":{"line":21,"column":9},"end":{"line":21,"column":25}}, "properties": [ { "type": "ObjectProperty", - "start": 573, - "end": 578, - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 16 - } - }, + "start":573,"end":578,"loc":{"start":{"line":21,"column":11},"end":{"line":21,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 573, - "end": 574, - "loc": { - "start": { - "line": 21, - "column": 11 - }, - "end": { - "line": 21, - "column": 12 - }, - "identifierName": "x" - }, + "start":573,"end":574,"loc":{"start":{"line":21,"column":11},"end":{"line":21,"column":12},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 576, - "end": 578, - "loc": { - "start": { - "line": 21, - "column": 14 - }, - "end": { - "line": 21, - "column": 16 - } - }, + "start":576,"end":578,"loc":{"start":{"line":21,"column":14},"end":{"line":21,"column":16}}, "extra": { "rawValue": 10, "raw": "10" @@ -2411,52 +792,18 @@ }, { "type": "ObjectProperty", - "start": 580, - "end": 585, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 23 - } - }, + "start":580,"end":585,"loc":{"start":{"line":21,"column":18},"end":{"line":21,"column":23}}, "method": false, "key": { "type": "Identifier", - "start": 580, - "end": 581, - "loc": { - "start": { - "line": 21, - "column": 18 - }, - "end": { - "line": 21, - "column": 19 - }, - "identifierName": "y" - }, + "start":580,"end":581,"loc":{"start":{"line":21,"column":18},"end":{"line":21,"column":19},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 583, - "end": 585, - "loc": { - "start": { - "line": 21, - "column": 21 - }, - "end": { - "line": 21, - "column": 23 - } - }, + "start":583,"end":585,"loc":{"start":{"line":21,"column":21},"end":{"line":21,"column":23}}, "extra": { "rawValue": 20, "raw": "20" @@ -2468,33 +815,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 591, - "end": 596, - "loc": { - "start": { - "line": 21, - "column": 29 - }, - "end": { - "line": 21, - "column": 34 - } - }, + "start":591,"end":596,"loc":{"start":{"line":21,"column":29},"end":{"line":21,"column":34}}, "typeName": { "type": "Identifier", - "start": 591, - "end": 596, - "loc": { - "start": { - "line": 21, - "column": 29 - }, - "end": { - "line": 21, - "column": 34 - }, - "identifierName": "const" - }, + "start":591,"end":596,"loc":{"start":{"line":21,"column":29},"end":{"line":21,"column":34},"identifierName":"const"}, "name": "const" } } @@ -2505,127 +829,37 @@ }, { "type": "VariableDeclaration", - "start": 598, - "end": 666, - "loc": { - "start": { - "line": 22, - "column": 0 - }, - "end": { - "line": 22, - "column": 68 - } - }, + "start":598,"end":666,"loc":{"start":{"line":22,"column":0},"end":{"line":22,"column":68}}, "declarations": [ { "type": "VariableDeclarator", - "start": 602, - "end": 665, - "loc": { - "start": { - "line": 22, - "column": 4 - }, - "end": { - "line": 22, - "column": 67 - } - }, + "start":602,"end":665,"loc":{"start":{"line":22,"column":4},"end":{"line":22,"column":67}}, "id": { "type": "Identifier", - "start": 602, - "end": 604, - "loc": { - "start": { - "line": 22, - "column": 4 - }, - "end": { - "line": 22, - "column": 6 - }, - "identifierName": "o2" - }, + "start":602,"end":604,"loc":{"start":{"line":22,"column":4},"end":{"line":22,"column":6},"identifierName":"o2"}, "name": "o2" }, "init": { "type": "TSAsExpression", - "start": 607, - "end": 665, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 67 - } - }, + "start":607,"end":665,"loc":{"start":{"line":22,"column":9},"end":{"line":22,"column":67}}, "expression": { "type": "ObjectExpression", - "start": 607, - "end": 656, - "loc": { - "start": { - "line": 22, - "column": 9 - }, - "end": { - "line": 22, - "column": 58 - } - }, + "start":607,"end":656,"loc":{"start":{"line":22,"column":9},"end":{"line":22,"column":58}}, "properties": [ { "type": "ObjectProperty", - "start": 609, - "end": 613, - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 22, - "column": 15 - } - }, + "start":609,"end":613,"loc":{"start":{"line":22,"column":11},"end":{"line":22,"column":15}}, "method": false, "key": { "type": "Identifier", - "start": 609, - "end": 610, - "loc": { - "start": { - "line": 22, - "column": 11 - }, - "end": { - "line": 22, - "column": 12 - }, - "identifierName": "a" - }, + "start":609,"end":610,"loc":{"start":{"line":22,"column":11},"end":{"line":22,"column":12},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 612, - "end": 613, - "loc": { - "start": { - "line": 22, - "column": 14 - }, - "end": { - "line": 22, - "column": 15 - } - }, + "start":612,"end":613,"loc":{"start":{"line":22,"column":14},"end":{"line":22,"column":15}}, "extra": { "rawValue": 1, "raw": "1" @@ -2635,33 +869,11 @@ }, { "type": "ObjectProperty", - "start": 615, - "end": 621, - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 22, - "column": 23 - } - }, + "start":615,"end":621,"loc":{"start":{"line":22,"column":17},"end":{"line":22,"column":23}}, "method": false, "key": { "type": "StringLiteral", - "start": 615, - "end": 618, - "loc": { - "start": { - "line": 22, - "column": 17 - }, - "end": { - "line": 22, - "column": 20 - } - }, + "start":615,"end":618,"loc":{"start":{"line":22,"column":17},"end":{"line":22,"column":20}}, "extra": { "rawValue": "b", "raw": "'b'" @@ -2672,18 +884,7 @@ "shorthand": false, "value": { "type": "NumericLiteral", - "start": 620, - "end": 621, - "loc": { - "start": { - "line": 22, - "column": 22 - }, - "end": { - "line": 22, - "column": 23 - } - }, + "start":620,"end":621,"loc":{"start":{"line":22,"column":22},"end":{"line":22,"column":23}}, "extra": { "rawValue": 2, "raw": "2" @@ -2693,34 +894,12 @@ }, { "type": "ObjectProperty", - "start": 623, - "end": 631, - "loc": { - "start": { - "line": 22, - "column": 25 - }, - "end": { - "line": 22, - "column": 33 - } - }, + "start":623,"end":631,"loc":{"start":{"line":22,"column":25},"end":{"line":22,"column":33}}, "method": false, "computed": true, "key": { "type": "StringLiteral", - "start": 624, - "end": 627, - "loc": { - "start": { - "line": 22, - "column": 26 - }, - "end": { - "line": 22, - "column": 29 - } - }, + "start":624,"end":627,"loc":{"start":{"line":22,"column":26},"end":{"line":22,"column":29}}, "extra": { "rawValue": "c", "raw": "'c'" @@ -2730,18 +909,7 @@ "shorthand": false, "value": { "type": "NumericLiteral", - "start": 630, - "end": 631, - "loc": { - "start": { - "line": 22, - "column": 32 - }, - "end": { - "line": 22, - "column": 33 - } - }, + "start":630,"end":631,"loc":{"start":{"line":22,"column":32},"end":{"line":22,"column":33}}, "extra": { "rawValue": 3, "raw": "3" @@ -2751,34 +919,11 @@ }, { "type": "ObjectMethod", - "start": 633, - "end": 639, - "loc": { - "start": { - "line": 22, - "column": 35 - }, - "end": { - "line": 22, - "column": 41 - } - }, + "start":633,"end":639,"loc":{"start":{"line":22,"column":35},"end":{"line":22,"column":41}}, "method": true, "key": { "type": "Identifier", - "start": 633, - "end": 634, - "loc": { - "start": { - "line": 22, - "column": 35 - }, - "end": { - "line": 22, - "column": 36 - }, - "identifierName": "d" - }, + "start":633,"end":634,"loc":{"start":{"line":22,"column":35},"end":{"line":22,"column":36},"identifierName":"d"}, "name": "d" }, "computed": false, @@ -2789,66 +934,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 637, - "end": 639, - "loc": { - "start": { - "line": 22, - "column": 39 - }, - "end": { - "line": 22, - "column": 41 - } - }, + "start":637,"end":639,"loc":{"start":{"line":22,"column":39},"end":{"line":22,"column":41}}, "body": [], "directives": [] } }, { "type": "ObjectProperty", - "start": 641, - "end": 654, - "loc": { - "start": { - "line": 22, - "column": 43 - }, - "end": { - "line": 22, - "column": 56 - } - }, + "start":641,"end":654,"loc":{"start":{"line":22,"column":43},"end":{"line":22,"column":56}}, "method": false, "computed": true, "key": { "type": "BinaryExpression", - "start": 642, - "end": 650, - "loc": { - "start": { - "line": 22, - "column": 44 - }, - "end": { - "line": 22, - "column": 52 - } - }, + "start":642,"end":650,"loc":{"start":{"line":22,"column":44},"end":{"line":22,"column":52}}, "left": { "type": "StringLiteral", - "start": 642, - "end": 645, - "loc": { - "start": { - "line": 22, - "column": 44 - }, - "end": { - "line": 22, - "column": 47 - } - }, + "start":642,"end":645,"loc":{"start":{"line":22,"column":44},"end":{"line":22,"column":47}}, "extra": { "rawValue": "e", "raw": "'e'" @@ -2858,18 +959,7 @@ "operator": "+", "right": { "type": "StringLiteral", - "start": 648, - "end": 650, - "loc": { - "start": { - "line": 22, - "column": 50 - }, - "end": { - "line": 22, - "column": 52 - } - }, + "start":648,"end":650,"loc":{"start":{"line":22,"column":50},"end":{"line":22,"column":52}}, "extra": { "rawValue": "", "raw": "''" @@ -2880,18 +970,7 @@ "shorthand": false, "value": { "type": "NumericLiteral", - "start": 653, - "end": 654, - "loc": { - "start": { - "line": 22, - "column": 55 - }, - "end": { - "line": 22, - "column": 56 - } - }, + "start":653,"end":654,"loc":{"start":{"line":22,"column":55},"end":{"line":22,"column":56}}, "extra": { "rawValue": 4, "raw": "4" @@ -2903,33 +982,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 660, - "end": 665, - "loc": { - "start": { - "line": 22, - "column": 62 - }, - "end": { - "line": 22, - "column": 67 - } - }, + "start":660,"end":665,"loc":{"start":{"line":22,"column":62},"end":{"line":22,"column":67}}, "typeName": { "type": "Identifier", - "start": 660, - "end": 665, - "loc": { - "start": { - "line": 22, - "column": 62 - }, - "end": { - "line": 22, - "column": 67 - }, - "identifierName": "const" - }, + "start":660,"end":665,"loc":{"start":{"line":22,"column":62},"end":{"line":22,"column":67},"identifierName":"const"}, "name": "const" } } @@ -2940,140 +996,38 @@ }, { "type": "VariableDeclaration", - "start": 667, - "end": 702, - "loc": { - "start": { - "line": 23, - "column": 0 - }, - "end": { - "line": 23, - "column": 35 - } - }, + "start":667,"end":702,"loc":{"start":{"line":23,"column":0},"end":{"line":23,"column":35}}, "declarations": [ { "type": "VariableDeclarator", - "start": 671, - "end": 701, - "loc": { - "start": { - "line": 23, - "column": 4 - }, - "end": { - "line": 23, - "column": 34 - } - }, + "start":671,"end":701,"loc":{"start":{"line":23,"column":4},"end":{"line":23,"column":34}}, "id": { "type": "Identifier", - "start": 671, - "end": 673, - "loc": { - "start": { - "line": 23, - "column": 4 - }, - "end": { - "line": 23, - "column": 6 - }, - "identifierName": "o3" - }, + "start":671,"end":673,"loc":{"start":{"line":23,"column":4},"end":{"line":23,"column":6},"identifierName":"o3"}, "name": "o3" }, "init": { "type": "TSAsExpression", - "start": 676, - "end": 701, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 34 - } - }, + "start":676,"end":701,"loc":{"start":{"line":23,"column":9},"end":{"line":23,"column":34}}, "expression": { "type": "ObjectExpression", - "start": 676, - "end": 692, - "loc": { - "start": { - "line": 23, - "column": 9 - }, - "end": { - "line": 23, - "column": 25 - } - }, + "start":676,"end":692,"loc":{"start":{"line":23,"column":9},"end":{"line":23,"column":25}}, "properties": [ { "type": "SpreadElement", - "start": 678, - "end": 683, - "loc": { - "start": { - "line": 23, - "column": 11 - }, - "end": { - "line": 23, - "column": 16 - } - }, + "start":678,"end":683,"loc":{"start":{"line":23,"column":11},"end":{"line":23,"column":16}}, "argument": { "type": "Identifier", - "start": 681, - "end": 683, - "loc": { - "start": { - "line": 23, - "column": 14 - }, - "end": { - "line": 23, - "column": 16 - }, - "identifierName": "o1" - }, + "start":681,"end":683,"loc":{"start":{"line":23,"column":14},"end":{"line":23,"column":16},"identifierName":"o1"}, "name": "o1" } }, { "type": "SpreadElement", - "start": 685, - "end": 690, - "loc": { - "start": { - "line": 23, - "column": 18 - }, - "end": { - "line": 23, - "column": 23 - } - }, + "start":685,"end":690,"loc":{"start":{"line":23,"column":18},"end":{"line":23,"column":23}}, "argument": { "type": "Identifier", - "start": 688, - "end": 690, - "loc": { - "start": { - "line": 23, - "column": 21 - }, - "end": { - "line": 23, - "column": 23 - }, - "identifierName": "o2" - }, + "start":688,"end":690,"loc":{"start":{"line":23,"column":21},"end":{"line":23,"column":23},"identifierName":"o2"}, "name": "o2" } } @@ -3081,33 +1035,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 696, - "end": 701, - "loc": { - "start": { - "line": 23, - "column": 29 - }, - "end": { - "line": 23, - "column": 34 - } - }, + "start":696,"end":701,"loc":{"start":{"line":23,"column":29},"end":{"line":23,"column":34}}, "typeName": { "type": "Identifier", - "start": 696, - "end": 701, - "loc": { - "start": { - "line": 23, - "column": 29 - }, - "end": { - "line": 23, - "column": 34 - }, - "identifierName": "const" - }, + "start":696,"end":701,"loc":{"start":{"line":23,"column":29},"end":{"line":23,"column":34},"identifierName":"const"}, "name": "const" } } @@ -3118,108 +1049,29 @@ }, { "type": "VariableDeclaration", - "start": 703, - "end": 731, - "loc": { - "start": { - "line": 24, - "column": 0 - }, - "end": { - "line": 24, - "column": 28 - } - }, + "start":703,"end":731,"loc":{"start":{"line":24,"column":0},"end":{"line":24,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 707, - "end": 730, - "loc": { - "start": { - "line": 24, - "column": 4 - }, - "end": { - "line": 24, - "column": 27 - } - }, + "start":707,"end":730,"loc":{"start":{"line":24,"column":4},"end":{"line":24,"column":27}}, "id": { "type": "Identifier", - "start": 707, - "end": 709, - "loc": { - "start": { - "line": 24, - "column": 4 - }, - "end": { - "line": 24, - "column": 6 - }, - "identifierName": "o5" - }, + "start":707,"end":709,"loc":{"start":{"line":24,"column":4},"end":{"line":24,"column":6},"identifierName":"o5"}, "name": "o5" }, "init": { "type": "TSAsExpression", - "start": 712, - "end": 730, - "loc": { - "start": { - "line": 24, - "column": 9 - }, - "end": { - "line": 24, - "column": 27 - } - }, + "start":712,"end":730,"loc":{"start":{"line":24,"column":9},"end":{"line":24,"column":27}}, "expression": { "type": "ObjectExpression", - "start": 712, - "end": 721, - "loc": { - "start": { - "line": 24, - "column": 9 - }, - "end": { - "line": 24, - "column": 18 - } - }, + "start":712,"end":721,"loc":{"start":{"line":24,"column":9},"end":{"line":24,"column":18}}, "properties": [ { "type": "SpreadElement", - "start": 714, - "end": 719, - "loc": { - "start": { - "line": 24, - "column": 11 - }, - "end": { - "line": 24, - "column": 16 - } - }, + "start":714,"end":719,"loc":{"start":{"line":24,"column":11},"end":{"line":24,"column":16}}, "argument": { "type": "Identifier", - "start": 717, - "end": 719, - "loc": { - "start": { - "line": 24, - "column": 14 - }, - "end": { - "line": 24, - "column": 16 - }, - "identifierName": "o4" - }, + "start":717,"end":719,"loc":{"start":{"line":24,"column":14},"end":{"line":24,"column":16},"identifierName":"o4"}, "name": "o4" } } @@ -3227,33 +1079,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 725, - "end": 730, - "loc": { - "start": { - "line": 24, - "column": 22 - }, - "end": { - "line": 24, - "column": 27 - } - }, + "start":725,"end":730,"loc":{"start":{"line":24,"column":22},"end":{"line":24,"column":27}}, "typeName": { "type": "Identifier", - "start": 725, - "end": 730, - "loc": { - "start": { - "line": 24, - "column": 22 - }, - "end": { - "line": 24, - "column": 27 - }, - "identifierName": "const" - }, + "start":725,"end":730,"loc":{"start":{"line":24,"column":22},"end":{"line":24,"column":27},"identifierName":"const"}, "name": "const" } } @@ -3264,108 +1093,29 @@ }, { "type": "VariableDeclaration", - "start": 732, - "end": 759, - "loc": { - "start": { - "line": 25, - "column": 0 - }, - "end": { - "line": 25, - "column": 27 - } - }, + "start":732,"end":759,"loc":{"start":{"line":25,"column":0},"end":{"line":25,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 736, - "end": 758, - "loc": { - "start": { - "line": 25, - "column": 4 - }, - "end": { - "line": 25, - "column": 26 - } - }, + "start":736,"end":758,"loc":{"start":{"line":25,"column":4},"end":{"line":25,"column":26}}, "id": { "type": "Identifier", - "start": 736, - "end": 738, - "loc": { - "start": { - "line": 25, - "column": 4 - }, - "end": { - "line": 25, - "column": 6 - }, - "identifierName": "o7" - }, + "start":736,"end":738,"loc":{"start":{"line":25,"column":4},"end":{"line":25,"column":6},"identifierName":"o7"}, "name": "o7" }, "init": { "type": "TSAsExpression", - "start": 741, - "end": 758, - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 26 - } - }, + "start":741,"end":758,"loc":{"start":{"line":25,"column":9},"end":{"line":25,"column":26}}, "expression": { "type": "ObjectExpression", - "start": 741, - "end": 749, - "loc": { - "start": { - "line": 25, - "column": 9 - }, - "end": { - "line": 25, - "column": 17 - } - }, + "start":741,"end":749,"loc":{"start":{"line":25,"column":9},"end":{"line":25,"column":17}}, "properties": [ { "type": "SpreadElement", - "start": 743, - "end": 747, - "loc": { - "start": { - "line": 25, - "column": 11 - }, - "end": { - "line": 25, - "column": 15 - } - }, + "start":743,"end":747,"loc":{"start":{"line":25,"column":11},"end":{"line":25,"column":15}}, "argument": { "type": "Identifier", - "start": 746, - "end": 747, - "loc": { - "start": { - "line": 25, - "column": 14 - }, - "end": { - "line": 25, - "column": 15 - }, - "identifierName": "d" - }, + "start":746,"end":747,"loc":{"start":{"line":25,"column":14},"end":{"line":25,"column":15},"identifierName":"d"}, "name": "d" } } @@ -3373,33 +1123,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 753, - "end": 758, - "loc": { - "start": { - "line": 25, - "column": 21 - }, - "end": { - "line": 25, - "column": 26 - } - }, + "start":753,"end":758,"loc":{"start":{"line":25,"column":21},"end":{"line":25,"column":26}}, "typeName": { "type": "Identifier", - "start": 753, - "end": 758, - "loc": { - "start": { - "line": 25, - "column": 21 - }, - "end": { - "line": 25, - "column": 26 - }, - "identifierName": "const" - }, + "start":753,"end":758,"loc":{"start":{"line":25,"column":21},"end":{"line":25,"column":26},"identifierName":"const"}, "name": "const" } } @@ -3410,127 +1137,37 @@ }, { "type": "VariableDeclaration", - "start": 760, - "end": 811, - "loc": { - "start": { - "line": 26, - "column": 0 - }, - "end": { - "line": 26, - "column": 51 - } - }, + "start":760,"end":811,"loc":{"start":{"line":26,"column":0},"end":{"line":26,"column":51}}, "declarations": [ { "type": "VariableDeclarator", - "start": 764, - "end": 810, - "loc": { - "start": { - "line": 26, - "column": 4 - }, - "end": { - "line": 26, - "column": 50 - } - }, + "start":764,"end":810,"loc":{"start":{"line":26,"column":4},"end":{"line":26,"column":50}}, "id": { "type": "Identifier", - "start": 764, - "end": 766, - "loc": { - "start": { - "line": 26, - "column": 4 - }, - "end": { - "line": 26, - "column": 6 - }, - "identifierName": "o9" - }, + "start":764,"end":766,"loc":{"start":{"line":26,"column":4},"end":{"line":26,"column":6},"identifierName":"o9"}, "name": "o9" }, "init": { "type": "TSAsExpression", - "start": 769, - "end": 810, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 50 - } - }, + "start":769,"end":810,"loc":{"start":{"line":26,"column":9},"end":{"line":26,"column":50}}, "expression": { "type": "ObjectExpression", - "start": 769, - "end": 801, - "loc": { - "start": { - "line": 26, - "column": 9 - }, - "end": { - "line": 26, - "column": 41 - } - }, + "start":769,"end":801,"loc":{"start":{"line":26,"column":9},"end":{"line":26,"column":41}}, "properties": [ { "type": "ObjectProperty", - "start": 771, - "end": 776, - "loc": { - "start": { - "line": 26, - "column": 11 - }, - "end": { - "line": 26, - "column": 16 - } - }, + "start":771,"end":776,"loc":{"start":{"line":26,"column":11},"end":{"line":26,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 771, - "end": 772, - "loc": { - "start": { - "line": 26, - "column": 11 - }, - "end": { - "line": 26, - "column": 12 - }, - "identifierName": "x" - }, + "start":771,"end":772,"loc":{"start":{"line":26,"column":11},"end":{"line":26,"column":12},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 774, - "end": 776, - "loc": { - "start": { - "line": 26, - "column": 14 - }, - "end": { - "line": 26, - "column": 16 - } - }, + "start":774,"end":776,"loc":{"start":{"line":26,"column":14},"end":{"line":26,"column":16}}, "extra": { "rawValue": 10, "raw": "10" @@ -3540,34 +1177,11 @@ }, { "type": "ObjectMethod", - "start": 778, - "end": 799, - "loc": { - "start": { - "line": 26, - "column": 18 - }, - "end": { - "line": 26, - "column": 39 - } - }, + "start":778,"end":799,"loc":{"start":{"line":26,"column":18},"end":{"line":26,"column":39}}, "method": true, "key": { "type": "Identifier", - "start": 778, - "end": 781, - "loc": { - "start": { - "line": 26, - "column": 18 - }, - "end": { - "line": 26, - "column": 21 - }, - "identifierName": "foo" - }, + "start":778,"end":781,"loc":{"start":{"line":26,"column":18},"end":{"line":26,"column":21},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -3578,110 +1192,32 @@ "params": [], "body": { "type": "BlockStatement", - "start": 784, - "end": 799, - "loc": { - "start": { - "line": 26, - "column": 24 - }, - "end": { - "line": 26, - "column": 39 - } - }, + "start":784,"end":799,"loc":{"start":{"line":26,"column":24},"end":{"line":26,"column":39}}, "body": [ { "type": "ExpressionStatement", - "start": 786, - "end": 797, - "loc": { - "start": { - "line": 26, - "column": 26 - }, - "end": { - "line": 26, - "column": 37 - } - }, + "start":786,"end":797,"loc":{"start":{"line":26,"column":26},"end":{"line":26,"column":37}}, "expression": { "type": "AssignmentExpression", - "start": 786, - "end": 797, - "loc": { - "start": { - "line": 26, - "column": 26 - }, - "end": { - "line": 26, - "column": 37 - } - }, + "start":786,"end":797,"loc":{"start":{"line":26,"column":26},"end":{"line":26,"column":37}}, "operator": "=", "left": { "type": "MemberExpression", - "start": 786, - "end": 792, - "loc": { - "start": { - "line": 26, - "column": 26 - }, - "end": { - "line": 26, - "column": 32 - } - }, + "start":786,"end":792,"loc":{"start":{"line":26,"column":26},"end":{"line":26,"column":32}}, "object": { "type": "ThisExpression", - "start": 786, - "end": 790, - "loc": { - "start": { - "line": 26, - "column": 26 - }, - "end": { - "line": 26, - "column": 30 - } - } + "start":786,"end":790,"loc":{"start":{"line":26,"column":26},"end":{"line":26,"column":30}} }, "property": { "type": "Identifier", - "start": 791, - "end": 792, - "loc": { - "start": { - "line": 26, - "column": 31 - }, - "end": { - "line": 26, - "column": 32 - }, - "identifierName": "x" - }, + "start":791,"end":792,"loc":{"start":{"line":26,"column":31},"end":{"line":26,"column":32},"identifierName":"x"}, "name": "x" }, "computed": false }, "right": { "type": "NumericLiteral", - "start": 795, - "end": 797, - "loc": { - "start": { - "line": 26, - "column": 35 - }, - "end": { - "line": 26, - "column": 37 - } - }, + "start":795,"end":797,"loc":{"start":{"line":26,"column":35},"end":{"line":26,"column":37}}, "extra": { "rawValue": 20, "raw": "20" @@ -3698,33 +1234,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 805, - "end": 810, - "loc": { - "start": { - "line": 26, - "column": 45 - }, - "end": { - "line": 26, - "column": 50 - } - }, + "start":805,"end":810,"loc":{"start":{"line":26,"column":45},"end":{"line":26,"column":50}}, "typeName": { "type": "Identifier", - "start": 805, - "end": 810, - "loc": { - "start": { - "line": 26, - "column": 45 - }, - "end": { - "line": 26, - "column": 50 - }, - "identifierName": "const" - }, + "start":805,"end":810,"loc":{"start":{"line":26,"column":45},"end":{"line":26,"column":50},"identifierName":"const"}, "name": "const" } } @@ -3736,95 +1249,28 @@ { "type": "CommentLine", "value": " Error", - "start": 813, - "end": 821, - "loc": { - "start": { - "line": 26, - "column": 53 - }, - "end": { - "line": 26, - "column": 61 - } - } + "start":813,"end":821,"loc":{"start":{"line":26,"column":53},"end":{"line":26,"column":61}} } ] }, { "type": "VariableDeclaration", - "start": 823, - "end": 846, - "loc": { - "start": { - "line": 28, - "column": 0 - }, - "end": { - "line": 28, - "column": 23 - } - }, + "start":823,"end":846,"loc":{"start":{"line":28,"column":0},"end":{"line":28,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 827, - "end": 845, - "loc": { - "start": { - "line": 28, - "column": 4 - }, - "end": { - "line": 28, - "column": 22 - } - }, + "start":827,"end":845,"loc":{"start":{"line":28,"column":4},"end":{"line":28,"column":22}}, "id": { "type": "Identifier", - "start": 827, - "end": 829, - "loc": { - "start": { - "line": 28, - "column": 4 - }, - "end": { - "line": 28, - "column": 6 - }, - "identifierName": "p1" - }, + "start":827,"end":829,"loc":{"start":{"line":28,"column":4},"end":{"line":28,"column":6},"identifierName":"p1"}, "name": "p1" }, "init": { "type": "TSAsExpression", - "start": 832, - "end": 845, - "loc": { - "start": { - "line": 28, - "column": 9 - }, - "end": { - "line": 28, - "column": 22 - } - }, + "start":832,"end":845,"loc":{"start":{"line":28,"column":9},"end":{"line":28,"column":22}}, "expression": { "type": "NumericLiteral", - "start": 833, - "end": 835, - "loc": { - "start": { - "line": 28, - "column": 10 - }, - "end": { - "line": 28, - "column": 12 - } - }, + "start":833,"end":835,"loc":{"start":{"line":28,"column":10},"end":{"line":28,"column":12}}, "extra": { "rawValue": 10, "raw": "10", @@ -3835,33 +1281,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 840, - "end": 845, - "loc": { - "start": { - "line": 28, - "column": 17 - }, - "end": { - "line": 28, - "column": 22 - } - }, + "start":840,"end":845,"loc":{"start":{"line":28,"column":17},"end":{"line":28,"column":22}}, "typeName": { "type": "Identifier", - "start": 840, - "end": 845, - "loc": { - "start": { - "line": 28, - "column": 17 - }, - "end": { - "line": 28, - "column": 22 - }, - "identifierName": "const" - }, + "start":840,"end":845,"loc":{"start":{"line":28,"column":17},"end":{"line":28,"column":22},"identifierName":"const"}, "name": "const" } } @@ -3873,111 +1296,33 @@ { "type": "CommentLine", "value": " Error", - "start": 813, - "end": 821, - "loc": { - "start": { - "line": 26, - "column": 53 - }, - "end": { - "line": 26, - "column": 61 - } - } + "start":813,"end":821,"loc":{"start":{"line":26,"column":53},"end":{"line":26,"column":61}} } ] }, { "type": "VariableDeclaration", - "start": 847, - "end": 873, - "loc": { - "start": { - "line": 29, - "column": 0 - }, - "end": { - "line": 29, - "column": 26 - } - }, + "start":847,"end":873,"loc":{"start":{"line":29,"column":0},"end":{"line":29,"column":26}}, "declarations": [ { "type": "VariableDeclarator", - "start": 851, - "end": 872, - "loc": { - "start": { - "line": 29, - "column": 4 - }, - "end": { - "line": 29, - "column": 25 - } - }, + "start":851,"end":872,"loc":{"start":{"line":29,"column":4},"end":{"line":29,"column":25}}, "id": { "type": "Identifier", - "start": 851, - "end": 853, - "loc": { - "start": { - "line": 29, - "column": 4 - }, - "end": { - "line": 29, - "column": 6 - }, - "identifierName": "p2" - }, + "start":851,"end":853,"loc":{"start":{"line":29,"column":4},"end":{"line":29,"column":6},"identifierName":"p2"}, "name": "p2" }, "init": { "type": "TSAsExpression", - "start": 856, - "end": 872, - "loc": { - "start": { - "line": 29, - "column": 9 - }, - "end": { - "line": 29, - "column": 25 - } - }, + "start":856,"end":872,"loc":{"start":{"line":29,"column":9},"end":{"line":29,"column":25}}, "expression": { "type": "UnaryExpression", - "start": 858, - "end": 861, - "loc": { - "start": { - "line": 29, - "column": 11 - }, - "end": { - "line": 29, - "column": 14 - } - }, + "start":858,"end":861,"loc":{"start":{"line":29,"column":11},"end":{"line":29,"column":14}}, "operator": "-", "prefix": true, "argument": { "type": "NumericLiteral", - "start": 859, - "end": 861, - "loc": { - "start": { - "line": 29, - "column": 12 - }, - "end": { - "line": 29, - "column": 14 - } - }, + "start":859,"end":861,"loc":{"start":{"line":29,"column":12},"end":{"line":29,"column":14}}, "extra": { "rawValue": 10, "raw": "10" @@ -3991,33 +1336,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 867, - "end": 872, - "loc": { - "start": { - "line": 29, - "column": 20 - }, - "end": { - "line": 29, - "column": 25 - } - }, + "start":867,"end":872,"loc":{"start":{"line":29,"column":20},"end":{"line":29,"column":25}}, "typeName": { "type": "Identifier", - "start": 867, - "end": 872, - "loc": { - "start": { - "line": 29, - "column": 20 - }, - "end": { - "line": 29, - "column": 25 - }, - "identifierName": "const" - }, + "start":867,"end":872,"loc":{"start":{"line":29,"column":20},"end":{"line":29,"column":25},"identifierName":"const"}, "name": "const" } } @@ -4028,93 +1350,26 @@ }, { "type": "VariableDeclaration", - "start": 874, - "end": 901, - "loc": { - "start": { - "line": 30, - "column": 0 - }, - "end": { - "line": 30, - "column": 27 - } - }, + "start":874,"end":901,"loc":{"start":{"line":30,"column":0},"end":{"line":30,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 878, - "end": 900, - "loc": { - "start": { - "line": 30, - "column": 4 - }, - "end": { - "line": 30, - "column": 26 - } - }, + "start":878,"end":900,"loc":{"start":{"line":30,"column":4},"end":{"line":30,"column":26}}, "id": { "type": "Identifier", - "start": 878, - "end": 880, - "loc": { - "start": { - "line": 30, - "column": 4 - }, - "end": { - "line": 30, - "column": 6 - }, - "identifierName": "p3" - }, + "start":878,"end":880,"loc":{"start":{"line":30,"column":4},"end":{"line":30,"column":6},"identifierName":"p3"}, "name": "p3" }, "init": { "type": "TSAsExpression", - "start": 883, - "end": 900, - "loc": { - "start": { - "line": 30, - "column": 9 - }, - "end": { - "line": 30, - "column": 26 - } - }, + "start":883,"end":900,"loc":{"start":{"line":30,"column":9},"end":{"line":30,"column":26}}, "expression": { "type": "ArrayExpression", - "start": 884, - "end": 890, - "loc": { - "start": { - "line": 30, - "column": 10 - }, - "end": { - "line": 30, - "column": 16 - } - }, + "start":884,"end":890,"loc":{"start":{"line":30,"column":10},"end":{"line":30,"column":16}}, "elements": [ { "type": "NumericLiteral", - "start": 886, - "end": 888, - "loc": { - "start": { - "line": 30, - "column": 12 - }, - "end": { - "line": 30, - "column": 14 - } - }, + "start":886,"end":888,"loc":{"start":{"line":30,"column":12},"end":{"line":30,"column":14}}, "extra": { "rawValue": 10, "raw": "10", @@ -4131,33 +1386,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 895, - "end": 900, - "loc": { - "start": { - "line": 30, - "column": 21 - }, - "end": { - "line": 30, - "column": 26 - } - }, + "start":895,"end":900,"loc":{"start":{"line":30,"column":21},"end":{"line":30,"column":26}}, "typeName": { "type": "Identifier", - "start": 895, - "end": 900, - "loc": { - "start": { - "line": 30, - "column": 21 - }, - "end": { - "line": 30, - "column": 26 - }, - "identifierName": "const" - }, + "start":895,"end":900,"loc":{"start":{"line":30,"column":21},"end":{"line":30,"column":26},"identifierName":"const"}, "name": "const" } } @@ -4168,138 +1400,38 @@ }, { "type": "VariableDeclaration", - "start": 902, - "end": 931, - "loc": { - "start": { - "line": 31, - "column": 0 - }, - "end": { - "line": 31, - "column": 29 - } - }, + "start":902,"end":931,"loc":{"start":{"line":31,"column":0},"end":{"line":31,"column":29}}, "declarations": [ { "type": "VariableDeclarator", - "start": 906, - "end": 930, - "loc": { - "start": { - "line": 31, - "column": 4 - }, - "end": { - "line": 31, - "column": 28 - } - }, + "start":906,"end":930,"loc":{"start":{"line":31,"column":4},"end":{"line":31,"column":28}}, "id": { "type": "Identifier", - "start": 906, - "end": 908, - "loc": { - "start": { - "line": 31, - "column": 4 - }, - "end": { - "line": 31, - "column": 6 - }, - "identifierName": "p4" - }, + "start":906,"end":908,"loc":{"start":{"line":31,"column":4},"end":{"line":31,"column":6},"identifierName":"p4"}, "name": "p4" }, "init": { "type": "TSAsExpression", - "start": 911, - "end": 930, - "loc": { - "start": { - "line": 31, - "column": 9 - }, - "end": { - "line": 31, - "column": 28 - } - }, + "start":911,"end":930,"loc":{"start":{"line":31,"column":9},"end":{"line":31,"column":28}}, "expression": { "type": "ArrayExpression", - "start": 911, - "end": 921, - "loc": { - "start": { - "line": 31, - "column": 9 - }, - "end": { - "line": 31, - "column": 19 - } - }, + "start":911,"end":921,"loc":{"start":{"line":31,"column":9},"end":{"line":31,"column":19}}, "elements": [ { "type": "ArrayExpression", - "start": 912, - "end": 920, - "loc": { - "start": { - "line": 31, - "column": 10 - }, - "end": { - "line": 31, - "column": 18 - } - }, + "start":912,"end":920,"loc":{"start":{"line":31,"column":10},"end":{"line":31,"column":18}}, "elements": [ { "type": "ArrayExpression", - "start": 913, - "end": 919, - "loc": { - "start": { - "line": 31, - "column": 11 - }, - "end": { - "line": 31, - "column": 17 - } - }, + "start":913,"end":919,"loc":{"start":{"line":31,"column":11},"end":{"line":31,"column":17}}, "elements": [ { "type": "ArrayExpression", - "start": 914, - "end": 918, - "loc": { - "start": { - "line": 31, - "column": 12 - }, - "end": { - "line": 31, - "column": 16 - } - }, + "start":914,"end":918,"loc":{"start":{"line":31,"column":12},"end":{"line":31,"column":16}}, "elements": [ { "type": "NumericLiteral", - "start": 915, - "end": 917, - "loc": { - "start": { - "line": 31, - "column": 13 - }, - "end": { - "line": 31, - "column": 15 - } - }, + "start":915,"end":917,"loc":{"start":{"line":31,"column":13},"end":{"line":31,"column":15}}, "extra": { "rawValue": 10, "raw": "10" @@ -4316,33 +1448,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 925, - "end": 930, - "loc": { - "start": { - "line": 31, - "column": 23 - }, - "end": { - "line": 31, - "column": 28 - } - }, + "start":925,"end":930,"loc":{"start":{"line":31,"column":23},"end":{"line":31,"column":28}}, "typeName": { "type": "Identifier", - "start": 925, - "end": 930, - "loc": { - "start": { - "line": 31, - "column": 23 - }, - "end": { - "line": 31, - "column": 28 - }, - "identifierName": "const" - }, + "start":925,"end":930,"loc":{"start":{"line":31,"column":23},"end":{"line":31,"column":28},"identifierName":"const"}, "name": "const" } } @@ -4353,127 +1462,37 @@ }, { "type": "VariableDeclaration", - "start": 933, - "end": 995, - "loc": { - "start": { - "line": 33, - "column": 0 - }, - "end": { - "line": 33, - "column": 62 - } - }, + "start":933,"end":995,"loc":{"start":{"line":33,"column":0},"end":{"line":33,"column":62}}, "declarations": [ { "type": "VariableDeclarator", - "start": 937, - "end": 994, - "loc": { - "start": { - "line": 33, - "column": 4 - }, - "end": { - "line": 33, - "column": 61 - } - }, + "start":937,"end":994,"loc":{"start":{"line":33,"column":4},"end":{"line":33,"column":61}}, "id": { "type": "Identifier", - "start": 937, - "end": 939, - "loc": { - "start": { - "line": 33, - "column": 4 - }, - "end": { - "line": 33, - "column": 6 - }, - "identifierName": "x1" - }, + "start":937,"end":939,"loc":{"start":{"line":33,"column":4},"end":{"line":33,"column":6},"identifierName":"x1"}, "name": "x1" }, "init": { "type": "TSAsExpression", - "start": 942, - "end": 994, - "loc": { - "start": { - "line": 33, - "column": 9 - }, - "end": { - "line": 33, - "column": 61 - } - }, + "start":942,"end":994,"loc":{"start":{"line":33,"column":9},"end":{"line":33,"column":61}}, "expression": { "type": "ObjectExpression", - "start": 942, - "end": 985, - "loc": { - "start": { - "line": 33, - "column": 9 - }, - "end": { - "line": 33, - "column": 52 - } - }, + "start":942,"end":985,"loc":{"start":{"line":33,"column":9},"end":{"line":33,"column":52}}, "properties": [ { "type": "ObjectProperty", - "start": 944, - "end": 949, - "loc": { - "start": { - "line": 33, - "column": 11 - }, - "end": { - "line": 33, - "column": 16 - } - }, + "start":944,"end":949,"loc":{"start":{"line":33,"column":11},"end":{"line":33,"column":16}}, "method": false, "key": { "type": "Identifier", - "start": 944, - "end": 945, - "loc": { - "start": { - "line": 33, - "column": 11 - }, - "end": { - "line": 33, - "column": 12 - }, - "identifierName": "x" - }, + "start":944,"end":945,"loc":{"start":{"line":33,"column":11},"end":{"line":33,"column":12},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 947, - "end": 949, - "loc": { - "start": { - "line": 33, - "column": 14 - }, - "end": { - "line": 33, - "column": 16 - } - }, + "start":947,"end":949,"loc":{"start":{"line":33,"column":14},"end":{"line":33,"column":16}}, "extra": { "rawValue": 10, "raw": "10" @@ -4483,67 +1502,22 @@ }, { "type": "ObjectProperty", - "start": 951, - "end": 962, - "loc": { - "start": { - "line": 33, - "column": 18 - }, - "end": { - "line": 33, - "column": 29 - } - }, + "start":951,"end":962,"loc":{"start":{"line":33,"column":18},"end":{"line":33,"column":29}}, "method": false, "key": { "type": "Identifier", - "start": 951, - "end": 952, - "loc": { - "start": { - "line": 33, - "column": 18 - }, - "end": { - "line": 33, - "column": 19 - }, - "identifierName": "y" - }, + "start":951,"end":952,"loc":{"start":{"line":33,"column":18},"end":{"line":33,"column":19},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": false, "value": { "type": "ArrayExpression", - "start": 954, - "end": 962, - "loc": { - "start": { - "line": 33, - "column": 21 - }, - "end": { - "line": 33, - "column": 29 - } - }, + "start":954,"end":962,"loc":{"start":{"line":33,"column":21},"end":{"line":33,"column":29}}, "elements": [ { "type": "NumericLiteral", - "start": 955, - "end": 957, - "loc": { - "start": { - "line": 33, - "column": 22 - }, - "end": { - "line": 33, - "column": 24 - } - }, + "start":955,"end":957,"loc":{"start":{"line":33,"column":22},"end":{"line":33,"column":24}}, "extra": { "rawValue": 20, "raw": "20" @@ -4552,18 +1526,7 @@ }, { "type": "NumericLiteral", - "start": 959, - "end": 961, - "loc": { - "start": { - "line": 33, - "column": 26 - }, - "end": { - "line": 33, - "column": 28 - } - }, + "start":959,"end":961,"loc":{"start":{"line":33,"column":26},"end":{"line":33,"column":28}}, "extra": { "rawValue": 30, "raw": "30" @@ -4575,150 +1538,48 @@ }, { "type": "ObjectProperty", - "start": 964, - "end": 983, - "loc": { - "start": { - "line": 33, - "column": 31 - }, - "end": { - "line": 33, - "column": 50 - } - }, + "start":964,"end":983,"loc":{"start":{"line":33,"column":31},"end":{"line":33,"column":50}}, "method": false, "key": { "type": "Identifier", - "start": 964, - "end": 965, - "loc": { - "start": { - "line": 33, - "column": 31 - }, - "end": { - "line": 33, - "column": 32 - }, - "identifierName": "z" - }, + "start":964,"end":965,"loc":{"start":{"line":33,"column":31},"end":{"line":33,"column":32},"identifierName":"z"}, "name": "z" }, "computed": false, "shorthand": false, "value": { "type": "ObjectExpression", - "start": 967, - "end": 983, - "loc": { - "start": { - "line": 33, - "column": 34 - }, - "end": { - "line": 33, - "column": 50 - } - }, + "start":967,"end":983,"loc":{"start":{"line":33,"column":34},"end":{"line":33,"column":50}}, "properties": [ { "type": "ObjectProperty", - "start": 969, - "end": 981, - "loc": { - "start": { - "line": 33, - "column": 36 - }, - "end": { - "line": 33, - "column": 48 - } - }, + "start":969,"end":981,"loc":{"start":{"line":33,"column":36},"end":{"line":33,"column":48}}, "method": false, "key": { "type": "Identifier", - "start": 969, - "end": 970, - "loc": { - "start": { - "line": 33, - "column": 36 - }, - "end": { - "line": 33, - "column": 37 - }, - "identifierName": "a" - }, + "start":969,"end":970,"loc":{"start":{"line":33,"column":36},"end":{"line":33,"column":37},"identifierName":"a"}, "name": "a" }, "computed": false, "shorthand": false, "value": { "type": "ObjectExpression", - "start": 972, - "end": 981, - "loc": { - "start": { - "line": 33, - "column": 39 - }, - "end": { - "line": 33, - "column": 48 - } - }, + "start":972,"end":981,"loc":{"start":{"line":33,"column":39},"end":{"line":33,"column":48}}, "properties": [ { "type": "ObjectProperty", - "start": 974, - "end": 979, - "loc": { - "start": { - "line": 33, - "column": 41 - }, - "end": { - "line": 33, - "column": 46 - } - }, + "start":974,"end":979,"loc":{"start":{"line":33,"column":41},"end":{"line":33,"column":46}}, "method": false, "key": { "type": "Identifier", - "start": 974, - "end": 975, - "loc": { - "start": { - "line": 33, - "column": 41 - }, - "end": { - "line": 33, - "column": 42 - }, - "identifierName": "b" - }, + "start":974,"end":975,"loc":{"start":{"line":33,"column":41},"end":{"line":33,"column":42},"identifierName":"b"}, "name": "b" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 977, - "end": 979, - "loc": { - "start": { - "line": 33, - "column": 44 - }, - "end": { - "line": 33, - "column": 46 - } - }, + "start":977,"end":979,"loc":{"start":{"line":33,"column":44},"end":{"line":33,"column":46}}, "extra": { "rawValue": 42, "raw": "42" @@ -4736,33 +1597,10 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 989, - "end": 994, - "loc": { - "start": { - "line": 33, - "column": 56 - }, - "end": { - "line": 33, - "column": 61 - } - }, + "start":989,"end":994,"loc":{"start":{"line":33,"column":56},"end":{"line":33,"column":61}}, "typeName": { "type": "Identifier", - "start": 989, - "end": 994, - "loc": { - "start": { - "line": 33, - "column": 56 - }, - "end": { - "line": 33, - "column": 61 - }, - "identifierName": "const" - }, + "start":989,"end":994,"loc":{"start":{"line":33,"column":56},"end":{"line":33,"column":61},"identifierName":"const"}, "name": "const" } } @@ -4773,110 +1611,31 @@ }, { "type": "VariableDeclaration", - "start": 997, - "end": 1017, - "loc": { - "start": { - "line": 35, - "column": 0 - }, - "end": { - "line": 35, - "column": 20 - } - }, + "start":997,"end":1017,"loc":{"start":{"line":35,"column":0},"end":{"line":35,"column":20}}, "declarations": [ { "type": "VariableDeclarator", - "start": 1001, - "end": 1016, - "loc": { - "start": { - "line": 35, - "column": 4 - }, - "end": { - "line": 35, - "column": 19 - } - }, + "start":1001,"end":1016,"loc":{"start":{"line":35,"column":4},"end":{"line":35,"column":19}}, "id": { "type": "Identifier", - "start": 1001, - "end": 1003, - "loc": { - "start": { - "line": 35, - "column": 4 - }, - "end": { - "line": 35, - "column": 6 - }, - "identifierName": "q1" - }, + "start":1001,"end":1003,"loc":{"start":{"line":35,"column":4},"end":{"line":35,"column":6},"identifierName":"q1"}, "name": "q1" }, "init": { "type": "TSTypeAssertion", - "start": 1006, - "end": 1016, - "loc": { - "start": { - "line": 35, - "column": 9 - }, - "end": { - "line": 35, - "column": 19 - } - }, + "start":1006,"end":1016,"loc":{"start":{"line":35,"column":9},"end":{"line":35,"column":19}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 1007, - "end": 1012, - "loc": { - "start": { - "line": 35, - "column": 10 - }, - "end": { - "line": 35, - "column": 15 - } - }, + "start":1007,"end":1012,"loc":{"start":{"line":35,"column":10},"end":{"line":35,"column":15}}, "typeName": { "type": "Identifier", - "start": 1007, - "end": 1012, - "loc": { - "start": { - "line": 35, - "column": 10 - }, - "end": { - "line": 35, - "column": 15 - }, - "identifierName": "const" - }, + "start":1007,"end":1012,"loc":{"start":{"line":35,"column":10},"end":{"line":35,"column":15},"identifierName":"const"}, "name": "const" } }, "expression": { "type": "NumericLiteral", - "start": 1014, - "end": 1016, - "loc": { - "start": { - "line": 35, - "column": 17 - }, - "end": { - "line": 35, - "column": 19 - } - }, + "start":1014,"end":1016,"loc":{"start":{"line":35,"column":17},"end":{"line":35,"column":19}}, "extra": { "rawValue": 10, "raw": "10" @@ -4890,110 +1649,31 @@ }, { "type": "VariableDeclaration", - "start": 1018, - "end": 1041, - "loc": { - "start": { - "line": 36, - "column": 0 - }, - "end": { - "line": 36, - "column": 23 - } - }, + "start":1018,"end":1041,"loc":{"start":{"line":36,"column":0},"end":{"line":36,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 1022, - "end": 1040, - "loc": { - "start": { - "line": 36, - "column": 4 - }, - "end": { - "line": 36, - "column": 22 - } - }, + "start":1022,"end":1040,"loc":{"start":{"line":36,"column":4},"end":{"line":36,"column":22}}, "id": { "type": "Identifier", - "start": 1022, - "end": 1024, - "loc": { - "start": { - "line": 36, - "column": 4 - }, - "end": { - "line": 36, - "column": 6 - }, - "identifierName": "q2" - }, + "start":1022,"end":1024,"loc":{"start":{"line":36,"column":4},"end":{"line":36,"column":6},"identifierName":"q2"}, "name": "q2" }, "init": { "type": "TSTypeAssertion", - "start": 1027, - "end": 1040, - "loc": { - "start": { - "line": 36, - "column": 9 - }, - "end": { - "line": 36, - "column": 22 - } - }, + "start":1027,"end":1040,"loc":{"start":{"line":36,"column":9},"end":{"line":36,"column":22}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 1028, - "end": 1033, - "loc": { - "start": { - "line": 36, - "column": 10 - }, - "end": { - "line": 36, - "column": 15 - } - }, + "start":1028,"end":1033,"loc":{"start":{"line":36,"column":10},"end":{"line":36,"column":15}}, "typeName": { "type": "Identifier", - "start": 1028, - "end": 1033, - "loc": { - "start": { - "line": 36, - "column": 10 - }, - "end": { - "line": 36, - "column": 15 - }, - "identifierName": "const" - }, + "start":1028,"end":1033,"loc":{"start":{"line":36,"column":10},"end":{"line":36,"column":15},"identifierName":"const"}, "name": "const" } }, "expression": { "type": "StringLiteral", - "start": 1035, - "end": 1040, - "loc": { - "start": { - "line": 36, - "column": 17 - }, - "end": { - "line": 36, - "column": 22 - } - }, + "start":1035,"end":1040,"loc":{"start":{"line":36,"column":17},"end":{"line":36,"column":22}}, "extra": { "rawValue": "abc", "raw": "'abc'" @@ -5007,110 +1687,31 @@ }, { "type": "VariableDeclaration", - "start": 1042, - "end": 1064, - "loc": { - "start": { - "line": 37, - "column": 0 - }, - "end": { - "line": 37, - "column": 22 - } - }, + "start":1042,"end":1064,"loc":{"start":{"line":37,"column":0},"end":{"line":37,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 1046, - "end": 1063, - "loc": { - "start": { - "line": 37, - "column": 4 - }, - "end": { - "line": 37, - "column": 21 - } - }, + "start":1046,"end":1063,"loc":{"start":{"line":37,"column":4},"end":{"line":37,"column":21}}, "id": { "type": "Identifier", - "start": 1046, - "end": 1048, - "loc": { - "start": { - "line": 37, - "column": 4 - }, - "end": { - "line": 37, - "column": 6 - }, - "identifierName": "q3" - }, + "start":1046,"end":1048,"loc":{"start":{"line":37,"column":4},"end":{"line":37,"column":6},"identifierName":"q3"}, "name": "q3" }, "init": { "type": "TSTypeAssertion", - "start": 1051, - "end": 1063, - "loc": { - "start": { - "line": 37, - "column": 9 - }, - "end": { - "line": 37, - "column": 21 - } - }, + "start":1051,"end":1063,"loc":{"start":{"line":37,"column":9},"end":{"line":37,"column":21}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 1052, - "end": 1057, - "loc": { - "start": { - "line": 37, - "column": 10 - }, - "end": { - "line": 37, - "column": 15 - } - }, + "start":1052,"end":1057,"loc":{"start":{"line":37,"column":10},"end":{"line":37,"column":15}}, "typeName": { "type": "Identifier", - "start": 1052, - "end": 1057, - "loc": { - "start": { - "line": 37, - "column": 10 - }, - "end": { - "line": 37, - "column": 15 - }, - "identifierName": "const" - }, + "start":1052,"end":1057,"loc":{"start":{"line":37,"column":10},"end":{"line":37,"column":15},"identifierName":"const"}, "name": "const" } }, "expression": { "type": "BooleanLiteral", - "start": 1059, - "end": 1063, - "loc": { - "start": { - "line": 37, - "column": 17 - }, - "end": { - "line": 37, - "column": 21 - } - }, + "start":1059,"end":1063,"loc":{"start":{"line":37,"column":17},"end":{"line":37,"column":21}}, "value": true } } @@ -5120,125 +1721,35 @@ }, { "type": "VariableDeclaration", - "start": 1065, - "end": 1092, - "loc": { - "start": { - "line": 38, - "column": 0 - }, - "end": { - "line": 38, - "column": 27 - } - }, + "start":1065,"end":1092,"loc":{"start":{"line":38,"column":0},"end":{"line":38,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 1069, - "end": 1091, - "loc": { - "start": { - "line": 38, - "column": 4 - }, - "end": { - "line": 38, - "column": 26 - } - }, + "start":1069,"end":1091,"loc":{"start":{"line":38,"column":4},"end":{"line":38,"column":26}}, "id": { "type": "Identifier", - "start": 1069, - "end": 1071, - "loc": { - "start": { - "line": 38, - "column": 4 - }, - "end": { - "line": 38, - "column": 6 - }, - "identifierName": "q4" - }, + "start":1069,"end":1071,"loc":{"start":{"line":38,"column":4},"end":{"line":38,"column":6},"identifierName":"q4"}, "name": "q4" }, "init": { "type": "TSTypeAssertion", - "start": 1074, - "end": 1091, - "loc": { - "start": { - "line": 38, - "column": 9 - }, - "end": { - "line": 38, - "column": 26 - } - }, + "start":1074,"end":1091,"loc":{"start":{"line":38,"column":9},"end":{"line":38,"column":26}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 1075, - "end": 1080, - "loc": { - "start": { - "line": 38, - "column": 10 - }, - "end": { - "line": 38, - "column": 15 - } - }, + "start":1075,"end":1080,"loc":{"start":{"line":38,"column":10},"end":{"line":38,"column":15}}, "typeName": { "type": "Identifier", - "start": 1075, - "end": 1080, - "loc": { - "start": { - "line": 38, - "column": 10 - }, - "end": { - "line": 38, - "column": 15 - }, - "identifierName": "const" - }, + "start":1075,"end":1080,"loc":{"start":{"line":38,"column":10},"end":{"line":38,"column":15},"identifierName":"const"}, "name": "const" } }, "expression": { "type": "ArrayExpression", - "start": 1082, - "end": 1091, - "loc": { - "start": { - "line": 38, - "column": 17 - }, - "end": { - "line": 38, - "column": 26 - } - }, + "start":1082,"end":1091,"loc":{"start":{"line":38,"column":17},"end":{"line":38,"column":26}}, "elements": [ { "type": "NumericLiteral", - "start": 1083, - "end": 1084, - "loc": { - "start": { - "line": 38, - "column": 18 - }, - "end": { - "line": 38, - "column": 19 - } - }, + "start":1083,"end":1084,"loc":{"start":{"line":38,"column":18},"end":{"line":38,"column":19}}, "extra": { "rawValue": 1, "raw": "1" @@ -5247,18 +1758,7 @@ }, { "type": "NumericLiteral", - "start": 1086, - "end": 1087, - "loc": { - "start": { - "line": 38, - "column": 21 - }, - "end": { - "line": 38, - "column": 22 - } - }, + "start":1086,"end":1087,"loc":{"start":{"line":38,"column":21},"end":{"line":38,"column":22}}, "extra": { "rawValue": 2, "raw": "2" @@ -5267,18 +1767,7 @@ }, { "type": "NumericLiteral", - "start": 1089, - "end": 1090, - "loc": { - "start": { - "line": 38, - "column": 24 - }, - "end": { - "line": 38, - "column": 25 - } - }, + "start":1089,"end":1090,"loc":{"start":{"line":38,"column":24},"end":{"line":38,"column":25}}, "extra": { "rawValue": 3, "raw": "3" @@ -5294,159 +1783,46 @@ }, { "type": "VariableDeclaration", - "start": 1093, - "end": 1127, - "loc": { - "start": { - "line": 39, - "column": 0 - }, - "end": { - "line": 39, - "column": 34 - } - }, + "start":1093,"end":1127,"loc":{"start":{"line":39,"column":0},"end":{"line":39,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 1097, - "end": 1126, - "loc": { - "start": { - "line": 39, - "column": 4 - }, - "end": { - "line": 39, - "column": 33 - } - }, + "start":1097,"end":1126,"loc":{"start":{"line":39,"column":4},"end":{"line":39,"column":33}}, "id": { "type": "Identifier", - "start": 1097, - "end": 1099, - "loc": { - "start": { - "line": 39, - "column": 4 - }, - "end": { - "line": 39, - "column": 6 - }, - "identifierName": "q5" - }, + "start":1097,"end":1099,"loc":{"start":{"line":39,"column":4},"end":{"line":39,"column":6},"identifierName":"q5"}, "name": "q5" }, "init": { "type": "TSTypeAssertion", - "start": 1102, - "end": 1126, - "loc": { - "start": { - "line": 39, - "column": 9 - }, - "end": { - "line": 39, - "column": 33 - } - }, + "start":1102,"end":1126,"loc":{"start":{"line":39,"column":9},"end":{"line":39,"column":33}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 1103, - "end": 1108, - "loc": { - "start": { - "line": 39, - "column": 10 - }, - "end": { - "line": 39, - "column": 15 - } - }, + "start":1103,"end":1108,"loc":{"start":{"line":39,"column":10},"end":{"line":39,"column":15}}, "typeName": { "type": "Identifier", - "start": 1103, - "end": 1108, - "loc": { - "start": { - "line": 39, - "column": 10 - }, - "end": { - "line": 39, - "column": 15 - }, - "identifierName": "const" - }, + "start":1103,"end":1108,"loc":{"start":{"line":39,"column":10},"end":{"line":39,"column":15},"identifierName":"const"}, "name": "const" } }, "expression": { "type": "ObjectExpression", - "start": 1110, - "end": 1126, - "loc": { - "start": { - "line": 39, - "column": 17 - }, - "end": { - "line": 39, - "column": 33 - } - }, + "start":1110,"end":1126,"loc":{"start":{"line":39,"column":17},"end":{"line":39,"column":33}}, "properties": [ { "type": "ObjectProperty", - "start": 1112, - "end": 1117, - "loc": { - "start": { - "line": 39, - "column": 19 - }, - "end": { - "line": 39, - "column": 24 - } - }, + "start":1112,"end":1117,"loc":{"start":{"line":39,"column":19},"end":{"line":39,"column":24}}, "method": false, "key": { "type": "Identifier", - "start": 1112, - "end": 1113, - "loc": { - "start": { - "line": 39, - "column": 19 - }, - "end": { - "line": 39, - "column": 20 - }, - "identifierName": "x" - }, + "start":1112,"end":1113,"loc":{"start":{"line":39,"column":19},"end":{"line":39,"column":20},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 1115, - "end": 1117, - "loc": { - "start": { - "line": 39, - "column": 22 - }, - "end": { - "line": 39, - "column": 24 - } - }, + "start":1115,"end":1117,"loc":{"start":{"line":39,"column":22},"end":{"line":39,"column":24}}, "extra": { "rawValue": 10, "raw": "10" @@ -5456,52 +1832,18 @@ }, { "type": "ObjectProperty", - "start": 1119, - "end": 1124, - "loc": { - "start": { - "line": 39, - "column": 26 - }, - "end": { - "line": 39, - "column": 31 - } - }, + "start":1119,"end":1124,"loc":{"start":{"line":39,"column":26},"end":{"line":39,"column":31}}, "method": false, "key": { "type": "Identifier", - "start": 1119, - "end": 1120, - "loc": { - "start": { - "line": 39, - "column": 26 - }, - "end": { - "line": 39, - "column": 27 - }, - "identifierName": "y" - }, + "start":1119,"end":1120,"loc":{"start":{"line":39,"column":26},"end":{"line":39,"column":27},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": false, "value": { "type": "NumericLiteral", - "start": 1122, - "end": 1124, - "loc": { - "start": { - "line": 39, - "column": 29 - }, - "end": { - "line": 39, - "column": 31 - } - }, + "start":1122,"end":1124,"loc":{"start":{"line":39,"column":29},"end":{"line":39,"column":31}}, "extra": { "rawValue": 20, "raw": "20" @@ -5523,50 +1865,17 @@ { "type": "CommentLine", "value": " Copied over from TypeScript's test case", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - } + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}} }, { "type": "CommentLine", "value": " https://github.com/Microsoft/TypeScript/blob/master/tests/baselines/reference/constAssertions.js", - "start": 43, - "end": 142, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 99 - } - } + "start":43,"end":142,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":99}} }, { "type": "CommentLine", "value": " Error", - "start": 813, - "end": 821, - "loc": { - "start": { - "line": 26, - "column": 53 - }, - "end": { - "line": 26, - "column": 61 - } - } + "start":813,"end":821,"loc":{"start":{"line":26,"column":53},"end":{"line":26,"column":61}} } ] } \ No newline at end of file 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 a83b677640..3cba96e651 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/as/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/as/output.json @@ -1,108 +1,29 @@ { "type": "File", - "start": 0, - "end": 106, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":0,"end":106,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 106, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":0,"end":106,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TSAsExpression", - "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}}, "expression": { "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" }, "typeAnnotation": { "type": "TSTypeReference", - "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}}, "typeName": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "T" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"T"}, "name": "T" } } @@ -110,191 +31,56 @@ }, { "type": "ExpressionStatement", - "start": 8, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":8,"end":25,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "expression": { "type": "TSAsExpression", - "start": 8, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":8,"end":24,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "expression": { "type": "BinaryExpression", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":8,"end":13,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":5}}, "left": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "x" - }, + "start":8,"end":9,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "<", "right": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "y" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"y"}, "name": "y" } }, "typeAnnotation": { "type": "TSBooleanKeyword", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 16 - } - } + "start":17,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":16}} } }, "trailingComments": [ { "type": "CommentLine", "value": " (x < y) as boolean;", - "start": 26, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 40 - } - } + "start":26,"end":48,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":40}} } ] }, { "type": "ExpressionStatement", - "start": 49, - "end": 67, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":49,"end":67,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":18}}, "expression": { "type": "BinaryExpression", - "start": 49, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":49,"end":66,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":17}}, "left": { "type": "Identifier", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - }, - "identifierName": "x" - }, + "start":49,"end":50,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":1},"identifierName":"x"}, "name": "x" }, "operator": "===", "right": { "type": "TSAsExpression", - "start": 55, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":55,"end":66,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":17}}, "expression": { "type": "NumericLiteral", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":55,"end":56,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":7}}, "extra": { "rawValue": 1, "raw": "1" @@ -303,18 +89,7 @@ }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 60, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 17 - } - } + "start":60,"end":66,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":17}} } } }, @@ -322,143 +97,42 @@ { "type": "CommentLine", "value": " (x < y) as boolean;", - "start": 26, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 40 - } - } + "start":26,"end":48,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":40}} } ], "trailingComments": [ { "type": "CommentLine", "value": " x === (1 as number);", - "start": 68, - "end": 91, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 42 - } - } + "start":68,"end":91,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":42}} } ] }, { "type": "ExpressionStatement", - "start": 92, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":92,"end":106,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":14}}, "expression": { "type": "TSAsExpression", - "start": 92, - "end": 105, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":92,"end":105,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":13}}, "expression": { "type": "TSAsExpression", - "start": 92, - "end": 100, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 8 - } - }, + "start":92,"end":100,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":8}}, "expression": { "type": "Identifier", - "start": 92, - "end": 93, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - }, - "identifierName": "x" - }, + "start":92,"end":93,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":1},"identifierName":"x"}, "name": "x" }, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 97, - "end": 100, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 8 - } - } + "start":97,"end":100,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":8}} } }, "typeAnnotation": { "type": "TSTypeReference", - "start": 104, - "end": 105, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":104,"end":105,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":13}}, "typeName": { "type": "Identifier", - "start": 104, - "end": 105, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 13 - }, - "identifierName": "T" - }, + "start":104,"end":105,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":13},"identifierName":"T"}, "name": "T" } } @@ -467,18 +141,7 @@ { "type": "CommentLine", "value": " x === (1 as number);", - "start": 68, - "end": 91, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 42 - } - } + "start":68,"end":91,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":42}} } ] } @@ -489,34 +152,12 @@ { "type": "CommentLine", "value": " (x < y) as boolean;", - "start": 26, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 40 - } - } + "start":26,"end":48,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":40}} }, { "type": "CommentLine", "value": " x === (1 as number);", - "start": 68, - "end": 91, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 42 - } - } + "start":68,"end":91,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":42}} } ] } \ No newline at end of file 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 f07df1678f..bc0f97cffd 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 @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "operator": "=", "left": { "type": "TSAsExpression", - "start": 1, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, "expression": { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - } + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}} }, "extra": { "parenthesized": true, @@ -111,18 +33,7 @@ }, "right": { "type": "NumericLiteral", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/typescript/cast/destructure-and-assign/output.json b/packages/babel-parser/test/fixtures/typescript/cast/destructure-and-assign/output.json index d621a6cb84..de6f9dbe89 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/destructure-and-assign/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/destructure-and-assign/output.json @@ -1,141 +1,41 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "=", "left": { "type": "ArrayPattern", - "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}}, "elements": [ { "type": "Identifier", - "start": 1, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TSNumberKeyword", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - } + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}} } } ] }, "right": { "type": "ArrayExpression", - "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}}, "elements": [ { "type": "NumericLiteral", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":17,"end":19,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":19}}, "extra": { "rawValue": 42, "raw": "42" @@ -148,111 +48,33 @@ }, { "type": "ExpressionStatement", - "start": 22, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":22,"end":41,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "expression": { "type": "AssignmentExpression", - "start": 22, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":22,"end":40,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "operator": "=", "left": { "type": "ArrayPattern", - "start": 22, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":22,"end":33,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "elements": [ { "type": "Identifier", - "start": 31, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "a" - }, + "start":31,"end":30,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":8},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TSNumberKeyword", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 8 - } - } + "start":24,"end":30,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":8}} } } ] }, "right": { "type": "ArrayExpression", - "start": 36, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":36,"end":40,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":18}}, "elements": [ { "type": "NumericLiteral", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":37,"end":39,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":17}}, "extra": { "rawValue": 42, "raw": "42" diff --git a/packages/babel-parser/test/fixtures/typescript/cast/false-positive/output.json b/packages/babel-parser/test/fixtures/typescript/cast/false-positive/output.json index c7b5f885f2..5a327e4f42 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/false-positive/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/false-positive/output.json @@ -1,126 +1,36 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "arguments": [ { "type": "BinaryExpression", - "start": 2, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":2,"end":7,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":7}}, "left": { "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" }, "operator": "<", "right": { "type": "NumericLiteral", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 0, "raw": "0" @@ -130,18 +40,7 @@ }, { "type": "RegExpLiteral", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "extra": { "raw": "/a/" }, 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 5c3f1fe6b4..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 @@ -1,138 +1,38 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expression": { "type": "AssignmentExpression", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "operator": "=", "left": { "type": "TSAsExpression", - "start": 1, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":1,"end":19,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":19}}, "expression": { "type": "TSAsExpression", - "start": 1, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, "expression": { "type": "Identifier", - "start": 1, - "end": 2, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 2 - }, - "identifierName": "a" - }, + "start":1,"end":2,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":2},"identifierName":"a"}, "name": "a" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - } + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}} } }, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}} }, "extra": { "parenthesized": true, @@ -141,18 +41,7 @@ }, "right": { "type": "NumericLiteral", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "extra": { "rawValue": 42, "raw": "42" 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 bb02e0d695..06c4c0109b 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 @@ -1,123 +1,33 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":5}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "MemberExpression", - "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}}, "object": { "type": "TSTypeAssertion", - "start": 1, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 6 - } - }, + "start":1,"end":6,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":6}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "typeName": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "T" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"T"}, "name": "T" } }, "expression": { "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" }, "extra": { @@ -127,19 +37,7 @@ }, "property": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "y" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"y"}, "name": "y" }, "computed": false @@ -147,92 +45,24 @@ }, { "type": "ExpressionStatement", - "start": 11, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":11,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "expression": { "type": "MemberExpression", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":11,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "object": { "type": "TSAsExpression", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":12,"end":18,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":7}}, "expression": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 2 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":2},"identifierName":"x"}, "name": "x" }, "typeAnnotation": { "type": "TSTypeReference", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "typeName": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "T" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"T"}, "name": "T" } }, @@ -243,19 +73,7 @@ }, "property": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "y" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"y"}, "name": "y" }, "computed": false @@ -263,79 +81,22 @@ }, { "type": "ExpressionStatement", - "start": 23, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":23,"end":28,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":5}}, "expression": { "type": "MemberExpression", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":23,"end":27,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":4}}, "object": { "type": "TSNonNullExpression", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":23,"end":25,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":2}}, "expression": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - }, - "identifierName": "x" - }, + "start":23,"end":24,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":1},"identifierName":"x"}, "name": "x" } }, "property": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "y" - }, + "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-2/output.json b/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-2/output.json index 66c8f18d05..564c221f8e 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-2/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-2/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "TSNonNullExpression", - "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}}, "expression": { "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": "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": 2, "raw": "2" diff --git a/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-3/output.json b/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-3/output.json index 1cbff79549..d8c1cd3047 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-3/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-3/output.json @@ -1,123 +1,33 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":6,"end":16,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "x" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"x"}, "name": "x" }, "init": { "type": "TSNonNullExpression", - "start": 10, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":10,"end":16,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":16}}, "expression": { "type": "CallExpression", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15}}, "callee": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "arguments": [] diff --git a/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-and-assign-2/output.json b/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-and-assign-2/output.json index c783913599..9e5a3057ec 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-and-assign-2/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-and-assign-2/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "TSNonNullExpression", - "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}}, "expression": { "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": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-and-assign/output.json b/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-and-assign/output.json index 4f8a2a548b..820cc00e77 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-and-assign/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-and-assign/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "TSNonNullExpression", - "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}}, "expression": { "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": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-false-positive/output.json b/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-false-positive/output.json index 9e08ab2e65..69f2748151 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-false-positive/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/null-assertion-false-positive/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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" } }, { "type": "ExpressionStatement", - "start": 2, - "end": 4, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":2,"end":4,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "expression": { "type": "UnaryExpression", - "start": 2, - "end": 4, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":2,"end":4,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "operator": "!", "prefix": true, "argument": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 2 - }, - "identifierName": "b" - }, + "start":3,"end":4,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":2},"identifierName":"b"}, "name": "b" } } 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 19ec66b99e..4f00ec5ea1 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 @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "MemberExpression", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "object": { "type": "TSNonNullExpression", - "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}}, "expression": { "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" } }, "property": { "type": "Identifier", - "start": 3, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "y" - }, + "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/null-assertion/output.json b/packages/babel-parser/test/fixtures/typescript/cast/null-assertion/output.json index 093a065ec0..893ffd407f 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/null-assertion/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/null-assertion/output.json @@ -1,77 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TSNonNullExpression", - "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}}, "expression": { "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" } } diff --git a/packages/babel-parser/test/fixtures/typescript/cast/parameter-typecast/output.json b/packages/babel-parser/test/fixtures/typescript/cast/parameter-typecast/output.json index d815e81603..1ed5715510 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/parameter-typecast/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/parameter-typecast/output.json @@ -1,157 +1,44 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Did not expect a type annotation here. (1:5)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "func" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"func"}, "name": "func" }, "arguments": [ { "type": "TSTypeCastExpression", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "expression": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "a" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"a"}, "name": "a" }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9}}, "typeAnnotation": { "type": "TSTypeReference", - "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}}, "typeName": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "T" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/typescript/cast/type-assertion-after-operator/output.json b/packages/babel-parser/test/fixtures/typescript/cast/type-assertion-after-operator/output.json index f8020782bc..027243b756 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/type-assertion-after-operator/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/type-assertion-after-operator/output.json @@ -1,76 +1,21 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "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": 1, "raw": "1" @@ -80,47 +25,14 @@ "operator": "+", "right": { "type": "TSTypeAssertion", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "typeAnnotation": { "type": "TSNumberKeyword", - "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}} }, "expression": { "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": 1, "raw": "1" 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 964e552cfc..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 @@ -1,107 +1,29 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "expression": { "type": "AssignmentExpression", - "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}}, "operator": "+=", "left": { "type": "TSTypeAssertion", - "start": 1, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 2, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 8 - } - } + "start":2,"end":8,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":8}} }, "expression": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x" }, "extra": { @@ -111,18 +33,7 @@ }, "right": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/typescript/cast/type-assertion-before-operator/output.json b/packages/babel-parser/test/fixtures/typescript/cast/type-assertion-before-operator/output.json index 34f750336a..d0f0c3a11d 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/type-assertion-before-operator/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/type-assertion-before-operator/output.json @@ -1,105 +1,28 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "TSTypeAssertion", - "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}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - } + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}} }, "expression": { "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" @@ -110,18 +33,7 @@ "operator": "+", "right": { "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": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/typescript/cast/type-assertion/output.json b/packages/babel-parser/test/fixtures/typescript/cast/type-assertion/output.json index 0da048e7ef..79fb8312c7 100644 --- a/packages/babel-parser/test/fixtures/typescript/cast/type-assertion/output.json +++ b/packages/babel-parser/test/fixtures/typescript/cast/type-assertion/output.json @@ -1,91 +1,25 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TSTypeAssertion", - "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}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 1, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 7 - } - } + "start":1,"end":7,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":7}} }, "expression": { "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" diff --git a/packages/babel-parser/test/fixtures/typescript/class/abstract-false-positive/output.json b/packages/babel-parser/test/fixtures/typescript/class/abstract-false-positive/output.json index f7f4be7166..31af6553e5 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/abstract-false-positive/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/abstract-false-positive/output.json @@ -1,82 +1,26 @@ { "type": "File", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 63, - "end": 87, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":63,"end":87,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":24}}, "exportKind": "value", "declaration": { "type": "Identifier", - "start": 78, - "end": 86, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "abstract" - }, + "start":78,"end":86,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":23},"identifierName":"abstract"}, "name": "abstract" }, "leadingComments": [ { "type": "CommentLine", "value": " Exports an identifier, doesn't try parsing `abstract class`", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 62 - } - } + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}} } ] } @@ -87,18 +31,7 @@ { "type": "CommentLine", "value": " Exports an identifier, doesn't try parsing `abstract class`", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 62 - } - } + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":62}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/abstract-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/class/abstract-new-line/output.json index 08760bb11d..80d77b30c6 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/abstract-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/abstract-new-line/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "abstract" - }, + "start":0,"end":8,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":8},"identifierName":"abstract"}, "name": "abstract" } }, { "type": "ClassDeclaration", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":9,"end":19,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "B" - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"B"}, "name": "B" }, "superClass": null, "body": { "type": "ClassBody", - "start": 17, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":17,"end":19,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":10}}, "body": [] } } 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 50d59f6e63..a4dd472198 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/abstract/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/abstract/output.json @@ -1,199 +1,64 @@ { "type": "File", - "start": 0, - "end": 254, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 50 - } - }, + "start":0,"end":254,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":50}}, "program": { "type": "Program", - "start": 0, - "end": 254, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 50 - } - }, + "start":0,"end":254,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":50}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "abstract": true, "id": { "type": "Identifier", - "start": 15, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "C1" - }, + "start":15,"end":17,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":17},"identifierName":"C1"}, "name": "C1" }, "superClass": null, "body": { "type": "ClassBody", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":18,"end":20,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":20}}, "body": [] } }, { "type": "ClassDeclaration", - "start": 21, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":21,"end":49,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, "abstract": true, "id": { "type": "Identifier", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "C2" - }, + "start":44,"end":46,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":25},"identifierName":"C2"}, "name": "C2" }, "superClass": null, "body": { "type": "ClassBody", - "start": 47, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":47,"end":49,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":28}}, "body": [] }, "declare": true }, { "type": "ExportNamedDeclaration", - "start": 50, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":50,"end":77,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":27}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "ClassDeclaration", - "start": 57, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":57,"end":77,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":27}}, "abstract": true, "id": { "type": "Identifier", - "start": 72, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 24 - }, - "identifierName": "C3" - }, + "start":72,"end":74,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":24},"identifierName":"C3"}, "name": "C3" }, "superClass": null, "body": { "type": "ClassBody", - "start": 75, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 25 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":75,"end":77,"loc":{"start":{"line":3,"column":25},"end":{"line":3,"column":27}}, "body": [] } }, @@ -201,66 +66,22 @@ { "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 - } - } + "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 - } - }, + "start":133,"end":166,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":33}}, "exportKind": "value", "declaration": { "type": "ClassDeclaration", - "start": 148, - "end": 166, - "loc": { - "start": { - "line": 5, - "column": 15 - }, - "end": { - "line": 5, - "column": 33 - } - }, + "start":148,"end":166,"loc":{"start":{"line":5,"column":15},"end":{"line":5,"column":33}}, "id": null, "superClass": null, "body": { "type": "ClassBody", - "start": 163, - "end": 166, - "loc": { - "start": { - "line": 5, - "column": 30 - }, - "end": { - "line": 5, - "column": 33 - } - }, + "start":163,"end":166,"loc":{"start":{"line":5,"column":30},"end":{"line":5,"column":33}}, "body": [] }, "abstract": true @@ -269,82 +90,26 @@ { "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 - } - } + "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 - } - }, + "start":167,"end":203,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":36}}, "exportKind": "value", "declaration": { "type": "ClassDeclaration", - "start": 182, - "end": 203, - "loc": { - "start": { - "line": 6, - "column": 15 - }, - "end": { - "line": 6, - "column": 36 - } - }, + "start":182,"end":203,"loc":{"start":{"line":6,"column":15},"end":{"line":6,"column":36}}, "id": { "type": "Identifier", - "start": 197, - "end": 199, - "loc": { - "start": { - "line": 6, - "column": 30 - }, - "end": { - "line": 6, - "column": 32 - }, - "identifierName": "C4" - }, + "start":197,"end":199,"loc":{"start":{"line":6,"column":30},"end":{"line":6,"column":32},"identifierName":"C4"}, "name": "C4" }, "superClass": null, "body": { "type": "ClassBody", - "start": 200, - "end": 203, - "loc": { - "start": { - "line": 6, - "column": 33 - }, - "end": { - "line": 6, - "column": 36 - } - }, + "start":200,"end":203,"loc":{"start":{"line":6,"column":33},"end":{"line":6,"column":36}}, "body": [] }, "abstract": true @@ -353,18 +118,7 @@ { "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 - } - } + "start":204,"end":254,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":50}} } ] } @@ -375,34 +129,12 @@ { "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 - } - } + "start":78,"end":132,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":54}} }, { "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 - } - } + "start":204,"end":254,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":50}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/async-named-properties/output.json b/packages/babel-parser/test/fixtures/typescript/class/async-named-properties/output.json index e0ac8a5907..2eb4a2e891 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/async-named-properties/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/async-named-properties/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":46,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "TSDeclareMethod", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":16}}, "static": false, "key": { "type": "Identifier", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "async" - }, + "start":12,"end":17,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7},"identifierName":"async"}, "name": "async" }, "computed": false, @@ -117,97 +38,30 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":20,"end":26,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 16 - } - } + "start":22,"end":26,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":16}} } } }, { "type": "ClassProperty", - "start": 29, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":29,"end":44,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":17}}, "static": false, "key": { "type": "Identifier", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 7 - }, - "identifierName": "async" - }, + "start":29,"end":34,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":7},"identifierName":"async"}, "name": "async" }, "computed": false, "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 35, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":35,"end":44,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":17}}, "typeAnnotation": { "type": "TSBooleanKeyword", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 17 - } - } + "start":37,"end":44,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":17}} } }, "value": null diff --git a/packages/babel-parser/test/fixtures/typescript/class/async-optional-method/output.json b/packages/babel-parser/test/fixtures/typescript/class/async-optional-method/output.json index b2a7262f03..1413361044 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/async-optional-method/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/async-optional-method/output.json @@ -1,127 +1,36 @@ { "type": "File", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "B" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"B"}, "name": "B" }, "body": { "type": "ClassBody", - "start": 18, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":18,"end":66,"loc":{"start":{"line":1,"column":18},"end":{"line":3,"column":1}}, "body": [ { "type": "TSDeclareMethod", - "start": 22, - "end": 64, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 44 - } - }, + "start":22,"end":64,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":44}}, "static": false, "key": { "type": "Identifier", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "method" - }, + "start":28,"end":34,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14},"identifierName":"method"}, "name": "method" }, "computed": false, @@ -133,126 +42,36 @@ "params": [ { "type": "Identifier", - "start": 36, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "val" - }, + "start":36,"end":47,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":27},"identifierName":"val"}, "name": "val", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 39, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":39,"end":47,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":27}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 41, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 27 - } - } + "start":41,"end":47,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":27}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 48, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 43 - } - }, + "start":48,"end":63,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":43}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 50, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 43 - } - }, + "start":50,"end":63,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":43}}, "typeName": { "type": "Identifier", - "start": 50, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 37 - }, - "identifierName": "Promise" - }, + "start":50,"end":57,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":37},"identifierName":"Promise"}, "name": "Promise" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 57, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 37 - }, - "end": { - "line": 2, - "column": 43 - } - }, + "start":57,"end":63,"loc":{"start":{"line":2,"column":37},"end":{"line":2,"column":43}}, "params": [ { "type": "TSVoidKeyword", - "start": 58, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 2, - "column": 42 - } - } + "start":58,"end":62,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":42}} } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/class/constructor-with-modifier-names/output.json b/packages/babel-parser/test/fixtures/typescript/class/constructor-with-modifier-names/output.json index 24aeccd1b0..92b431cd08 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/constructor-with-modifier-names/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/constructor-with-modifier-names/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":91,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":91,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":91,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":10,"end":91,"loc":{"start":{"line":1,"column":10},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":14,"end":43,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":31}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -116,87 +37,29 @@ "params": [ { "type": "Identifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "set" - }, + "start":26,"end":29,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":17},"identifierName":"set"}, "name": "set" }, { "type": "Identifier", - "start": 31, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "readonly" - }, + "start":31,"end":39,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":27},"identifierName":"readonly"}, "name": "readonly" } ], "body": { "type": "BlockStatement", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":41,"end":43,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":31}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 46, - "end": 89, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 45 - } - }, + "start":46,"end":89,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":45}}, "static": false, "key": { "type": "Identifier", - "start": 46, - "end": 57, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":46,"end":57,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -207,113 +70,34 @@ "params": [ { "type": "Identifier", - "start": 58, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 22 - }, - "identifierName": "set" - }, + "start":58,"end":66,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":22},"identifierName":"set"}, "name": "set", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 61, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":61,"end":66,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":22}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 63, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 22 - } - } + "start":63,"end":66,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":22}} } } }, { "type": "Identifier", - "start": 68, - "end": 85, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 41 - }, - "identifierName": "readonly" - }, + "start":68,"end":85,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":41},"identifierName":"readonly"}, "name": "readonly", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 76, - "end": 85, - "loc": { - "start": { - "line": 3, - "column": 32 - }, - "end": { - "line": 3, - "column": 41 - } - }, + "start":76,"end":85,"loc":{"start":{"line":3,"column":32},"end":{"line":3,"column":41}}, "typeAnnotation": { "type": "TSBooleanKeyword", - "start": 78, - "end": 85, - "loc": { - "start": { - "line": 3, - "column": 34 - }, - "end": { - "line": 3, - "column": 41 - } - } + "start":78,"end":85,"loc":{"start":{"line":3,"column":34},"end":{"line":3,"column":41}} } } } ], "body": { "type": "BlockStatement", - "start": 87, - "end": 89, - "loc": { - "start": { - "line": 3, - "column": 43 - }, - "end": { - "line": 3, - "column": 45 - } - }, + "start":87,"end":89,"loc":{"start":{"line":3,"column":43},"end":{"line":3,"column":45}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/class/constructor/output.json b/packages/babel-parser/test/fixtures/typescript/class/constructor/output.json index 55d2eac06c..4f03b0ae91 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/constructor/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/constructor/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 124, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":124,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 124, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":124,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 124, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":124,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 124, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":8,"end":124,"loc":{"start":{"line":1,"column":8},"end":{"line":5,"column":1}}, "body": [ { "type": "TSDeclareMethod", - "start": 14, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":14,"end":48,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":38}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "constructor" - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":15},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -116,95 +37,27 @@ "params": [ { "type": "Identifier", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "x" - }, + "start":26,"end":35,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":25},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 27, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":27,"end":35,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":25}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 25 - } - } + "start":29,"end":35,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":25}} } } }, { "type": "Identifier", - "start": 37, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 36 - }, - "identifierName": "y" - }, + "start":37,"end":46,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":36},"identifierName":"y"}, "name": "y", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 38, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":38,"end":46,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":36}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 40, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 36 - } - } + "start":40,"end":46,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":36}} } } } @@ -212,34 +65,11 @@ }, { "type": "TSDeclareMethod", - "start": 53, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 38 - } - }, + "start":53,"end":87,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":38}}, "static": false, "key": { "type": "Identifier", - "start": 53, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "constructor" - }, + "start":53,"end":64,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":15},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -250,95 +80,27 @@ "params": [ { "type": "Identifier", - "start": 65, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 25 - }, - "identifierName": "x" - }, + "start":65,"end":74,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":25},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 66, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":66,"end":74,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":25}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 68, - "end": 74, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 25 - } - } + "start":68,"end":74,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":25}} } } }, { "type": "Identifier", - "start": 76, - "end": 85, - "loc": { - "start": { - "line": 3, - "column": 27 - }, - "end": { - "line": 3, - "column": 36 - }, - "identifierName": "y" - }, + "start":76,"end":85,"loc":{"start":{"line":3,"column":27},"end":{"line":3,"column":36},"identifierName":"y"}, "name": "y", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 77, - "end": 85, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":77,"end":85,"loc":{"start":{"line":3,"column":28},"end":{"line":3,"column":36}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 79, - "end": 85, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 36 - } - } + "start":79,"end":85,"loc":{"start":{"line":3,"column":30},"end":{"line":3,"column":36}} } } } @@ -346,34 +108,11 @@ }, { "type": "ClassMethod", - "start": 92, - "end": 122, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 34 - } - }, + "start":92,"end":122,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":34}}, "static": false, "key": { "type": "Identifier", - "start": 92, - "end": 103, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 15 - }, - "identifierName": "constructor" - }, + "start":92,"end":103,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -384,113 +123,34 @@ "params": [ { "type": "Identifier", - "start": 104, - "end": 110, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 22 - }, - "identifierName": "x" - }, + "start":104,"end":110,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":22},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 105, - "end": 110, - "loc": { - "start": { - "line": 4, - "column": 17 - }, - "end": { - "line": 4, - "column": 22 - } - }, + "start":105,"end":110,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":22}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 107, - "end": 110, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 22 - } - } + "start":107,"end":110,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":22}} } } }, { "type": "Identifier", - "start": 112, - "end": 118, - "loc": { - "start": { - "line": 4, - "column": 24 - }, - "end": { - "line": 4, - "column": 30 - }, - "identifierName": "y" - }, + "start":112,"end":118,"loc":{"start":{"line":4,"column":24},"end":{"line":4,"column":30},"identifierName":"y"}, "name": "y", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 113, - "end": 118, - "loc": { - "start": { - "line": 4, - "column": 25 - }, - "end": { - "line": 4, - "column": 30 - } - }, + "start":113,"end":118,"loc":{"start":{"line":4,"column":25},"end":{"line":4,"column":30}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 115, - "end": 118, - "loc": { - "start": { - "line": 4, - "column": 27 - }, - "end": { - "line": 4, - "column": 30 - } - } + "start":115,"end":118,"loc":{"start":{"line":4,"column":27},"end":{"line":4,"column":30}} } } } ], "body": { "type": "BlockStatement", - "start": 120, - "end": 122, - "loc": { - "start": { - "line": 4, - "column": 32 - }, - "end": { - "line": 4, - "column": 34 - } - }, + "start":120,"end":122,"loc":{"start":{"line":4,"column":32},"end":{"line":4,"column":34}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/output.json index fb27f30550..8876797835 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare-field-initializer/output.json @@ -1,159 +1,47 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":43,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":12,"end":41,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":31}}, "declare": true, "static": false, "key": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "bar" - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13},"identifierName":"bar"}, "name": "bar" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 23, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":23,"end":31,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":21}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 21 - } - } + "start":25,"end":31,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":21}} } }, "value": { "type": "StringLiteral", - "start": 34, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":34,"end":40,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":30}}, "extra": { "rawValue": "test", "raw": "\"test\"" 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 a2a697b6ec..f5caff15c0 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 @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 202, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":0,"end":202,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 202, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":0,"end":202,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 202, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":0,"end":202,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 202, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":8,"end":202,"loc":{"start":{"line":1,"column":8},"end":{"line":11,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":12,"end":31,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":21}}, "declare": true, "static": true, "key": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "foo" - }, + "start":27,"end":30,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":20},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -114,102 +35,34 @@ }, { "type": "ClassProperty", - "start": 34, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 30 - } - }, + "start":34,"end":62,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":30}}, "declare": true, "static": true, "key": { "type": "Identifier", - "start": 49, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 21 - }, - "identifierName": "foo0" - }, + "start":49,"end":53,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":21},"identifierName":"foo0"}, "name": "foo0" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 53, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":53,"end":61,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":29}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 55, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 23 - }, - "end": { - "line": 3, - "column": 29 - } - } + "start":55,"end":61,"loc":{"start":{"line":3,"column":23},"end":{"line":3,"column":29}} } }, "value": null }, { "type": "ClassProperty", - "start": 66, - "end": 86, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 22 - } - }, - "accessibility": "public", + "start":66,"end":86,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":22}}, "declare": true, + "accessibility": "public", "static": false, "key": { "type": "Identifier", - "start": 81, - "end": 85, - "loc": { - "start": { - "line": 5, - "column": 17 - }, - "end": { - "line": 5, - "column": 21 - }, - "identifierName": "foo1" - }, + "start":81,"end":85,"loc":{"start":{"line":5,"column":17},"end":{"line":5,"column":21},"identifierName":"foo1"}, "name": "foo1" }, "computed": false, @@ -217,36 +70,13 @@ }, { "type": "ClassProperty", - "start": 89, - "end": 109, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 22 - } - }, + "start":89,"end":109,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":22}}, "accessibility": "public", "declare": true, "static": false, "key": { "type": "Identifier", - "start": 104, - "end": 108, - "loc": { - "start": { - "line": 6, - "column": 17 - }, - "end": { - "line": 6, - "column": 21 - }, - "identifierName": "foo2" - }, + "start":104,"end":108,"loc":{"start":{"line":6,"column":17},"end":{"line":6,"column":21},"identifierName":"foo2"}, "name": "foo2" }, "computed": false, @@ -254,36 +84,13 @@ }, { "type": "ClassProperty", - "start": 113, - "end": 140, - "loc": { - "start": { - "line": 8, - "column": 2 - }, - "end": { - "line": 8, - "column": 29 - } - }, - "accessibility": "public", + "start":113,"end":140,"loc":{"start":{"line":8,"column":2},"end":{"line":8,"column":29}}, "declare": true, + "accessibility": "public", "static": true, "key": { "type": "Identifier", - "start": 135, - "end": 139, - "loc": { - "start": { - "line": 8, - "column": 24 - }, - "end": { - "line": 8, - "column": 28 - }, - "identifierName": "foo4" - }, + "start":135,"end":139,"loc":{"start":{"line":8,"column":24},"end":{"line":8,"column":28},"identifierName":"foo4"}, "name": "foo4" }, "computed": false, @@ -291,36 +98,13 @@ }, { "type": "ClassProperty", - "start": 143, - "end": 170, - "loc": { - "start": { - "line": 9, - "column": 2 - }, - "end": { - "line": 9, - "column": 29 - } - }, + "start":143,"end":170,"loc":{"start":{"line":9,"column":2},"end":{"line":9,"column":29}}, "accessibility": "public", "declare": true, "static": true, "key": { "type": "Identifier", - "start": 165, - "end": 169, - "loc": { - "start": { - "line": 9, - "column": 24 - }, - "end": { - "line": 9, - "column": 28 - }, - "identifierName": "foo3" - }, + "start":165,"end":169,"loc":{"start":{"line":9,"column":24},"end":{"line":9,"column":28},"identifierName":"foo3"}, "name": "foo3" }, "computed": false, @@ -328,36 +112,13 @@ }, { "type": "ClassProperty", - "start": 173, - "end": 200, - "loc": { - "start": { - "line": 10, - "column": 2 - }, - "end": { - "line": 10, - "column": 29 - } - }, + "start":173,"end":200,"loc":{"start":{"line":10,"column":2},"end":{"line":10,"column":29}}, "accessibility": "public", "declare": true, "static": true, "key": { "type": "Identifier", - "start": 195, - "end": 199, - "loc": { - "start": { - "line": 10, - "column": 24 - }, - "end": { - "line": 10, - "column": 28 - }, - "identifierName": "foo5" - }, + "start":195,"end":199,"loc":{"start":{"line":10,"column":24},"end":{"line":10,"column":28},"identifierName":"foo5"}, "name": "foo5" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-field/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-field/output.json index 746e2964f4..6019ac5ff8 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare-field/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare-field/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":49,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":12,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "declare": true, "static": false, "key": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -114,66 +35,21 @@ }, { "type": "ClassProperty", - "start": 27, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":27,"end":47,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":22}}, "declare": true, "static": false, "key": { "type": "Identifier", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "bar" - }, + "start":35,"end":38,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":13},"identifierName":"bar"}, "name": "bar" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 38, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":38,"end":46,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":21}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 40, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 21 - } - } + "start":40,"end":46,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":21}} } }, "value": null diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-method/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-method/output.json index 0219c43119..ffa963c815 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare-method/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare-method/output.json @@ -1,115 +1,36 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Class methods cannot have the 'declare' modifier (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":30,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":12,"end":28,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":18}}, "declare": true, "static": false, "key": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "foo" - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13},"identifierName":"foo"}, "name": "foo" }, "computed": false, @@ -120,18 +41,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":26,"end":28,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare-new-line/output.json index 764a3d2f7e..8f95aef58b 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare-new-line/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "declare" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"declare"}, "name": "declare" } }, { "type": "ClassDeclaration", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":8,"end":18,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "B" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"B"}, "name": "B" }, "superClass": null, "body": { "type": "ClassBody", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":16,"end":18,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":10}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/class/declare/output.json b/packages/babel-parser/test/fixtures/typescript/class/declare/output.json index f52b40639e..05defba81f 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/declare/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/declare/output.json @@ -1,205 +1,60 @@ { "type": "File", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, + "declare": true, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "C" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 16, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":16,"end":87,"loc":{"start":{"line":1,"column":16},"end":{"line":7,"column":1}}, "body": [ { "type": "TSIndexSignature", - "start": 22, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":22,"end":39,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":21}}, "parameters": [ { "type": "Identifier", - "start": 23, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "x" - }, + "start":23,"end":32,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":14},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":24,"end":32,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":14}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - } - } + "start":26,"end":32,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14}} } } } ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 33, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":33,"end":38,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":20}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 20 - } - } + "start":35,"end":38,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":20}} } } }, { "type": "ClassProperty", - "start": 44, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":44,"end":46,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":6}}, "static": false, "key": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "x" - }, + "start":44,"end":45,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -207,99 +62,31 @@ }, { "type": "ClassProperty", - "start": 51, - "end": 61, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":51,"end":61,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":14}}, "static": false, "key": { "type": "Identifier", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "x" - }, + "start":51,"end":52,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":5},"identifierName":"x"}, "name": "x" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 52, - "end": 60, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":52,"end":60,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":13}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 54, - "end": 60, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 13 - } - } + "start":54,"end":60,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":13}} } }, "value": null }, { "type": "TSDeclareMethod", - "start": 66, - "end": 70, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 8 - } - }, + "start":66,"end":70,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":8}}, "static": false, "key": { "type": "Identifier", - "start": 66, - "end": 67, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - }, - "identifierName": "f" - }, + "start":66,"end":67,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":5},"identifierName":"f"}, "name": "f" }, "computed": false, @@ -311,34 +98,11 @@ }, { "type": "TSDeclareMethod", - "start": 75, - "end": 85, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 14 - } - }, + "start":75,"end":85,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":14}}, "static": false, "key": { "type": "Identifier", - "start": 75, - "end": 76, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 5 - }, - "identifierName": "f" - }, + "start":75,"end":76,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":5},"identifierName":"f"}, "name": "f" }, "computed": false, @@ -349,38 +113,15 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 78, - "end": 84, - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 13 - } - }, + "start":78,"end":84,"loc":{"start":{"line":6,"column":7},"end":{"line":6,"column":13}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 80, - "end": 84, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 13 - } - } + "start":80,"end":84,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":13}} } } } ] - }, - "declare": true + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-1/output.json b/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-1/output.json index fe51bdeade..945b98a430 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-1/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-1/output.json @@ -1,116 +1,37 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Duplicate modifier: 'declare' (2:17)" ], "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":41,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":12,"end":39,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":29}}, "declare": true, "accessibility": "public", "static": false, "key": { "type": "Identifier", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 28 - }, - "identifierName": "foo" - }, + "start":35,"end":38,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":28},"identifierName":"foo"}, "name": "foo" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-2/output.json b/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-2/output.json index d4a3379dd7..d902e7d6b7 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-2/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/duplicate-modifier-2/output.json @@ -1,116 +1,37 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Duplicate modifier: 'declare' (2:24)" ], "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":48,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 12, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":12,"end":46,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":36}}, "declare": true, "accessibility": "public", "static": true, "key": { "type": "Identifier", - "start": 42, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 32 - }, - "end": { - "line": 2, - "column": 35 - }, - "identifierName": "foo" - }, + "start":42,"end":45,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":35},"identifierName":"foo"}, "name": "foo" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/typescript/class/expression-extends-implements/output.json b/packages/babel-parser/test/fixtures/typescript/class/expression-extends-implements/output.json index be0e8f7c91..1111ab1f13 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/expression-extends-implements/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/expression-extends-implements/output.json @@ -1,140 +1,39 @@ { "type": "File", - "start": 0, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 46 - } - }, + "start":0,"end":91,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":46}}, "program": { "type": "Program", - "start": 0, - "end": 91, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 46 - } - }, + "start":0,"end":91,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":46}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "expression": { "type": "ClassExpression", - "start": 1, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":1,"end":42,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":42}}, "id": null, "superClass": { "type": "CallExpression", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "callee": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "f" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"f"}, "name": "f" }, "arguments": [] }, "superTypeParameters": { "type": "TSTypeParameterInstantiation", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "params": [ { "type": "TSTypeReference", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "typeName": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "T" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"T"}, "name": "T" } } @@ -143,111 +42,31 @@ "implements": [ { "type": "TSExpressionWithTypeArguments", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":33,"end":39,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":39}}, "expression": { "type": "TSQualifiedName", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":33,"end":36,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":36}}, "left": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "X" - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"X"}, "name": "X" }, "right": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "Y" - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36},"identifierName":"Y"}, "name": "Y" } }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 36, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":36,"end":39,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":39}}, "params": [ { "type": "TSTypeReference", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":37,"end":38,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":38}}, "typeName": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "T" - }, + "start":37,"end":38,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":38},"identifierName":"T"}, "name": "T" } } @@ -257,18 +76,7 @@ ], "body": { "type": "ClassBody", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":40,"end":42,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":42}}, "body": [] }, "extra": { @@ -279,126 +87,35 @@ }, { "type": "ExpressionStatement", - "start": 45, - "end": 91, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 46 - } - }, + "start":45,"end":91,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":46}}, "expression": { "type": "ClassExpression", - "start": 46, - "end": 89, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 44 - } - }, + "start":46,"end":89,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":44}}, "id": { "type": "Identifier", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "C" - }, + "start":52,"end":53,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"C"}, "name": "C" }, "superClass": { "type": "CallExpression", - "start": 62, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":62,"end":65,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":20}}, "callee": { "type": "Identifier", - "start": 62, - "end": 63, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "f" - }, + "start":62,"end":63,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"f"}, "name": "f" }, "arguments": [] }, "superTypeParameters": { "type": "TSTypeParameterInstantiation", - "start": 65, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":65,"end":68,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23}}, "params": [ { "type": "TSTypeReference", - "start": 66, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":66,"end":67,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22}}, "typeName": { "type": "Identifier", - "start": 66, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "T" - }, + "start":66,"end":67,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22},"identifierName":"T"}, "name": "T" } } @@ -407,111 +124,31 @@ "implements": [ { "type": "TSExpressionWithTypeArguments", - "start": 80, - "end": 86, - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 41 - } - }, + "start":80,"end":86,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":41}}, "expression": { "type": "TSQualifiedName", - "start": 80, - "end": 83, - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":80,"end":83,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":38}}, "left": { "type": "Identifier", - "start": 80, - "end": 81, - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 2, - "column": 36 - }, - "identifierName": "X" - }, + "start":80,"end":81,"loc":{"start":{"line":2,"column":35},"end":{"line":2,"column":36},"identifierName":"X"}, "name": "X" }, "right": { "type": "Identifier", - "start": 82, - "end": 83, - "loc": { - "start": { - "line": 2, - "column": 37 - }, - "end": { - "line": 2, - "column": 38 - }, - "identifierName": "Y" - }, + "start":82,"end":83,"loc":{"start":{"line":2,"column":37},"end":{"line":2,"column":38},"identifierName":"Y"}, "name": "Y" } }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 83, - "end": 86, - "loc": { - "start": { - "line": 2, - "column": 38 - }, - "end": { - "line": 2, - "column": 41 - } - }, + "start":83,"end":86,"loc":{"start":{"line":2,"column":38},"end":{"line":2,"column":41}}, "params": [ { "type": "TSTypeReference", - "start": 84, - "end": 85, - "loc": { - "start": { - "line": 2, - "column": 39 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":84,"end":85,"loc":{"start":{"line":2,"column":39},"end":{"line":2,"column":40}}, "typeName": { "type": "Identifier", - "start": 84, - "end": 85, - "loc": { - "start": { - "line": 2, - "column": 39 - }, - "end": { - "line": 2, - "column": 40 - }, - "identifierName": "T" - }, + "start":84,"end":85,"loc":{"start":{"line":2,"column":39},"end":{"line":2,"column":40},"identifierName":"T"}, "name": "T" } } @@ -521,18 +158,7 @@ ], "body": { "type": "ClassBody", - "start": 87, - "end": 89, - "loc": { - "start": { - "line": 2, - "column": 42 - }, - "end": { - "line": 2, - "column": 44 - } - }, + "start":87,"end":89,"loc":{"start":{"line":2,"column":42},"end":{"line":2,"column":44}}, "body": [] }, "extra": { diff --git a/packages/babel-parser/test/fixtures/typescript/class/expression-extends/output.json b/packages/babel-parser/test/fixtures/typescript/class/expression-extends/output.json index 079c1b83c1..a5c79a60ac 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/expression-extends/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/expression-extends/output.json @@ -1,140 +1,39 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expression": { "type": "ClassExpression", - "start": 1, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":1,"end":24,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":24}}, "id": null, "superClass": { "type": "CallExpression", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "callee": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "f" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"f"}, "name": "f" }, "arguments": [] }, "superTypeParameters": { "type": "TSTypeParameterInstantiation", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "params": [ { "type": "TSTypeReference", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "typeName": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "T" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"T"}, "name": "T" } } @@ -142,18 +41,7 @@ }, "body": { "type": "ClassBody", - "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}}, "body": [] }, "extra": { @@ -164,126 +52,35 @@ }, { "type": "ExpressionStatement", - "start": 27, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":27,"end":55,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":28}}, "expression": { "type": "ClassExpression", - "start": 28, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":28,"end":53,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":26}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "C" - }, + "start":34,"end":35,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"C"}, "name": "C" }, "superClass": { "type": "CallExpression", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":44,"end":47,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":20}}, "callee": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "f" - }, + "start":44,"end":45,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"f"}, "name": "f" }, "arguments": [] }, "superTypeParameters": { "type": "TSTypeParameterInstantiation", - "start": 47, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":47,"end":50,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23}}, "params": [ { "type": "TSTypeReference", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":48,"end":49,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22}}, "typeName": { "type": "Identifier", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "T" - }, + "start":48,"end":49,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22},"identifierName":"T"}, "name": "T" } } @@ -291,18 +88,7 @@ }, "body": { "type": "ClassBody", - "start": 51, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":51,"end":53,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":26}}, "body": [] }, "extra": { 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 08401f5d6d..1947c1767d 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 @@ -1,92 +1,26 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ClassExpression", - "start": 1, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":1,"end":12,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":12}}, "id": null, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9}}, "params": [ { "type": "TSTypeParameter", - "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}}, "name": "T" } ] @@ -94,18 +28,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "body": [] }, "extra": { @@ -116,78 +39,22 @@ }, { "type": "ExpressionStatement", - "start": 15, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":15,"end":31,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "expression": { "type": "ClassExpression", - "start": 16, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":16,"end":29,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "C" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"C"}, "name": "C" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":23,"end":26,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":11}}, "params": [ { "type": "TSTypeParameter", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "name": "T" } ] @@ -195,18 +62,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":27,"end":29,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [] }, "extra": { diff --git a/packages/babel-parser/test/fixtures/typescript/class/expression-implements/output.json b/packages/babel-parser/test/fixtures/typescript/class/expression-implements/output.json index e4478a0a5c..c1df03485d 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/expression-implements/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/expression-implements/output.json @@ -1,171 +1,47 @@ { "type": "File", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "ClassExpression", - "start": 1, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":1,"end":27,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":27}}, "superClass": null, "implements": [ { "type": "TSExpressionWithTypeArguments", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}}, "expression": { "type": "TSQualifiedName", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "left": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "X" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"X"}, "name": "X" }, "right": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "Y" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"Y"}, "name": "Y" } }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":24}}, "params": [ { "type": "TSTypeReference", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, "typeName": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "T" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"T"}, "name": "T" } } @@ -175,18 +51,7 @@ ], "body": { "type": "ClassBody", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":25,"end":27,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":27}}, "body": [] }, "extra": { @@ -197,158 +62,44 @@ }, { "type": "ExpressionStatement", - "start": 30, - "end": 61, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":30,"end":61,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":31}}, "expression": { "type": "ClassExpression", - "start": 31, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":31,"end":59,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":29}}, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "C" - }, + "start":37,"end":38,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":8},"identifierName":"C"}, "name": "C" }, "superClass": null, "implements": [ { "type": "TSExpressionWithTypeArguments", - "start": 50, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":50,"end":56,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":26}}, "expression": { "type": "TSQualifiedName", - "start": 50, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":50,"end":53,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":23}}, "left": { "type": "Identifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 21 - }, - "identifierName": "X" - }, + "start":50,"end":51,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":21},"identifierName":"X"}, "name": "X" }, "right": { "type": "Identifier", - "start": 52, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "Y" - }, + "start":52,"end":53,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":23},"identifierName":"Y"}, "name": "Y" } }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 53, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":53,"end":56,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":26}}, "params": [ { "type": "TSTypeReference", - "start": 54, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":54,"end":55,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":25}}, "typeName": { "type": "Identifier", - "start": 54, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "T" - }, + "start":54,"end":55,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":25},"identifierName":"T"}, "name": "T" } } @@ -358,18 +109,7 @@ ], "body": { "type": "ClassBody", - "start": 57, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":57,"end":59,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":29}}, "body": [] }, "extra": { diff --git a/packages/babel-parser/test/fixtures/typescript/class/extends-empty/output.json b/packages/babel-parser/test/fixtures/typescript/class/extends-empty/output.json index 0fe556a129..c27b6af00f 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/extends-empty/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/extends-empty/output.json @@ -1,83 +1,27 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "errors": [ "SyntaxError: 'extends' list cannot be empty. (1:22)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "extends": [], "body": { "type": "TSInterfaceBody", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":2,"column":1}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/output.json b/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/output.json index a84755dbbe..ba6f83ebb0 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/extends-implements-empty/output.json @@ -1,100 +1,32 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "errors": [ "SyntaxError: 'implements' list cannot be empty. (1:33)" ], "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "id": { "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" }, "superClass": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "Bar" - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21},"identifierName":"Bar"}, "name": "Bar" }, "implements": [], "body": { "type": "ClassBody", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":33,"end":36,"loc":{"start":{"line":1,"column":33},"end":{"line":2,"column":1}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/class/extends-implements/output.json b/packages/babel-parser/test/fixtures/typescript/class/extends-implements/output.json index e87b662064..65b948ab95 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/extends-implements/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/extends-implements/output.json @@ -1,142 +1,40 @@ { "type": "File", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":0,"end":43,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":43}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": { "type": "CallExpression", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}}, "callee": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "f" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"f"}, "name": "f" }, "arguments": [] }, "superTypeParameters": { "type": "TSTypeParameterInstantiation", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, "params": [ { "type": "TSTypeReference", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "typeName": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "T" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"T"}, "name": "T" } } @@ -145,111 +43,31 @@ "implements": [ { "type": "TSExpressionWithTypeArguments", - "start": 34, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":34,"end":40,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":40}}, "expression": { "type": "TSQualifiedName", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":34,"end":37,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":37}}, "left": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "X" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"X"}, "name": "X" }, "right": { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 37 - }, - "identifierName": "Y" - }, + "start":36,"end":37,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":37},"identifierName":"Y"}, "name": "Y" } }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 37, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":37,"end":40,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":40}}, "params": [ { "type": "TSTypeReference", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39}}, "typeName": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - }, - "identifierName": "T" - }, + "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39},"identifierName":"T"}, "name": "T" } } @@ -259,18 +77,7 @@ ], "body": { "type": "ClassBody", - "start": 41, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":41,"end":43,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":43}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/class/extends/output.json b/packages/babel-parser/test/fixtures/typescript/class/extends/output.json index 458a092357..676b374c2e 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/extends/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/extends/output.json @@ -1,142 +1,40 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": { "type": "CallExpression", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}}, "callee": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "f" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"f"}, "name": "f" }, "arguments": [] }, "superTypeParameters": { "type": "TSTypeParameterInstantiation", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, "params": [ { "type": "TSTypeReference", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "typeName": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "T" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"T"}, "name": "T" } } @@ -144,18 +42,7 @@ }, "body": { "type": "ClassBody", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":23,"end":25,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":25}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/class/generic/output.json b/packages/babel-parser/test/fixtures/typescript/class/generic/output.json index eed6e29d71..a01ce54b0a 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/generic/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/generic/output.json @@ -1,185 +1,51 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 7, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":7,"end":41,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":41}}, "params": [ { "type": "TSTypeParameter", - "start": 8, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":8,"end":40,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":40}}, "name": "T", "constraint": { "type": "TSObjectKeyword", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}} }, "default": { "type": "TSTypeLiteral", - "start": 27, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":27,"end":40,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":40}}, "members": [ { "type": "TSPropertySignature", - "start": 29, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":29,"end":38,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":38}}, "key": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "x" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"x"}, "name": "x" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 30, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":30,"end":38,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":38}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - } + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}} } } } @@ -191,18 +57,7 @@ "superClass": null, "body": { "type": "ClassBody", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":42,"end":44,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":44}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/class/get-generic/output.json b/packages/babel-parser/test/fixtures/typescript/class/get-generic/output.json index bdf468513b..19af433cd4 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/get-generic/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/get-generic/output.json @@ -1,144 +1,44 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, + "declare": true, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "C" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 16, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":39,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "body": [ { "type": "TSDeclareMethod", - "start": 22, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":22,"end":37,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":19}}, "static": false, "key": { "type": "Identifier", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "get" - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"get"}, "name": "get" }, "computed": false, "kind": "method", "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 25, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":25,"end":28,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":10}}, "params": [ { "type": "TSTypeParameter", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, "name": "T" } ] @@ -149,38 +49,15 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":30,"end":36,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":18}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 32, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 18 - } - } + "start":32,"end":36,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":18}} } } } ] - }, - "declare": true + } } ], "directives": [] diff --git a/packages/babel-parser/test/fixtures/typescript/class/implements-empty/output.json b/packages/babel-parser/test/fixtures/typescript/class/implements-empty/output.json index bcf3445883..19e0d7bc5a 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/implements-empty/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/implements-empty/output.json @@ -1,84 +1,28 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "errors": [ "SyntaxError: 'implements' list cannot be empty. (1:21)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "id": { "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" }, "superClass": null, "implements": [], "body": { "type": "ClassBody", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":21,"end":24,"loc":{"start":{"line":1,"column":21},"end":{"line":2,"column":1}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/class/implements/output.json b/packages/babel-parser/test/fixtures/typescript/class/implements/output.json index 2117403c61..931c3c99a4 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/implements/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/implements/output.json @@ -1,174 +1,49 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "implements": [ { "type": "TSExpressionWithTypeArguments", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}}, "expression": { "type": "TSQualifiedName", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, "left": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "X" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"X"}, "name": "X" }, "right": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "Y" - }, + "start":21,"end":22,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":22},"identifierName":"Y"}, "name": "Y" } }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":22,"end":25,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":25}}, "params": [ { "type": "TSTypeReference", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24}}, "typeName": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "T" - }, + "start":23,"end":24,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":24},"identifierName":"T"}, "name": "T" } } @@ -178,18 +53,7 @@ ], "body": { "type": "ClassBody", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":26,"end":28,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":28}}, "body": [] } } 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 b1b3fd1a35..3e05b3479d 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 @@ -1,267 +1,77 @@ { "type": "File", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":64,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "TSIndexSignature", - "start": 14, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":14,"end":31,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":21}}, "parameters": [ { "type": "Identifier", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "x" - }, + "start":15,"end":24,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":14},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 16, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":16,"end":24,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":14}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - } - } + "start":18,"end":24,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14}} } } } ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":25,"end":30,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":20}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 20 - } - } + "start":27,"end":30,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":20}} } } }, { "type": "TSIndexSignature", - "start": 36, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 30 - } - }, + "start":36,"end":62,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":30}}, "readonly": true, "parameters": [ { "type": "Identifier", - "start": 46, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 23 - }, - "identifierName": "x" - }, + "start":46,"end":55,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":23},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 47, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":47,"end":55,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":23}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 49, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 23 - } - } + "start":49,"end":55,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":23}} } } } ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 56, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":56,"end":61,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":29}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 58, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 26 - }, - "end": { - "line": 3, - "column": 29 - } - } + "start":58,"end":61,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":29}} } } } 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 bcd481d869..6619ed4663 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 @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 118, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":118,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 118, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":118,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 118, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":118,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 118, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":8,"end":118,"loc":{"start":{"line":1,"column":8},"end":{"line":7,"column":1}}, "body": [ { "type": "TSDeclareMethod", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":14,"end":29,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":19}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "public" - }, + "start":14,"end":20,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":10},"identifierName":"public"}, "name": "public" }, "computed": false, @@ -116,67 +37,22 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":22,"end":28,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":18}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 18 - } - } + "start":24,"end":28,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":18}} } } }, { "type": "TSDeclareMethod", - "start": 34, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 26 - } - }, + "start":34,"end":56,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":26}}, "accessibility": "public", "kind": "method", "computed": false, "key": { "type": "Identifier", - "start": 41, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "static" - }, + "start":41,"end":47,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":17},"identifierName":"static"}, "name": "static" }, "static": false, @@ -186,82 +62,26 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 49, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":49,"end":55,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":25}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 51, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 25 - } - } + "start":51,"end":55,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":25}} } } }, { "type": "ClassProperty", - "start": 61, - "end": 74, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 17 - } - }, + "start":61,"end":74,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":17}}, "static": false, "key": { "type": "Identifier", - "start": 61, - "end": 69, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 12 - }, - "identifierName": "readonly" - }, + "start":61,"end":69,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":12},"identifierName":"readonly"}, "name": "readonly" }, "computed": false, "value": { "type": "NumericLiteral", - "start": 72, - "end": 73, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 16 - } - }, + "start":72,"end":73,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":16}}, "extra": { "rawValue": 0, "raw": "0" @@ -271,67 +91,22 @@ }, { "type": "TSDeclareMethod", - "start": 79, - "end": 96, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 21 - } - }, + "start":79,"end":96,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":21}}, "static": false, "key": { "type": "Identifier", - "start": 79, - "end": 84, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 9 - }, - "identifierName": "async" - }, + "start":79,"end":84,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":9},"identifierName":"async"}, "name": "async" }, "computed": false, "kind": "method", "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 84, - "end": 87, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 12 - } - }, + "start":84,"end":87,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":12}}, "params": [ { "type": "TSTypeParameter", - "start": 85, - "end": 86, - "loc": { - "start": { - "line": 5, - "column": 10 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":85,"end":86,"loc":{"start":{"line":5,"column":10},"end":{"line":5,"column":11}}, "name": "T" } ] @@ -342,97 +117,30 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 89, - "end": 95, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 20 - } - }, + "start":89,"end":95,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":20}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 91, - "end": 95, - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 5, - "column": 20 - } - } + "start":91,"end":95,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":20}} } } }, { "type": "ClassProperty", - "start": 101, - "end": 116, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 19 - } - }, + "start":101,"end":116,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":19}}, "static": false, "key": { "type": "Identifier", - "start": 101, - "end": 109, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 12 - }, - "identifierName": "abstract" - }, + "start":101,"end":109,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":12},"identifierName":"abstract"}, "name": "abstract" }, "computed": false, "definite": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 110, - "end": 115, - "loc": { - "start": { - "line": 6, - "column": 13 - }, - "end": { - "line": 6, - "column": 18 - } - }, + "start":110,"end":115,"loc":{"start":{"line":6,"column":13},"end":{"line":6,"column":18}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 111, - "end": 115, - "loc": { - "start": { - "line": 6, - "column": 14 - }, - "end": { - "line": 6, - "column": 18 - } - } + "start":111,"end":115,"loc":{"start":{"line":6,"column":14},"end":{"line":6,"column":18}} } }, "value": null diff --git a/packages/babel-parser/test/fixtures/typescript/class/members-with-reserved-names/output.json b/packages/babel-parser/test/fixtures/typescript/class/members-with-reserved-names/output.json index b386e7aadf..e73309d582 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/members-with-reserved-names/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/members-with-reserved-names/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":38,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "TSDeclareMethod", - "start": 14, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":14,"end":36,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":26}}, "accessibility": "public", "static": false, "key": { "type": "Identifier", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "delete" - }, + "start":21,"end":27,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":17},"identifierName":"delete"}, "name": "delete" }, "computed": false, @@ -117,32 +38,10 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":29,"end":35,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":25}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 31, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 25 - } - } + "start":31,"end":35,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":25}} } } } 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 e1021cdafa..48a27c3f99 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 @@ -1,143 +1,41 @@ { "type": "File", - "start": 0, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":74,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":74,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":74,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":74,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "TSDeclareMethod", - "start": 14, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":14,"end":40,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":30}}, "static": false, "computed": true, "key": { "type": "MemberExpression", - "start": 15, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":15,"end":30,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":20}}, "object": { "type": "Identifier", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "Symbol" - }, + "start":15,"end":21,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, "property": { "type": "Identifier", - "start": 22, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "iterator" - }, + "start":22,"end":30,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":20},"identifierName":"iterator"}, "name": "iterator" }, "computed": false @@ -149,97 +47,29 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":33,"end":39,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":29}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 35, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 29 - } - } + "start":35,"end":39,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":29}} } } }, { "type": "TSDeclareMethod", - "start": 45, - "end": 72, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 31 - } - }, + "start":45,"end":72,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":31}}, "static": false, "computed": true, "key": { "type": "MemberExpression", - "start": 46, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":46,"end":61,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":20}}, "object": { "type": "Identifier", - "start": 46, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "Symbol" - }, + "start":46,"end":52,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, "property": { "type": "Identifier", - "start": 53, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 20 - }, - "identifierName": "iterator" - }, + "start":53,"end":61,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":20},"identifierName":"iterator"}, "name": "iterator" }, "computed": false @@ -252,32 +82,10 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 65, - "end": 71, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 30 - } - }, + "start":65,"end":71,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":30}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 67, - "end": 71, - "loc": { - "start": { - "line": 3, - "column": 26 - }, - "end": { - "line": 3, - "column": 30 - } - } + "start":67,"end":71,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":30}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/class/method-generic/output.json b/packages/babel-parser/test/fixtures/typescript/class/method-generic/output.json index 568975c0bd..390658ca66 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/method-generic/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/method-generic/output.json @@ -1,144 +1,43 @@ { "type": "File", - "start": 0, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":83,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":14,"end":48,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":38}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "f" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"f"}, "name": "f" }, "computed": false, "kind": "method", "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":15,"end":18,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8}}, "params": [ { "type": "TSTypeParameter", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "name": "T" } ] @@ -149,63 +48,17 @@ "params": [ { "type": "Identifier", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "a" - }, + "start":19,"end":23,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":13},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":13}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13}}, "typeName": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "T" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"T"}, "name": "T" } } @@ -213,64 +66,18 @@ }, { "type": "Identifier", - "start": 25, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "b" - }, + "start":25,"end":30,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":20},"identifierName":"b"}, "name": "b", "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":27,"end":30,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":20}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":29,"end":30,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20}}, "typeName": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "T" - }, + "start":29,"end":30,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20},"identifierName":"T"}, "name": "T" } } @@ -278,92 +85,24 @@ }, { "type": "RestElement", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":32,"end":41,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":31}}, "argument": { "type": "Identifier", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 26 - }, - "identifierName": "c" - }, + "start":35,"end":36,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":26},"identifierName":"c"}, "name": "c" }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 36, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":36,"end":41,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":31}}, "typeAnnotation": { "type": "TSArrayType", - "start": 38, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":38,"end":41,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":31}}, "elementType": { "type": "TSTypeReference", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":38,"end":39,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":29}}, "typeName": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 29 - }, - "identifierName": "T" - }, + "start":38,"end":39,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":29},"identifierName":"T"}, "name": "T" } } @@ -373,131 +112,40 @@ ], "returnType": { "type": "TSTypeAnnotation", - "start": 42, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 32 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":42,"end":45,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":35}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 34 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":44,"end":45,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":35}}, "typeName": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 2, - "column": 34 - }, - "end": { - "line": 2, - "column": 35 - }, - "identifierName": "T" - }, + "start":44,"end":45,"loc":{"start":{"line":2,"column":34},"end":{"line":2,"column":35},"identifierName":"T"}, "name": "T" } } }, "body": { "type": "BlockStatement", - "start": 46, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 36 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":46,"end":48,"loc":{"start":{"line":2,"column":36},"end":{"line":2,"column":38}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 53, - "end": 81, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 32 - } - }, + "start":53,"end":81,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":32}}, "static": false, "computed": true, "key": { "type": "MemberExpression", - "start": 54, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":54,"end":69,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":20}}, "object": { "type": "Identifier", - "start": 54, - "end": 60, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "Symbol" - }, + "start":54,"end":60,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, "property": { "type": "Identifier", - "start": 61, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 20 - }, - "identifierName": "iterator" - }, + "start":61,"end":69,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":20},"identifierName":"iterator"}, "name": "iterator" }, "computed": false @@ -505,33 +153,11 @@ "kind": "method", "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 70, - "end": 73, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":70,"end":73,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":24}}, "params": [ { "type": "TSTypeParameter", - "start": 71, - "end": 72, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":71,"end":72,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":23}}, "name": "T" } ] @@ -542,65 +168,20 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 75, - "end": 78, - "loc": { - "start": { - "line": 3, - "column": 26 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":75,"end":78,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":29}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 77, - "end": 78, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":77,"end":78,"loc":{"start":{"line":3,"column":28},"end":{"line":3,"column":29}}, "typeName": { "type": "Identifier", - "start": 77, - "end": 78, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 29 - }, - "identifierName": "T" - }, + "start":77,"end":78,"loc":{"start":{"line":3,"column":28},"end":{"line":3,"column":29},"identifierName":"T"}, "name": "T" } } }, "body": { "type": "BlockStatement", - "start": 79, - "end": 81, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 32 - } - }, + "start":79,"end":81,"loc":{"start":{"line":3,"column":30},"end":{"line":3,"column":32}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/class/method-no-body/output.json b/packages/babel-parser/test/fixtures/typescript/class/method-no-body/output.json index cbf364b4ae..65872f1e68 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/method-no-body/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/method-no-body/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":35,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "TSDeclareMethod", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":14,"end":18,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":8}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "f" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"f"}, "name": "f" }, "computed": false, @@ -117,34 +38,11 @@ }, { "type": "TSDeclareMethod", - "start": 23, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":23,"end":33,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":14}}, "static": false, "key": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "f" - }, + "start":23,"end":24,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"f"}, "name": "f" }, "computed": false, @@ -155,32 +53,10 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":26,"end":32,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":13}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 28, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":28,"end":32,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":13}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/class/method-optional/output.json b/packages/babel-parser/test/fixtures/typescript/class/method-optional/output.json index 7abca58de3..b4e838b1b9 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/method-optional/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/method-optional/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":29,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":14,"end":27,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":17}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "m" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"m"}, "name": "m" }, "computed": false, @@ -117,48 +38,15 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":18,"end":24,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 20, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 14 - } - } + "start":20,"end":24,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":14}} } }, "body": { "type": "BlockStatement", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":25,"end":27,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":17}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/class/method-readonly/output.json b/packages/babel-parser/test/fixtures/typescript/class/method-readonly/output.json index 198e2e1cf0..85529184ac 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/method-readonly/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/method-readonly/output.json @@ -1,115 +1,36 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Class methods cannot have the 'readonly' modifier (2:4)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":31,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":14,"end":29,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":19}}, "readonly": true, "static": false, "key": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "m" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"m"}, "name": "m" }, "computed": false, @@ -120,18 +41,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":27,"end":29,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":19}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/class/method-return-type/output.json b/packages/babel-parser/test/fixtures/typescript/class/method-return-type/output.json index 9cb642e1b3..4e1f8f0c5c 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/method-return-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/method-return-type/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":28,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":14,"end":26,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "f" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"f"}, "name": "f" }, "computed": false, @@ -116,48 +37,15 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":17,"end":23,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":13}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 13 - } - } + "start":19,"end":23,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":13}} } }, "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":24,"end":26,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/class/method-with-newline-with-body/output.json b/packages/babel-parser/test/fixtures/typescript/class/method-with-newline-with-body/output.json index 5d7a765595..a255c200f1 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/method-with-newline-with-body/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/method-with-newline-with-body/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":8,"end":31,"loc":{"start":{"line":2,"column":0},"end":{"line":6,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":14,"end":29,"loc":{"start":{"line":3,"column":4},"end":{"line":5,"column":5}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "m" - }, + "start":14,"end":15,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"m"}, "name": "m" }, "computed": false, @@ -116,18 +37,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - } - }, + "start":22,"end":29,"loc":{"start":{"line":4,"column":4},"end":{"line":5,"column":5}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/class/method-with-newline-without-body/output.json b/packages/babel-parser/test/fixtures/typescript/class/method-with-newline-without-body/output.json index a58a0876ce..f3b0d34b64 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/method-with-newline-without-body/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/method-with-newline-without-body/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":8,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":5,"column":1}}, "body": [ { "type": "TSDeclareMethod", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":14,"end":17,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "m" - }, + "start":14,"end":15,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"m"}, "name": "m" }, "computed": false, @@ -117,34 +38,11 @@ }, { "type": "TSDeclareMethod", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":22,"end":25,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":7}}, "static": false, "key": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "n" - }, + "start":22,"end":23,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":5},"identifierName":"n"}, "name": "n" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-accessors/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-accessors/output.json index 5a44292aaa..fcd7232c73 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-accessors/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-accessors/output.json @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 295, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":0,"end":295,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 295, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":0,"end":295,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 40, - "end": 295, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":40,"end":295,"loc":{"start":{"line":2,"column":0},"end":{"line":11,"column":1}}, "abstract": true, "id": { "type": "Identifier", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "C" - }, + "start":55,"end":56,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 57, - "end": 295, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":57,"end":295,"loc":{"start":{"line":2,"column":17},"end":{"line":11,"column":1}}, "body": [ { "type": "TSDeclareMethod", - "start": 63, - "end": 80, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":63,"end":80,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":21}}, "abstract": true, "static": false, "key": { "type": "Identifier", - "start": 76, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 18 - }, - "identifierName": "a" - }, + "start":76,"end":77,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":18},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -119,34 +40,11 @@ }, { "type": "ClassMethod", - "start": 85, - "end": 113, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 32 - } - }, + "start":85,"end":113,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":32}}, "static": true, "key": { "type": "Identifier", - "start": 96, - "end": 97, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 16 - }, - "identifierName": "s" - }, + "start":96,"end":97,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":16},"identifierName":"s"}, "name": "s" }, "computed": false, @@ -157,47 +55,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 100, - "end": 113, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 32 - } - }, + "start":100,"end":113,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":32}}, "body": [ { "type": "ReturnStatement", - "start": 102, - "end": 111, - "loc": { - "start": { - "line": 4, - "column": 21 - }, - "end": { - "line": 4, - "column": 30 - } - }, + "start":102,"end":111,"loc":{"start":{"line":4,"column":21},"end":{"line":4,"column":30}}, "argument": { "type": "NumericLiteral", - "start": 109, - "end": 110, - "loc": { - "start": { - "line": 4, - "column": 28 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":109,"end":110,"loc":{"start":{"line":4,"column":28},"end":{"line":4,"column":29}}, "extra": { "rawValue": 0, "raw": "0" @@ -211,36 +76,13 @@ }, { "type": "TSDeclareMethod", - "start": 118, - "end": 144, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 30 - } - }, + "start":118,"end":144,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":30}}, "accessibility": "public", "abstract": true, "static": false, "key": { "type": "Identifier", - "start": 138, - "end": 141, - "loc": { - "start": { - "line": 5, - "column": 24 - }, - "end": { - "line": 5, - "column": 27 - }, - "identifierName": "pua" - }, + "start":138,"end":141,"loc":{"start":{"line":5,"column":24},"end":{"line":5,"column":27},"identifierName":"pua"}, "name": "pua" }, "computed": false, @@ -252,35 +94,12 @@ }, { "type": "ClassMethod", - "start": 149, - "end": 186, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 41 - } - }, + "start":149,"end":186,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":41}}, "accessibility": "public", "static": true, "key": { "type": "Identifier", - "start": 167, - "end": 170, - "loc": { - "start": { - "line": 6, - "column": 22 - }, - "end": { - "line": 6, - "column": 25 - }, - "identifierName": "pus" - }, + "start":167,"end":170,"loc":{"start":{"line":6,"column":22},"end":{"line":6,"column":25},"identifierName":"pus"}, "name": "pus" }, "computed": false, @@ -291,47 +110,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 173, - "end": 186, - "loc": { - "start": { - "line": 6, - "column": 28 - }, - "end": { - "line": 6, - "column": 41 - } - }, + "start":173,"end":186,"loc":{"start":{"line":6,"column":28},"end":{"line":6,"column":41}}, "body": [ { "type": "ReturnStatement", - "start": 175, - "end": 184, - "loc": { - "start": { - "line": 6, - "column": 30 - }, - "end": { - "line": 6, - "column": 39 - } - }, + "start":175,"end":184,"loc":{"start":{"line":6,"column":30},"end":{"line":6,"column":39}}, "argument": { "type": "NumericLiteral", - "start": 182, - "end": 183, - "loc": { - "start": { - "line": 6, - "column": 37 - }, - "end": { - "line": 6, - "column": 38 - } - }, + "start":182,"end":183,"loc":{"start":{"line":6,"column":37},"end":{"line":6,"column":38}}, "extra": { "rawValue": 0, "raw": "0" @@ -345,35 +131,12 @@ }, { "type": "ClassMethod", - "start": 192, - "end": 221, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 33 - } - }, + "start":192,"end":221,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":33}}, "accessibility": "public", "static": false, "key": { "type": "Identifier", - "start": 203, - "end": 205, - "loc": { - "start": { - "line": 8, - "column": 15 - }, - "end": { - "line": 8, - "column": 17 - }, - "identifierName": "pu" - }, + "start":203,"end":205,"loc":{"start":{"line":8,"column":15},"end":{"line":8,"column":17},"identifierName":"pu"}, "name": "pu" }, "computed": false, @@ -384,47 +147,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 208, - "end": 221, - "loc": { - "start": { - "line": 8, - "column": 20 - }, - "end": { - "line": 8, - "column": 33 - } - }, + "start":208,"end":221,"loc":{"start":{"line":8,"column":20},"end":{"line":8,"column":33}}, "body": [ { "type": "ReturnStatement", - "start": 210, - "end": 219, - "loc": { - "start": { - "line": 8, - "column": 22 - }, - "end": { - "line": 8, - "column": 31 - } - }, + "start":210,"end":219,"loc":{"start":{"line":8,"column":22},"end":{"line":8,"column":31}}, "argument": { "type": "NumericLiteral", - "start": 217, - "end": 218, - "loc": { - "start": { - "line": 8, - "column": 29 - }, - "end": { - "line": 8, - "column": 30 - } - }, + "start":217,"end":218,"loc":{"start":{"line":8,"column":29},"end":{"line":8,"column":30}}, "extra": { "rawValue": 0, "raw": "0" @@ -438,35 +168,12 @@ }, { "type": "ClassMethod", - "start": 226, - "end": 258, - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 9, - "column": 36 - } - }, + "start":226,"end":258,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":36}}, "accessibility": "protected", "static": false, "key": { "type": "Identifier", - "start": 240, - "end": 242, - "loc": { - "start": { - "line": 9, - "column": 18 - }, - "end": { - "line": 9, - "column": 20 - }, - "identifierName": "po" - }, + "start":240,"end":242,"loc":{"start":{"line":9,"column":18},"end":{"line":9,"column":20},"identifierName":"po"}, "name": "po" }, "computed": false, @@ -477,47 +184,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 245, - "end": 258, - "loc": { - "start": { - "line": 9, - "column": 23 - }, - "end": { - "line": 9, - "column": 36 - } - }, + "start":245,"end":258,"loc":{"start":{"line":9,"column":23},"end":{"line":9,"column":36}}, "body": [ { "type": "ReturnStatement", - "start": 247, - "end": 256, - "loc": { - "start": { - "line": 9, - "column": 25 - }, - "end": { - "line": 9, - "column": 34 - } - }, + "start":247,"end":256,"loc":{"start":{"line":9,"column":25},"end":{"line":9,"column":34}}, "argument": { "type": "NumericLiteral", - "start": 254, - "end": 255, - "loc": { - "start": { - "line": 9, - "column": 32 - }, - "end": { - "line": 9, - "column": 33 - } - }, + "start":254,"end":255,"loc":{"start":{"line":9,"column":32},"end":{"line":9,"column":33}}, "extra": { "rawValue": 0, "raw": "0" @@ -531,35 +205,12 @@ }, { "type": "ClassMethod", - "start": 263, - "end": 293, - "loc": { - "start": { - "line": 10, - "column": 4 - }, - "end": { - "line": 10, - "column": 34 - } - }, + "start":263,"end":293,"loc":{"start":{"line":10,"column":4},"end":{"line":10,"column":34}}, "accessibility": "private", "static": false, "key": { "type": "Identifier", - "start": 275, - "end": 277, - "loc": { - "start": { - "line": 10, - "column": 16 - }, - "end": { - "line": 10, - "column": 18 - }, - "identifierName": "pi" - }, + "start":275,"end":277,"loc":{"start":{"line":10,"column":16},"end":{"line":10,"column":18},"identifierName":"pi"}, "name": "pi" }, "computed": false, @@ -570,47 +221,14 @@ "params": [], "body": { "type": "BlockStatement", - "start": 280, - "end": 293, - "loc": { - "start": { - "line": 10, - "column": 21 - }, - "end": { - "line": 10, - "column": 34 - } - }, + "start":280,"end":293,"loc":{"start":{"line":10,"column":21},"end":{"line":10,"column":34}}, "body": [ { "type": "ReturnStatement", - "start": 282, - "end": 291, - "loc": { - "start": { - "line": 10, - "column": 23 - }, - "end": { - "line": 10, - "column": 32 - } - }, + "start":282,"end":291,"loc":{"start":{"line":10,"column":23},"end":{"line":10,"column":32}}, "argument": { "type": "NumericLiteral", - "start": 289, - "end": 290, - "loc": { - "start": { - "line": 10, - "column": 30 - }, - "end": { - "line": 10, - "column": 31 - } - }, + "start":289,"end":290,"loc":{"start":{"line":10,"column":30},"end":{"line":10,"column":31}}, "extra": { "rawValue": 0, "raw": "0" @@ -628,18 +246,7 @@ { "type": "CommentLine", "value": " Copy of modifiers-methods with 'get'", - "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}} } ] } @@ -650,18 +257,7 @@ { "type": "CommentLine", "value": " Copy of modifiers-methods with 'get'", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/modifiers-methods-async/output.json b/packages/babel-parser/test/fixtures/typescript/class/modifiers-methods-async/output.json index 051a939e04..7cd1a5f643 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/modifiers-methods-async/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/modifiers-methods-async/output.json @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 256, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":0,"end":256,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 256, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":0,"end":256,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 42, - "end": 256, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":42,"end":256,"loc":{"start":{"line":2,"column":0},"end":{"line":11,"column":1}}, "abstract": true, "id": { "type": "Identifier", - "start": 57, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "C" - }, + "start":57,"end":58,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 59, - "end": 256, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":59,"end":256,"loc":{"start":{"line":2,"column":17},"end":{"line":11,"column":1}}, "body": [ { "type": "TSDeclareMethod", - "start": 65, - "end": 84, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":65,"end":84,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":23}}, "abstract": true, "static": false, "key": { "type": "Identifier", - "start": 80, - "end": 81, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 20 - }, - "identifierName": "a" - }, + "start":80,"end":81,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":20},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -119,34 +40,11 @@ }, { "type": "ClassMethod", - "start": 89, - "end": 108, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 23 - } - }, + "start":89,"end":108,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":23}}, "static": true, "key": { "type": "Identifier", - "start": 102, - "end": 103, - "loc": { - "start": { - "line": 4, - "column": 17 - }, - "end": { - "line": 4, - "column": 18 - }, - "identifierName": "s" - }, + "start":102,"end":103,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":18},"identifierName":"s"}, "name": "s" }, "computed": false, @@ -157,54 +55,20 @@ "params": [], "body": { "type": "BlockStatement", - "start": 106, - "end": 108, - "loc": { - "start": { - "line": 4, - "column": 21 - }, - "end": { - "line": 4, - "column": 23 - } - }, + "start":106,"end":108,"loc":{"start":{"line":4,"column":21},"end":{"line":4,"column":23}}, "body": [], "directives": [] } }, { "type": "TSDeclareMethod", - "start": 113, - "end": 141, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 32 - } - }, + "start":113,"end":141,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":32}}, "accessibility": "public", "abstract": true, "static": false, "key": { "type": "Identifier", - "start": 135, - "end": 138, - "loc": { - "start": { - "line": 5, - "column": 26 - }, - "end": { - "line": 5, - "column": 29 - }, - "identifierName": "pua" - }, + "start":135,"end":138,"loc":{"start":{"line":5,"column":26},"end":{"line":5,"column":29},"identifierName":"pua"}, "name": "pua" }, "computed": false, @@ -216,35 +80,12 @@ }, { "type": "ClassMethod", - "start": 146, - "end": 174, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 32 - } - }, + "start":146,"end":174,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":32}}, "accessibility": "public", "static": true, "key": { "type": "Identifier", - "start": 166, - "end": 169, - "loc": { - "start": { - "line": 6, - "column": 24 - }, - "end": { - "line": 6, - "column": 27 - }, - "identifierName": "pus" - }, + "start":166,"end":169,"loc":{"start":{"line":6,"column":24},"end":{"line":6,"column":27},"identifierName":"pus"}, "name": "pus" }, "computed": false, @@ -255,53 +96,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 172, - "end": 174, - "loc": { - "start": { - "line": 6, - "column": 30 - }, - "end": { - "line": 6, - "column": 32 - } - }, + "start":172,"end":174,"loc":{"start":{"line":6,"column":30},"end":{"line":6,"column":32}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 180, - "end": 200, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 24 - } - }, + "start":180,"end":200,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":24}}, "accessibility": "public", "static": false, "key": { "type": "Identifier", - "start": 193, - "end": 195, - "loc": { - "start": { - "line": 8, - "column": 17 - }, - "end": { - "line": 8, - "column": 19 - }, - "identifierName": "pu" - }, + "start":193,"end":195,"loc":{"start":{"line":8,"column":17},"end":{"line":8,"column":19},"identifierName":"pu"}, "name": "pu" }, "computed": false, @@ -312,53 +119,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 198, - "end": 200, - "loc": { - "start": { - "line": 8, - "column": 22 - }, - "end": { - "line": 8, - "column": 24 - } - }, + "start":198,"end":200,"loc":{"start":{"line":8,"column":22},"end":{"line":8,"column":24}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 205, - "end": 228, - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 9, - "column": 27 - } - }, + "start":205,"end":228,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":27}}, "accessibility": "protected", "static": false, "key": { "type": "Identifier", - "start": 221, - "end": 223, - "loc": { - "start": { - "line": 9, - "column": 20 - }, - "end": { - "line": 9, - "column": 22 - }, - "identifierName": "po" - }, + "start":221,"end":223,"loc":{"start":{"line":9,"column":20},"end":{"line":9,"column":22},"identifierName":"po"}, "name": "po" }, "computed": false, @@ -369,53 +142,19 @@ "params": [], "body": { "type": "BlockStatement", - "start": 226, - "end": 228, - "loc": { - "start": { - "line": 9, - "column": 25 - }, - "end": { - "line": 9, - "column": 27 - } - }, + "start":226,"end":228,"loc":{"start":{"line":9,"column":25},"end":{"line":9,"column":27}}, "body": [], "directives": [] } }, { "type": "ClassMethod", - "start": 233, - "end": 254, - "loc": { - "start": { - "line": 10, - "column": 4 - }, - "end": { - "line": 10, - "column": 25 - } - }, + "start":233,"end":254,"loc":{"start":{"line":10,"column":4},"end":{"line":10,"column":25}}, "accessibility": "private", "static": false, "key": { "type": "Identifier", - "start": 247, - "end": 249, - "loc": { - "start": { - "line": 10, - "column": 18 - }, - "end": { - "line": 10, - "column": 20 - }, - "identifierName": "pi" - }, + "start":247,"end":249,"loc":{"start":{"line":10,"column":18},"end":{"line":10,"column":20},"identifierName":"pi"}, "name": "pi" }, "computed": false, @@ -426,18 +165,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 252, - "end": 254, - "loc": { - "start": { - "line": 10, - "column": 23 - }, - "end": { - "line": 10, - "column": 25 - } - }, + "start":252,"end":254,"loc":{"start":{"line":10,"column":23},"end":{"line":10,"column":25}}, "body": [], "directives": [] } @@ -448,18 +176,7 @@ { "type": "CommentLine", "value": " Copy of modifiers-methods with 'async'", - "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}} } ] } @@ -470,18 +187,7 @@ { "type": "CommentLine", "value": " Copy of modifiers-methods with 'async'", - "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}} } ] } \ No newline at end of file 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 31a9103693..7f16ab4af1 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 @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 396, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 21, - "column": 1 - } - }, + "start":0,"end":396,"loc":{"start":{"line":1,"column":0},"end":{"line":21,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 396, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 21, - "column": 1 - } - }, + "start":0,"end":396,"loc":{"start":{"line":1,"column":0},"end":{"line":21,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 396, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 21, - "column": 1 - } - }, + "start":0,"end":396,"loc":{"start":{"line":1,"column":0},"end":{"line":21,"column":1}}, "abstract": true, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "C" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 17, - "end": 396, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 21, - "column": 1 - } - }, + "start":17,"end":396,"loc":{"start":{"line":1,"column":17},"end":{"line":21,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 23, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":23,"end":34,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":15}}, "readonly": true, "static": false, "key": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "r" - }, + "start":32,"end":33,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"r"}, "name": "r" }, "computed": false, @@ -115,102 +36,34 @@ }, { "type": "ClassProperty", - "start": 39, - "end": 60, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":39,"end":60,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":25}}, "readonly": true, "static": false, "key": { "type": "Identifier", - "start": 48, - "end": 50, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 15 - }, - "identifierName": "r2" - }, + "start":48,"end":50,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":15},"identifierName":"r2"}, "name": "r2" }, "computed": false, "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 51, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":51,"end":59,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":24}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 53, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 24 - } - } + "start":53,"end":59,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":24}} } }, "value": null }, { "type": "ClassProperty", - "start": 65, - "end": 76, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":65,"end":76,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}}, "abstract": true, "static": false, "key": { "type": "Identifier", - "start": 74, - "end": 75, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 14 - }, - "identifierName": "a" - }, + "start":74,"end":75,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":14},"identifierName":"a"}, "name": "a" }, "computed": false, @@ -218,34 +71,11 @@ }, { "type": "ClassProperty", - "start": 81, - "end": 90, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":81,"end":90,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":13}}, "static": true, "key": { "type": "Identifier", - "start": 88, - "end": 89, - "loc": { - "start": { - "line": 5, - "column": 11 - }, - "end": { - "line": 5, - "column": 12 - }, - "identifierName": "s" - }, + "start":88,"end":89,"loc":{"start":{"line":5,"column":11},"end":{"line":5,"column":12},"identifierName":"s"}, "name": "s" }, "computed": false, @@ -253,35 +83,12 @@ }, { "type": "ClassProperty", - "start": 96, - "end": 106, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 14 - } - }, + "start":96,"end":106,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":14}}, "accessibility": "public", "static": false, "key": { "type": "Identifier", - "start": 103, - "end": 105, - "loc": { - "start": { - "line": 7, - "column": 11 - }, - "end": { - "line": 7, - "column": 13 - }, - "identifierName": "pu" - }, + "start":103,"end":105,"loc":{"start":{"line":7,"column":11},"end":{"line":7,"column":13},"identifierName":"pu"}, "name": "pu" }, "computed": false, @@ -289,35 +96,12 @@ }, { "type": "ClassProperty", - "start": 111, - "end": 124, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 17 - } - }, + "start":111,"end":124,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":17}}, "accessibility": "protected", "static": false, "key": { "type": "Identifier", - "start": 121, - "end": 123, - "loc": { - "start": { - "line": 8, - "column": 14 - }, - "end": { - "line": 8, - "column": 16 - }, - "identifierName": "po" - }, + "start":121,"end":123,"loc":{"start":{"line":8,"column":14},"end":{"line":8,"column":16},"identifierName":"po"}, "name": "po" }, "computed": false, @@ -325,35 +109,12 @@ }, { "type": "ClassProperty", - "start": 129, - "end": 140, - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 9, - "column": 15 - } - }, + "start":129,"end":140,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":15}}, "accessibility": "private", "static": false, "key": { "type": "Identifier", - "start": 137, - "end": 139, - "loc": { - "start": { - "line": 9, - "column": 12 - }, - "end": { - "line": 9, - "column": 14 - }, - "identifierName": "pi" - }, + "start":137,"end":139,"loc":{"start":{"line":9,"column":12},"end":{"line":9,"column":14},"identifierName":"pi"}, "name": "pi" }, "computed": false, @@ -361,36 +122,13 @@ }, { "type": "ClassProperty", - "start": 146, - "end": 167, - "loc": { - "start": { - "line": 11, - "column": 4 - }, - "end": { - "line": 11, - "column": 25 - } - }, - "abstract": true, + "start":146,"end":167,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":25}}, "readonly": true, + "abstract": true, "static": false, "key": { "type": "Identifier", - "start": 164, - "end": 166, - "loc": { - "start": { - "line": 11, - "column": 22 - }, - "end": { - "line": 11, - "column": 24 - }, - "identifierName": "ra" - }, + "start":164,"end":166,"loc":{"start":{"line":11,"column":22},"end":{"line":11,"column":24},"identifierName":"ra"}, "name": "ra" }, "computed": false, @@ -398,36 +136,13 @@ }, { "type": "ClassProperty", - "start": 172, - "end": 193, - "loc": { - "start": { - "line": 12, - "column": 4 - }, - "end": { - "line": 12, - "column": 25 - } - }, + "start":172,"end":193,"loc":{"start":{"line":12,"column":4},"end":{"line":12,"column":25}}, "abstract": true, "readonly": true, "static": false, "key": { "type": "Identifier", - "start": 190, - "end": 192, - "loc": { - "start": { - "line": 12, - "column": 22 - }, - "end": { - "line": 12, - "column": 24 - }, - "identifierName": "ar" - }, + "start":190,"end":192,"loc":{"start":{"line":12,"column":22},"end":{"line":12,"column":24},"identifierName":"ar"}, "name": "ar" }, "computed": false, @@ -435,35 +150,12 @@ }, { "type": "ClassProperty", - "start": 198, - "end": 217, - "loc": { - "start": { - "line": 13, - "column": 4 - }, - "end": { - "line": 13, - "column": 23 - } - }, + "start":198,"end":217,"loc":{"start":{"line":13,"column":4},"end":{"line":13,"column":23}}, "readonly": true, "static": true, "key": { "type": "Identifier", - "start": 214, - "end": 216, - "loc": { - "start": { - "line": 13, - "column": 20 - }, - "end": { - "line": 13, - "column": 22 - }, - "identifierName": "sr" - }, + "start":214,"end":216,"loc":{"start":{"line":13,"column":20},"end":{"line":13,"column":22},"identifierName":"sr"}, "name": "sr" }, "computed": false, @@ -471,36 +163,13 @@ }, { "type": "ClassProperty", - "start": 223, - "end": 243, - "loc": { - "start": { - "line": 15, - "column": 4 - }, - "end": { - "line": 15, - "column": 24 - } - }, + "start":223,"end":243,"loc":{"start":{"line":15,"column":4},"end":{"line":15,"column":24}}, "accessibility": "public", "readonly": true, "static": false, "key": { "type": "Identifier", - "start": 239, - "end": 242, - "loc": { - "start": { - "line": 15, - "column": 20 - }, - "end": { - "line": 15, - "column": 23 - }, - "identifierName": "pur" - }, + "start":239,"end":242,"loc":{"start":{"line":15,"column":20},"end":{"line":15,"column":23},"identifierName":"pur"}, "name": "pur" }, "computed": false, @@ -508,36 +177,13 @@ }, { "type": "ClassProperty", - "start": 248, - "end": 268, - "loc": { - "start": { - "line": 16, - "column": 4 - }, - "end": { - "line": 16, - "column": 24 - } - }, + "start":248,"end":268,"loc":{"start":{"line":16,"column":4},"end":{"line":16,"column":24}}, "accessibility": "public", "abstract": true, "static": false, "key": { "type": "Identifier", - "start": 264, - "end": 267, - "loc": { - "start": { - "line": 16, - "column": 20 - }, - "end": { - "line": 16, - "column": 23 - }, - "identifierName": "pua" - }, + "start":264,"end":267,"loc":{"start":{"line":16,"column":20},"end":{"line":16,"column":23},"identifierName":"pua"}, "name": "pua" }, "computed": false, @@ -545,35 +191,12 @@ }, { "type": "ClassProperty", - "start": 273, - "end": 291, - "loc": { - "start": { - "line": 17, - "column": 4 - }, - "end": { - "line": 17, - "column": 22 - } - }, + "start":273,"end":291,"loc":{"start":{"line":17,"column":4},"end":{"line":17,"column":22}}, "accessibility": "public", "static": true, "key": { "type": "Identifier", - "start": 287, - "end": 290, - "loc": { - "start": { - "line": 17, - "column": 18 - }, - "end": { - "line": 17, - "column": 21 - }, - "identifierName": "pus" - }, + "start":287,"end":290,"loc":{"start":{"line":17,"column":18},"end":{"line":17,"column":21},"identifierName":"pus"}, "name": "pus" }, "computed": false, @@ -581,37 +204,14 @@ }, { "type": "ClassProperty", - "start": 296, - "end": 326, - "loc": { - "start": { - "line": 18, - "column": 4 - }, - "end": { - "line": 18, - "column": 34 - } - }, + "start":296,"end":326,"loc":{"start":{"line":18,"column":4},"end":{"line":18,"column":34}}, "accessibility": "public", - "abstract": true, "readonly": true, + "abstract": true, "static": false, "key": { "type": "Identifier", - "start": 321, - "end": 325, - "loc": { - "start": { - "line": 18, - "column": 29 - }, - "end": { - "line": 18, - "column": 33 - }, - "identifierName": "pura" - }, + "start":321,"end":325,"loc":{"start":{"line":18,"column":29},"end":{"line":18,"column":33},"identifierName":"pura"}, "name": "pura" }, "computed": false, @@ -619,37 +219,14 @@ }, { "type": "ClassProperty", - "start": 331, - "end": 361, - "loc": { - "start": { - "line": 19, - "column": 4 - }, - "end": { - "line": 19, - "column": 34 - } - }, + "start":331,"end":361,"loc":{"start":{"line":19,"column":4},"end":{"line":19,"column":34}}, "accessibility": "public", "abstract": true, "readonly": true, "static": false, "key": { "type": "Identifier", - "start": 356, - "end": 360, - "loc": { - "start": { - "line": 19, - "column": 29 - }, - "end": { - "line": 19, - "column": 33 - }, - "identifierName": "puar" - }, + "start":356,"end":360,"loc":{"start":{"line":19,"column":29},"end":{"line":19,"column":33},"identifierName":"puar"}, "name": "puar" }, "computed": false, @@ -657,36 +234,13 @@ }, { "type": "ClassProperty", - "start": 366, - "end": 394, - "loc": { - "start": { - "line": 20, - "column": 4 - }, - "end": { - "line": 20, - "column": 32 - } - }, + "start":366,"end":394,"loc":{"start":{"line":20,"column":4},"end":{"line":20,"column":32}}, "accessibility": "public", "readonly": true, "static": true, "key": { "type": "Identifier", - "start": 389, - "end": 393, - "loc": { - "start": { - "line": 20, - "column": 27 - }, - "end": { - "line": 20, - "column": 31 - }, - "identifierName": "pusr" - }, + "start":389,"end":393,"loc":{"start":{"line":20,"column":27},"end":{"line":20,"column":31},"identifierName":"pusr"}, "name": "pusr" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/output.json b/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/output.json index 9436fb7283..a2d22a5968 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-binding-patterns/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: A parameter property may not be declared using a binding pattern. (2:16)" ], "program": { "type": "Program", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":41,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":41,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":14,"end":39,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":29}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "constructor" - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":15},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -119,51 +40,18 @@ "params": [ { "type": "TSParameterProperty", - "start": 26, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":26,"end":35,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":25}}, "accessibility": "public", "parameter": { "type": "ArrayPattern", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":33,"end":35,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":25}}, "elements": [] } } ], "body": { "type": "BlockStatement", - "start": 37, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":37,"end":39,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":29}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-with-decorators/output.json b/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-with-decorators/output.json index a131ac8e69..0824c1204b 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-with-decorators/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/parameter-properties-with-decorators/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":55,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 43 - } - }, + "start":14,"end":53,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":43}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "constructor" - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":15},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -116,48 +37,14 @@ "params": [ { "type": "TSParameterProperty", - "start": 31, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 39 - } - }, + "start":31,"end":49,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":39}}, "decorators": [ { "type": "Decorator", - "start": 26, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":26,"end":30,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":20}}, "expression": { "type": "Identifier", - "start": 27, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "foo" - }, + "start":27,"end":30,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":20},"identifierName":"foo"}, "name": "foo" } } @@ -165,48 +52,14 @@ "readonly": true, "parameter": { "type": "Identifier", - "start": 40, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 39 - }, - "identifierName": "x" - }, + "start":40,"end":49,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":39},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 41, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 31 - }, - "end": { - "line": 2, - "column": 39 - } - }, + "start":41,"end":49,"loc":{"start":{"line":2,"column":31},"end":{"line":2,"column":39}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 43, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 33 - }, - "end": { - "line": 2, - "column": 39 - } - } + "start":43,"end":49,"loc":{"start":{"line":2,"column":33},"end":{"line":2,"column":39}} } } } @@ -214,18 +67,7 @@ ], "body": { "type": "BlockStatement", - "start": 51, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 41 - }, - "end": { - "line": 2, - "column": 43 - } - }, + "start":51,"end":53,"loc":{"start":{"line":2,"column":41},"end":{"line":2,"column":43}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/class/parameter-properties/output.json b/packages/babel-parser/test/fixtures/typescript/class/parameter-properties/output.json index 219e2a2a60..0e54ba03db 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/parameter-properties/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/parameter-properties/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 257, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":0,"end":257,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 257, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":0,"end":257,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 257, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":0,"end":257,"loc":{"start":{"line":1,"column":0},"end":{"line":11,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 257, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 11, - "column": 1 - } - }, + "start":8,"end":257,"loc":{"start":{"line":1,"column":8},"end":{"line":11,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 255, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 10, - "column": 33 - } - }, + "start":14,"end":255,"loc":{"start":{"line":2,"column":4},"end":{"line":10,"column":33}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "constructor" - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":15},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -116,292 +37,88 @@ "params": [ { "type": "TSParameterProperty", - "start": 35, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":35,"end":45,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":18}}, "readonly": true, "parameter": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 18 - }, - "identifierName": "r" - }, + "start":44,"end":45,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":18},"identifierName":"r"}, "name": "r" } }, { "type": "TSParameterProperty", - "start": 55, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":55,"end":72,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":25}}, "accessibility": "public", "parameter": { "type": "Identifier", - "start": 62, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 25 - }, - "identifierName": "pu" - }, + "start":62,"end":72,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":25},"identifierName":"pu"}, "name": "pu", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 64, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 17 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":64,"end":72,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":25}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 66, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 25 - } - } + "start":66,"end":72,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":25}} } } } }, { "type": "TSParameterProperty", - "start": 82, - "end": 95, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 21 - } - }, + "start":82,"end":95,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":21}}, "accessibility": "protected", "parameter": { "type": "Identifier", - "start": 92, - "end": 95, - "loc": { - "start": { - "line": 5, - "column": 18 - }, - "end": { - "line": 5, - "column": 21 - }, - "identifierName": "po" - }, + "start":92,"end":95,"loc":{"start":{"line":5,"column":18},"end":{"line":5,"column":21},"identifierName":"po"}, "name": "po", "optional": true } }, { "type": "TSParameterProperty", - "start": 105, - "end": 124, - "loc": { - "start": { - "line": 6, - "column": 8 - }, - "end": { - "line": 6, - "column": 27 - } - }, + "start":105,"end":124,"loc":{"start":{"line":6,"column":8},"end":{"line":6,"column":27}}, "accessibility": "private", "parameter": { "type": "Identifier", - "start": 113, - "end": 124, - "loc": { - "start": { - "line": 6, - "column": 16 - }, - "end": { - "line": 6, - "column": 27 - }, - "identifierName": "pi" - }, + "start":113,"end":124,"loc":{"start":{"line":6,"column":16},"end":{"line":6,"column":27},"identifierName":"pi"}, "name": "pi", "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 116, - "end": 124, - "loc": { - "start": { - "line": 6, - "column": 19 - }, - "end": { - "line": 6, - "column": 27 - } - }, + "start":116,"end":124,"loc":{"start":{"line":6,"column":19},"end":{"line":6,"column":27}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 118, - "end": 124, - "loc": { - "start": { - "line": 6, - "column": 21 - }, - "end": { - "line": 6, - "column": 27 - } - } + "start":118,"end":124,"loc":{"start":{"line":6,"column":21},"end":{"line":6,"column":27}} } } } }, { "type": "TSParameterProperty", - "start": 134, - "end": 153, - "loc": { - "start": { - "line": 7, - "column": 8 - }, - "end": { - "line": 7, - "column": 27 - } - }, + "start":134,"end":153,"loc":{"start":{"line":7,"column":8},"end":{"line":7,"column":27}}, "accessibility": "public", "readonly": true, "parameter": { "type": "Identifier", - "start": 150, - "end": 153, - "loc": { - "start": { - "line": 7, - "column": 24 - }, - "end": { - "line": 7, - "column": 27 - }, - "identifierName": "pur" - }, + "start":150,"end":153,"loc":{"start":{"line":7,"column":24},"end":{"line":7,"column":27},"identifierName":"pur"}, "name": "pur" } }, { "type": "TSParameterProperty", - "start": 206, - "end": 220, - "loc": { - "start": { - "line": 9, - "column": 8 - }, - "end": { - "line": 9, - "column": 22 - } - }, + "start":206,"end":220,"loc":{"start":{"line":9,"column":8},"end":{"line":9,"column":22}}, "readonly": true, "parameter": { "type": "AssignmentPattern", - "start": 215, - "end": 220, - "loc": { - "start": { - "line": 9, - "column": 17 - }, - "end": { - "line": 9, - "column": 22 - } - }, + "start":215,"end":220,"loc":{"start":{"line":9,"column":17},"end":{"line":9,"column":22}}, "left": { "type": "Identifier", - "start": 215, - "end": 216, - "loc": { - "start": { - "line": 9, - "column": 17 - }, - "end": { - "line": 9, - "column": 18 - }, - "identifierName": "x" - }, + "start":215,"end":216,"loc":{"start":{"line":9,"column":17},"end":{"line":9,"column":18},"identifierName":"x"}, "name": "x" }, "right": { "type": "NumericLiteral", - "start": 219, - "end": 220, - "loc": { - "start": { - "line": 9, - "column": 21 - }, - "end": { - "line": 9, - "column": 22 - } - }, + "start":219,"end":220,"loc":{"start":{"line":9,"column":21},"end":{"line":9,"column":22}}, "extra": { "rawValue": 0, "raw": "0" @@ -413,112 +130,34 @@ { "type": "CommentLine", "value": " Also works on AssignmentPattern", - "start": 163, - "end": 197, - "loc": { - "start": { - "line": 8, - "column": 8 - }, - "end": { - "line": 8, - "column": 42 - } - } + "start":163,"end":197,"loc":{"start":{"line":8,"column":8},"end":{"line":8,"column":42}} } ] }, { "type": "TSParameterProperty", - "start": 230, - "end": 251, - "loc": { - "start": { - "line": 10, - "column": 8 - }, - "end": { - "line": 10, - "column": 29 - } - }, + "start":230,"end":251,"loc":{"start":{"line":10,"column":8},"end":{"line":10,"column":29}}, "accessibility": "public", "parameter": { "type": "AssignmentPattern", - "start": 237, - "end": 251, - "loc": { - "start": { - "line": 10, - "column": 15 - }, - "end": { - "line": 10, - "column": 29 - } - }, + "start":237,"end":251,"loc":{"start":{"line":10,"column":15},"end":{"line":10,"column":29}}, "left": { "type": "Identifier", - "start": 237, - "end": 247, - "loc": { - "start": { - "line": 10, - "column": 15 - }, - "end": { - "line": 10, - "column": 25 - }, - "identifierName": "y" - }, + "start":237,"end":247,"loc":{"start":{"line":10,"column":15},"end":{"line":10,"column":25},"identifierName":"y"}, "name": "y", "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 239, - "end": 247, - "loc": { - "start": { - "line": 10, - "column": 17 - }, - "end": { - "line": 10, - "column": 25 - } - }, + "start":239,"end":247,"loc":{"start":{"line":10,"column":17},"end":{"line":10,"column":25}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 241, - "end": 247, - "loc": { - "start": { - "line": 10, - "column": 19 - }, - "end": { - "line": 10, - "column": 25 - } - } + "start":241,"end":247,"loc":{"start":{"line":10,"column":19},"end":{"line":10,"column":25}} } } }, "right": { "type": "NumericLiteral", - "start": 250, - "end": 251, - "loc": { - "start": { - "line": 10, - "column": 28 - }, - "end": { - "line": 10, - "column": 29 - } - }, + "start":250,"end":251,"loc":{"start":{"line":10,"column":28},"end":{"line":10,"column":29}}, "extra": { "rawValue": 0, "raw": "0" @@ -530,18 +169,7 @@ ], "body": { "type": "BlockStatement", - "start": 253, - "end": 255, - "loc": { - "start": { - "line": 10, - "column": 31 - }, - "end": { - "line": 10, - "column": 33 - } - }, + "start":253,"end":255,"loc":{"start":{"line":10,"column":31},"end":{"line":10,"column":33}}, "body": [], "directives": [] } @@ -556,18 +184,7 @@ { "type": "CommentLine", "value": " Also works on AssignmentPattern", - "start": 163, - "end": 197, - "loc": { - "start": { - "line": 8, - "column": 8 - }, - "end": { - "line": 8, - "column": 42 - } - } + "start":163,"end":197,"loc":{"start":{"line":8,"column":8},"end":{"line":8,"column":42}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/class/predicate-types/output.json b/packages/babel-parser/test/fixtures/typescript/class/predicate-types/output.json index a0f7f5f5f3..22a3ca661e 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/predicate-types/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/predicate-types/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":83,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 10, - "end": 83, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":10,"end":83,"loc":{"start":{"line":1,"column":10},"end":{"line":6,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 14, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":14,"end":43,"loc":{"start":{"line":2,"column":2},"end":{"line":3,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "isBar" - }, + "start":14,"end":19,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":7},"identifierName":"isBar"}, "name": "isBar" }, "computed": false, @@ -116,215 +37,60 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 21, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":21,"end":37,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":25}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 23, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":23,"end":37,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":25}}, "parameterName": { "type": "TSThisType", - "start": 23, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":23,"end":27,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":15}} }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":31,"end":37,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":25}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 25 - } - } + "start":31,"end":37,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":25}} } } } }, "body": { "type": "BlockStatement", - "start": 38, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 3, - "column": 3 - } - }, + "start":38,"end":43,"loc":{"start":{"line":2,"column":26},"end":{"line":3,"column":3}}, "body": [], "directives": [] } }, { "type": "ClassProperty", - "start": 46, - "end": 81, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":46,"end":81,"loc":{"start":{"line":4,"column":2},"end":{"line":5,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 46, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "isBaz" - }, + "start":46,"end":51,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":7},"identifierName":"isBaz"}, "name": "isBaz" }, "computed": false, "value": { "type": "ArrowFunctionExpression", - "start": 54, - "end": 81, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":54,"end":81,"loc":{"start":{"line":4,"column":10},"end":{"line":5,"column":3}}, "returnType": { "type": "TSTypeAnnotation", - "start": 56, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 12 - }, - "end": { - "line": 4, - "column": 28 - } - }, + "start":56,"end":72,"loc":{"start":{"line":4,"column":12},"end":{"line":4,"column":28}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 58, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 28 - } - }, + "start":58,"end":72,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":28}}, "parameterName": { "type": "TSThisType", - "start": 58, - "end": 62, - "loc": { - "start": { - "line": 4, - "column": 14 - }, - "end": { - "line": 4, - "column": 18 - } - } + "start":58,"end":62,"loc":{"start":{"line":4,"column":14},"end":{"line":4,"column":18}} }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 66, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 22 - }, - "end": { - "line": 4, - "column": 28 - } - }, + "start":66,"end":72,"loc":{"start":{"line":4,"column":22},"end":{"line":4,"column":28}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 66, - "end": 72, - "loc": { - "start": { - "line": 4, - "column": 22 - }, - "end": { - "line": 4, - "column": 28 - } - } + "start":66,"end":72,"loc":{"start":{"line":4,"column":22},"end":{"line":4,"column":28}} } } } @@ -335,18 +101,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 76, - "end": 81, - "loc": { - "start": { - "line": 4, - "column": 32 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":76,"end":81,"loc":{"start":{"line":4,"column":32},"end":{"line":5,"column":3}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json index 9107b07948..59f5d53634 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-abstract/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Private elements cannot have the 'abstract' modifier. (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "abstract": true, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "A" - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 17, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":17,"end":35,"loc":{"start":{"line":1,"column":17},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 21, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":21,"end":33,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "abstract": true, "static": false, "key": { "type": "PrivateName", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":30,"end":32,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "id": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "a" - }, + "start":31,"end":32,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"a"}, "name": "a" } }, diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json index 360a75b9f7..5e3dd363ef 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-private/output.json @@ -1,129 +1,39 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Private elements cannot have an accessibility modifier ('private') (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":25,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "accessibility": "private", "static": false, "key": { "type": "PrivateName", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":20,"end":22,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":12}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "a" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"a"}, "name": "a" } }, diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json index 60afa0c3bc..8a49738f30 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-protected/output.json @@ -1,129 +1,39 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Private elements cannot have an accessibility modifier ('protected') (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":27,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":12,"end":25,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":15}}, "accessibility": "protected", "static": false, "key": { "type": "PrivateName", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "a" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"a"}, "name": "a" } }, diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json index 3f526e4241..0bf961bf50 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-public/output.json @@ -1,129 +1,39 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "errors": [ "SyntaxError: Private elements cannot have an accessibility modifier ('public') (2:2)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":8,"end":24,"loc":{"start":{"line":1,"column":8},"end":{"line":3,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "accessibility": "public", "static": false, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "a" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"a"}, "name": "a" } }, diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json index 456ca59ae4..d97d1b18bc 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-modifier-readonly/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":49,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":12,"end":24,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":14}}, "readonly": true, "static": false, "key": { "type": "PrivateName", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":21,"end":23,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "a" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"a"}, "name": "a" } }, @@ -128,80 +38,24 @@ }, { "type": "ClassPrivateProperty", - "start": 27, - "end": 47, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":27,"end":47,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":22}}, "readonly": true, "static": false, "key": { "type": "PrivateName", - "start": 36, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":36,"end":38,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":13}}, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "b" - }, + "start":37,"end":38,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13},"identifierName":"b"}, "name": "b" } }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 38, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":38,"end":46,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":21}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 40, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 21 - } - } + "start":40,"end":46,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":21}} } }, "value": null diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields-static/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields-static/output.json index dcb6ab198f..96b576baa8 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields-static/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields-static/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":45,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":45,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":12,"end":22,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":12}}, "static": true, "key": { "type": "PrivateName", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" } }, @@ -127,79 +37,23 @@ }, { "type": "ClassPrivateProperty", - "start": 25, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":25,"end":43,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":20}}, "static": true, "key": { "type": "PrivateName", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":32,"end":34,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "y" - }, + "start":33,"end":34,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11},"identifierName":"y"}, "name": "y" } }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 34, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 19 - } - }, + "start":34,"end":42,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":19}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 19 - } - } + "start":36,"end":42,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":19}} } }, "value": null diff --git a/packages/babel-parser/test/fixtures/typescript/class/private-fields/output.json b/packages/babel-parser/test/fixtures/typescript/class/private-fields/output.json index 67a50c2c16..6d6a986845 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/private-fields/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/private-fields/output.json @@ -1,204 +1,58 @@ { "type": "File", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":7,"column":1}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 7, - "column": 1 - } - }, + "start":8,"end":70,"loc":{"start":{"line":1,"column":8},"end":{"line":7,"column":1}}, "body": [ { "type": "ClassPrivateProperty", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":13}}, "static": false, "key": { "type": "PrivateName", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 4 - } - }, + "start":12,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":4}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 4 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":4},"identifierName":"a"}, "name": "a" } }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 14, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":14,"end":22,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":12}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 12 - } - } + "start":16,"end":22,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":12}} } }, "value": null }, { "type": "ClassPrivateProperty", - "start": 26, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 6 - } - }, + "start":26,"end":30,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":6}}, "static": false, "key": { "type": "PrivateName", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":26,"end":28,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":4}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 3 - }, - "end": { - "line": 3, - "column": 4 - }, - "identifierName": "b" - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":3},"end":{"line":3,"column":4},"identifierName":"b"}, "name": "b" } }, @@ -207,128 +61,38 @@ }, { "type": "ClassPrivateProperty", - "start": 33, - "end": 45, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":33,"end":45,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":14}}, "static": false, "key": { "type": "PrivateName", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 4 - } - }, + "start":33,"end":35,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":4}}, "id": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 4, - "column": 3 - }, - "end": { - "line": 4, - "column": 4 - }, - "identifierName": "c" - }, + "start":34,"end":35,"loc":{"start":{"line":4,"column":3},"end":{"line":4,"column":4},"identifierName":"c"}, "name": "c" } }, "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 36, - "end": 44, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":36,"end":44,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":13}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 38, - "end": 44, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 13 - } - } + "start":38,"end":44,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":13}} } }, "value": null }, { "type": "ClassPrivateProperty", - "start": 48, - "end": 52, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 6 - } - }, + "start":48,"end":52,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":6}}, "static": false, "key": { "type": "PrivateName", - "start": 48, - "end": 50, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 4 - } - }, + "start":48,"end":50,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":4}}, "id": { "type": "Identifier", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 5, - "column": 3 - }, - "end": { - "line": 5, - "column": 4 - }, - "identifierName": "d" - }, + "start":49,"end":50,"loc":{"start":{"line":5,"column":3},"end":{"line":5,"column":4},"identifierName":"d"}, "name": "d" } }, @@ -337,80 +101,24 @@ }, { "type": "ClassPrivateProperty", - "start": 55, - "end": 68, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 15 - } - }, + "start":55,"end":68,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":15}}, "static": false, "key": { "type": "PrivateName", - "start": 55, - "end": 57, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 4 - } - }, + "start":55,"end":57,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":4}}, "id": { "type": "Identifier", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 6, - "column": 3 - }, - "end": { - "line": 6, - "column": 4 - }, - "identifierName": "e" - }, + "start":56,"end":57,"loc":{"start":{"line":6,"column":3},"end":{"line":6,"column":4},"identifierName":"e"}, "name": "e" } }, "definite": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 58, - "end": 67, - "loc": { - "start": { - "line": 6, - "column": 5 - }, - "end": { - "line": 6, - "column": 14 - } - }, + "start":58,"end":67,"loc":{"start":{"line":6,"column":5},"end":{"line":6,"column":14}}, "typeAnnotation": { "type": "TSBooleanKeyword", - "start": 60, - "end": 67, - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 14 - } - } + "start":60,"end":67,"loc":{"start":{"line":6,"column":7},"end":{"line":6,"column":14}} } }, "value": null diff --git a/packages/babel-parser/test/fixtures/typescript/class/properties/output.json b/packages/babel-parser/test/fixtures/typescript/class/properties/output.json index e2d79f6dbd..a0f6801ab6 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/properties/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/properties/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":8,"end":84,"loc":{"start":{"line":1,"column":8},"end":{"line":8,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":14,"end":16,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "static": false, "key": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "x" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -113,34 +34,11 @@ }, { "type": "ClassProperty", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 7 - } - }, + "start":21,"end":24,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":7}}, "static": false, "key": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "x" - }, + "start":21,"end":22,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -149,146 +47,45 @@ }, { "type": "ClassProperty", - "start": 29, - "end": 39, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":29,"end":39,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":14}}, "static": false, "key": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "x" - }, + "start":29,"end":30,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":5},"identifierName":"x"}, "name": "x" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 30, - "end": 38, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":30,"end":38,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":13}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 13 - } - } + "start":32,"end":38,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":13}} } }, "value": null }, { "type": "ClassProperty", - "start": 44, - "end": 58, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 18 - } - }, + "start":44,"end":58,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":18}}, "static": false, "key": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - }, - "identifierName": "x" - }, + "start":44,"end":45,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":5},"identifierName":"x"}, "name": "x" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 45, - "end": 53, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":45,"end":53,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":13}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 47, - "end": 53, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 13 - } - } + "start":47,"end":53,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":13}} } }, "value": { "type": "NumericLiteral", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 5, - "column": 16 - }, - "end": { - "line": 5, - "column": 17 - } - }, + "start":56,"end":57,"loc":{"start":{"line":5,"column":16},"end":{"line":5,"column":17}}, "extra": { "rawValue": 1, "raw": "1" @@ -298,34 +95,11 @@ }, { "type": "ClassProperty", - "start": 63, - "end": 66, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 7 - } - }, + "start":63,"end":66,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":7}}, "static": false, "key": { "type": "Identifier", - "start": 63, - "end": 64, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 5 - }, - "identifierName": "x" - }, + "start":63,"end":64,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":5},"identifierName":"x"}, "name": "x" }, "computed": false, @@ -334,66 +108,21 @@ }, { "type": "ClassProperty", - "start": 71, - "end": 82, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 15 - } - }, + "start":71,"end":82,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":15}}, "static": false, "key": { "type": "Identifier", - "start": 71, - "end": 72, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 5 - }, - "identifierName": "x" - }, + "start":71,"end":72,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":5},"identifierName":"x"}, "name": "x" }, "computed": false, "definite": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 73, - "end": 81, - "loc": { - "start": { - "line": 7, - "column": 6 - }, - "end": { - "line": 7, - "column": 14 - } - }, + "start":73,"end":81,"loc":{"start":{"line":7,"column":6},"end":{"line":7,"column":14}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 75, - "end": 81, - "loc": { - "start": { - "line": 7, - "column": 8 - }, - "end": { - "line": 7, - "column": 14 - } - } + "start":75,"end":81,"loc":{"start":{"line":7,"column":8},"end":{"line":7,"column":14}} } }, "value": null 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 4056ed0c50..e44bdb7e01 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 @@ -1,241 +1,71 @@ { "type": "File", - "start": 0, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":74,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":74,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":74,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 74, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":8,"end":74,"loc":{"start":{"line":1,"column":8},"end":{"line":4,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 14, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":14,"end":40,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":30}}, "static": false, "computed": true, "key": { "type": "MemberExpression", - "start": 15, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":15,"end":30,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":20}}, "object": { "type": "Identifier", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "Symbol" - }, + "start":15,"end":21,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, "property": { "type": "Identifier", - "start": 22, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "iterator" - }, + "start":22,"end":30,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":20},"identifierName":"iterator"}, "name": "iterator" }, "computed": false }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 31, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":31,"end":39,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":29}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 29 - } - } + "start":33,"end":39,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":29}} } }, "value": null }, { "type": "ClassProperty", - "start": 45, - "end": 72, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 31 - } - }, + "start":45,"end":72,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":31}}, "static": false, "computed": true, "key": { "type": "MemberExpression", - "start": 46, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":46,"end":61,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":20}}, "object": { "type": "Identifier", - "start": 46, - "end": 52, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "Symbol" - }, + "start":46,"end":52,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, "property": { "type": "Identifier", - "start": 53, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 20 - }, - "identifierName": "iterator" - }, + "start":53,"end":61,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":20},"identifierName":"iterator"}, "name": "iterator" }, "computed": false @@ -243,32 +73,10 @@ "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 63, - "end": 71, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 30 - } - }, + "start":63,"end":71,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":30}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 65, - "end": 71, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 30 - } - } + "start":65,"end":71,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":30}} } }, "value": null diff --git a/packages/babel-parser/test/fixtures/typescript/class/static/output.json b/packages/babel-parser/test/fixtures/typescript/class/static/output.json index 4c2c94afa9..6e530a5502 100644 --- a/packages/babel-parser/test/fixtures/typescript/class/static/output.json +++ b/packages/babel-parser/test/fixtures/typescript/class/static/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 100, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":100,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 100, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":100,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 100, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":100,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "C" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 100, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":8,"end":100,"loc":{"start":{"line":1,"column":8},"end":{"line":6,"column":1}}, "body": [ { "type": "TSDeclareMethod", - "start": 14, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":14,"end":25,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":15}}, "static": true, "key": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "f" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"f"}, "name": "f" }, "computed": false, @@ -117,35 +38,12 @@ }, { "type": "TSDeclareMethod", - "start": 30, - "end": 48, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":30,"end":48,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":22}}, "accessibility": "public", "static": true, "key": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 19 - }, - "identifierName": "f" - }, + "start":44,"end":45,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":19},"identifierName":"f"}, "name": "f" }, "computed": false, @@ -157,35 +55,12 @@ }, { "type": "TSDeclareMethod", - "start": 53, - "end": 74, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 25 - } - }, + "start":53,"end":74,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":25}}, "accessibility": "protected", "static": true, "key": { "type": "Identifier", - "start": 70, - "end": 71, - "loc": { - "start": { - "line": 4, - "column": 21 - }, - "end": { - "line": 4, - "column": 22 - }, - "identifierName": "f" - }, + "start":70,"end":71,"loc":{"start":{"line":4,"column":21},"end":{"line":4,"column":22},"identifierName":"f"}, "name": "f" }, "computed": false, @@ -197,35 +72,12 @@ }, { "type": "TSDeclareMethod", - "start": 79, - "end": 98, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 23 - } - }, + "start":79,"end":98,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":23}}, "accessibility": "private", "static": true, "key": { "type": "Identifier", - "start": 94, - "end": 95, - "loc": { - "start": { - "line": 5, - "column": 19 - }, - "end": { - "line": 5, - "column": 20 - }, - "identifierName": "f" - }, + "start":94,"end":95,"loc":{"start":{"line":5,"column":19},"end":{"line":5,"column":20},"identifierName":"f"}, "name": "f" }, "computed": false, diff --git a/packages/babel-parser/test/fixtures/typescript/const/no-initializer/output.json b/packages/babel-parser/test/fixtures/typescript/const/no-initializer/output.json index 9562e79796..abaabd96cd 100644 --- a/packages/babel-parser/test/fixtures/typescript/const/no-initializer/output.json +++ b/packages/babel-parser/test/fixtures/typescript/const/no-initializer/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15}}, "id": { "type": "Identifier", - "start": 6, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "x" - }, + "start":6,"end":15,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":15},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 7, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":7,"end":15,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":15}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } } }, diff --git a/packages/babel-parser/test/fixtures/typescript/declare/const-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/declare/const-new-line/output.json index 4d58e741f4..76b565c7bb 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/const-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/const-new-line/output.json @@ -1,139 +1,38 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "declare" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"declare"}, "name": "declare" } }, { "type": "VariableDeclaration", - "start": 8, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":8,"end":35,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}}, "declarations": [ { "type": "VariableDeclarator", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":14,"end":23,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "x" - }, + "start":14,"end":23,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":15},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":15,"end":23,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":15}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":17,"end":23,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} } } }, @@ -141,62 +40,17 @@ }, { "type": "VariableDeclarator", - "start": 25, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":25,"end":34,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":26}}, "id": { "type": "Identifier", - "start": 25, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 26 - }, - "identifierName": "y" - }, + "start":25,"end":34,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":26},"identifierName":"y"}, "name": "y", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 26, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":26,"end":34,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":26}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 26 - } - } + "start":28,"end":34,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":26}} } } }, diff --git a/packages/babel-parser/test/fixtures/typescript/declare/const/output.json b/packages/babel-parser/test/fixtures/typescript/declare/const/output.json index 234d16b48b..c91008a959 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/const/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/const/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 14, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "x" - }, + "start":14,"end":23,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":23},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 15, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":15,"end":23,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} } } }, @@ -109,62 +31,17 @@ }, { "type": "VariableDeclarator", - "start": 25, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":25,"end":34,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 25, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "y" - }, + "start":25,"end":34,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":34},"identifierName":"y"}, "name": "y", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 26, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":26,"end":34,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":34}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 34 - } - } + "start":28,"end":34,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":34}} } } }, diff --git a/packages/babel-parser/test/fixtures/typescript/declare/destructure-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/declare/destructure-new-line/output.json index a4ed43a77f..ad47170376 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/destructure-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/destructure-new-line/output.json @@ -1,159 +1,46 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 41 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":41}}, "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 41 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":41}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "declare" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"declare"}, "name": "declare" } }, { "type": "VariableDeclaration", - "start": 8, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 41 - } - }, + "start":8,"end":49,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":41}}, "declarations": [ { "type": "VariableDeclarator", - "start": 14, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":14,"end":48,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":40}}, "id": { "type": "ObjectPattern", - "start": 14, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":14,"end":48,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":40}}, "properties": [ { "type": "ObjectProperty", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, "method": false, "key": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "x" - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "x" - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9},"identifierName":"x"}, "name": "x" }, "extra": { @@ -162,53 +49,18 @@ }, { "type": "ObjectProperty", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12}}, "method": false, "key": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "y" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "y" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"y"}, "name": "y" }, "extra": { @@ -218,156 +70,44 @@ ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 22, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":22,"end":48,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":40}}, "typeAnnotation": { "type": "TSTypeLiteral", - "start": 24, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":24,"end":48,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":40}}, "members": [ { "type": "TSPropertySignature", - "start": 26, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":26,"end":36,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":28}}, "key": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "x" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19},"identifierName":"x"}, "name": "x" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 27, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":27,"end":35,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":27}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 27 - } - } + "start":29,"end":35,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":27}} } } }, { "type": "TSPropertySignature", - "start": 37, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":37,"end":46,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":38}}, "key": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 30 - }, - "identifierName": "y" - }, + "start":37,"end":38,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":30},"identifierName":"y"}, "name": "y" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 38, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":38,"end":46,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":38}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 40, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 32 - }, - "end": { - "line": 2, - "column": 38 - } - } + "start":40,"end":46,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":38}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/declare/destructure/output.json b/packages/babel-parser/test/fixtures/typescript/declare/destructure/output.json index 211767c304..32c2b66597 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/destructure/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/destructure/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "program": { "type": "Program", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 49 - } - }, + "start":0,"end":49,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":49}}, "declarations": [ { "type": "VariableDeclarator", - "start": 14, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":14,"end":48,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":48}}, "id": { "type": "ObjectPattern", - "start": 14, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":14,"end":48,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":48}}, "properties": [ { "type": "ObjectProperty", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "method": false, "key": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "x" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"x"}, "name": "x" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "x" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"x"}, "name": "x" }, "extra": { @@ -130,53 +40,18 @@ }, { "type": "ObjectProperty", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "y" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"y"}, "name": "y" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "y" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"y"}, "name": "y" }, "extra": { @@ -186,156 +61,44 @@ ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 22, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":22,"end":48,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":48}}, "typeAnnotation": { "type": "TSTypeLiteral", - "start": 24, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":24,"end":48,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":48}}, "members": [ { "type": "TSPropertySignature", - "start": 26, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":26,"end":36,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":36}}, "key": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "x" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"x"}, "name": "x" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 27, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":27,"end":35,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":35}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":29,"end":35,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":35}} } } }, { "type": "TSPropertySignature", - "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}}, "key": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "y" - }, + "start":37,"end":38,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":38},"identifierName":"y"}, "name": "y" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 38, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 46 - } - }, + "start":38,"end":46,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":46}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 40, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 46 - } - } + "start":40,"end":46,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":46}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/declare/interface-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/declare/interface-new-line/output.json index 249423eab4..5dfedc4e3e 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/interface-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/interface-new-line/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "declare" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"declare"}, "name": "declare" } }, { "type": "TSInterfaceDeclaration", - "start": 8, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":8,"end":22,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "I" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":20,"end":22,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/declare/interface/output.json b/packages/babel-parser/test/fixtures/typescript/declare/interface/output.json index 43242a7a2d..421694881a 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/interface/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/interface/output.json @@ -1,79 +1,23 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "I" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [] }, "declare": true diff --git a/packages/babel-parser/test/fixtures/typescript/declare/let-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/declare/let-new-line/output.json index 2b7786be2c..a5b611f659 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/let-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/let-new-line/output.json @@ -1,110 +1,31 @@ { "type": "File", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "declare" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"declare"}, "name": "declare" } }, { "type": "VariableDeclaration", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":8,"end":14,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "declarations": [ { "type": "VariableDeclarator", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"x"}, "name": "x" }, "init": null diff --git a/packages/babel-parser/test/fixtures/typescript/declare/let/output.json b/packages/babel-parser/test/fixtures/typescript/declare/let/output.json index 1091cd7434..8fe433755c 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/let/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/let/output.json @@ -1,78 +1,22 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" }, "init": null diff --git a/packages/babel-parser/test/fixtures/typescript/declare/var-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/declare/var-new-line/output.json index 63eaea000f..89a3f765cb 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/var-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/var-new-line/output.json @@ -1,110 +1,31 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":11}}, "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":11}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "declare" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"declare"}, "name": "declare" } }, { "type": "VariableDeclaration", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":8,"end":14,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "declarations": [ { "type": "VariableDeclarator", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"x"}, "name": "x" }, "init": null @@ -114,109 +35,30 @@ }, { "type": "ExpressionStatement", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 7 - } - }, + "start":16,"end":23,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":7}}, "expression": { "type": "Identifier", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "declare" - }, + "start":16,"end":23,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":7},"identifierName":"declare"}, "name": "declare" } }, { "type": "VariableDeclaration", - "start": 24, - "end": 35, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 11 - } - }, + "start":24,"end":35,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":11}}, "declarations": [ { "type": "VariableDeclarator", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":28,"end":34,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":10}}, "id": { "type": "Identifier", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 10 - }, - "identifierName": "x" - }, + "start":28,"end":34,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":10},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 29, - "end": 34, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 10 - } - }, + "start":29,"end":34,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":10}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 10 - } - } + "start":31,"end":34,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":10}} } } }, diff --git a/packages/babel-parser/test/fixtures/typescript/declare/var/output.json b/packages/babel-parser/test/fixtures/typescript/declare/var/output.json index e8db08d8f7..4a0415750e 100644 --- a/packages/babel-parser/test/fixtures/typescript/declare/var/output.json +++ b/packages/babel-parser/test/fixtures/typescript/declare/var/output.json @@ -1,78 +1,22 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "x" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"x"}, "name": "x" }, "init": null @@ -83,77 +27,21 @@ }, { "type": "VariableDeclaration", - "start": 15, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":15,"end":34,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":27,"end":33,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "x" - }, + "start":27,"end":33,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":18},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":28,"end":33,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":18}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - } - } + "start":30,"end":33,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}} } } }, diff --git a/packages/babel-parser/test/fixtures/typescript/decorators/type-arguments/output.json b/packages/babel-parser/test/fixtures/typescript/decorators/type-arguments/output.json index 91add31ed1..f546aad369 100644 --- a/packages/babel-parser/test/fixtures/typescript/decorators/type-arguments/output.json +++ b/packages/babel-parser/test/fixtures/typescript/decorators/type-arguments/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "decorators": [ { "type": "Decorator", - "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}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":1,"end":20,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":20}}, "callee": { "type": "Identifier", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "decorator" - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10},"identifierName":"decorator"}, "name": "decorator" }, "arguments": [], "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":10,"end":18,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":18}}, "params": [ { "type": "TSStringKeyword", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}} } ] } @@ -127,36 +38,13 @@ ], "id": { "type": "Identifier", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "Test" - }, + "start":27,"end":31,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":10},"identifierName":"Test"}, "name": "Test" }, "superClass": null, "body": { "type": "ClassBody", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":32,"end":34,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/enum/const/output.json b/packages/babel-parser/test/fixtures/typescript/enum/const/output.json index 78500087ba..ba0a6fb31c 100644 --- a/packages/babel-parser/test/fixtures/typescript/enum/const/output.json +++ b/packages/babel-parser/test/fixtures/typescript/enum/const/output.json @@ -1,64 +1,19 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "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}}, "const": true, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "E" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"E"}, "name": "E" }, "members": [] diff --git a/packages/babel-parser/test/fixtures/typescript/enum/declare-const/output.json b/packages/babel-parser/test/fixtures/typescript/enum/declare-const/output.json index 1218597f4b..795afe3cba 100644 --- a/packages/babel-parser/test/fixtures/typescript/enum/declare-const/output.json +++ b/packages/babel-parser/test/fixtures/typescript/enum/declare-const/output.json @@ -1,64 +1,19 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "const": true, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "E" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"E"}, "name": "E" }, "members": [], diff --git a/packages/babel-parser/test/fixtures/typescript/enum/declare/output.json b/packages/babel-parser/test/fixtures/typescript/enum/declare/output.json index a4bb0b3edc..f3af45c42a 100644 --- a/packages/babel-parser/test/fixtures/typescript/enum/declare/output.json +++ b/packages/babel-parser/test/fixtures/typescript/enum/declare/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "E" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"E"}, "name": "E" }, "members": [], diff --git a/packages/babel-parser/test/fixtures/typescript/enum/export-const/output.json b/packages/babel-parser/test/fixtures/typescript/enum/export-const/output.json index f0db16702d..f9ee00cb00 100644 --- a/packages/babel-parser/test/fixtures/typescript/enum/export-const/output.json +++ b/packages/babel-parser/test/fixtures/typescript/enum/export-const/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "TSEnumDeclaration", - "start": 7, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":7,"end":22,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":22}}, "const": true, "id": { "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" }, "members": [] diff --git a/packages/babel-parser/test/fixtures/typescript/enum/export-declare-const/output.json b/packages/babel-parser/test/fixtures/typescript/enum/export-declare-const/output.json index 1e2557b5aa..cf57b38725 100644 --- a/packages/babel-parser/test/fixtures/typescript/enum/export-declare-const/output.json +++ b/packages/babel-parser/test/fixtures/typescript/enum/export-declare-const/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSEnumDeclaration", - "start": 7, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":7,"end":30,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":30}}, "const": true, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "E" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"E"}, "name": "E" }, "members": [], diff --git a/packages/babel-parser/test/fixtures/typescript/enum/export/output.json b/packages/babel-parser/test/fixtures/typescript/enum/export/output.json index 883c7397ec..222becba7a 100644 --- a/packages/babel-parser/test/fixtures/typescript/enum/export/output.json +++ b/packages/babel-parser/test/fixtures/typescript/enum/export/output.json @@ -1,80 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "TSEnumDeclaration", - "start": 7, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":7,"end":16,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":16}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "E" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"E"}, "name": "E" }, "members": [] diff --git a/packages/babel-parser/test/fixtures/typescript/enum/members-reserved-words/output.json b/packages/babel-parser/test/fixtures/typescript/enum/members-reserved-words/output.json index 4852ee8f37..013c08b407 100644 --- a/packages/babel-parser/test/fixtures/typescript/enum/members-reserved-words/output.json +++ b/packages/babel-parser/test/fixtures/typescript/enum/members-reserved-words/output.json @@ -1,127 +1,36 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "members": [ { "type": "TSEnumMember", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":13,"end":18,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "const" - }, + "start":13,"end":18,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9},"identifierName":"const"}, "name": "const" } }, { "type": "TSEnumMember", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":24,"end":31,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 24, - "end": 31, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "default" - }, + "start":24,"end":31,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":11},"identifierName":"default"}, "name": "default" } } diff --git a/packages/babel-parser/test/fixtures/typescript/enum/members-strings/output.json b/packages/babel-parser/test/fixtures/typescript/enum/members-strings/output.json index bdf96d5170..9a9bfcb623 100644 --- a/packages/babel-parser/test/fixtures/typescript/enum/members-strings/output.json +++ b/packages/babel-parser/test/fixtures/typescript/enum/members-strings/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "members": [ { "type": "TSEnumMember", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":13,"end":18,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9}}, "id": { "type": "StringLiteral", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":13,"end":18,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" @@ -98,32 +31,10 @@ }, { "type": "TSEnumMember", - "start": 24, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":24,"end":33,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":13}}, "id": { "type": "StringLiteral", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":24,"end":29,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":9}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" @@ -132,18 +43,7 @@ }, "initializer": { "type": "NumericLiteral", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":32,"end":33,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":13}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/typescript/enum/members-trailing-comma-with-initializer/output.json b/packages/babel-parser/test/fixtures/typescript/enum/members-trailing-comma-with-initializer/output.json index edde64d013..fc12e3e8f9 100644 --- a/packages/babel-parser/test/fixtures/typescript/enum/members-trailing-comma-with-initializer/output.json +++ b/packages/babel-parser/test/fixtures/typescript/enum/members-trailing-comma-with-initializer/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "members": [ { "type": "TSEnumMember", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":13,"end":18,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "A" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"A"}, "name": "A" }, "initializer": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":9}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/typescript/enum/members-trailing-comma/output.json b/packages/babel-parser/test/fixtures/typescript/enum/members-trailing-comma/output.json index 946d73d08b..b61f1c0a07 100644 --- a/packages/babel-parser/test/fixtures/typescript/enum/members-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/typescript/enum/members-trailing-comma/output.json @@ -1,95 +1,27 @@ { "type": "File", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "start": 0, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":17,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "members": [ { "type": "TSEnumMember", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "A" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"A"}, "name": "A" } } diff --git a/packages/babel-parser/test/fixtures/typescript/enum/members/output.json b/packages/babel-parser/test/fixtures/typescript/enum/members/output.json index a3e00ac10b..7ff47b34b6 100644 --- a/packages/babel-parser/test/fixtures/typescript/enum/members/output.json +++ b/packages/babel-parser/test/fixtures/typescript/enum/members/output.json @@ -1,143 +1,41 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "E" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"E"}, "name": "E" }, "members": [ { "type": "TSEnumMember", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "A" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"A"}, "name": "A" } }, { "type": "TSEnumMember", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":20,"end":25,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":9}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "B" - }, + "start":20,"end":21,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"B"}, "name": "B" }, "initializer": { "type": "NumericLiteral", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 9 - } - }, + "start":24,"end":25,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":9}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/typescript/estree-compat/shorthand-ambient-module/output.json b/packages/babel-parser/test/fixtures/typescript/estree-compat/shorthand-ambient-module/output.json index 7f7db6c4b6..543538f7a1 100644 --- a/packages/babel-parser/test/fixtures/typescript/estree-compat/shorthand-ambient-module/output.json +++ b/packages/babel-parser/test/fixtures/typescript/estree-compat/shorthand-ambient-module/output.json @@ -1,62 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSModuleDeclaration", - "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}}, "id": { "type": "Literal", - "start": 15, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":15,"end":31,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":31}}, "value": "hot-new-module", "raw": "\"hot-new-module\"" }, diff --git a/packages/babel-parser/test/fixtures/typescript/export/as-namespace/output.json b/packages/babel-parser/test/fixtures/typescript/export/as-namespace/output.json index 5b77e5a9e2..c4249303c1 100644 --- a/packages/babel-parser/test/fixtures/typescript/export/as-namespace/output.json +++ b/packages/babel-parser/test/fixtures/typescript/export/as-namespace/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSNamespaceExportDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "A" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"A"}, "name": "A" } } diff --git a/packages/babel-parser/test/fixtures/typescript/export/declare/output.json b/packages/babel-parser/test/fixtures/typescript/export/declare/output.json index 43acb3b77b..bba4bdacb9 100644 --- a/packages/babel-parser/test/fixtures/typescript/export/declare/output.json +++ b/packages/babel-parser/test/fixtures/typescript/export/declare/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 238, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 26 - } - }, + "start":0,"end":238,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 238, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 26 - } - }, + "start":0,"end":238,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":7,"end":31,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":31}}, "declarations": [ { "type": "VariableDeclarator", - "start": 21, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":21,"end":30,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":30}}, "id": { "type": "Identifier", - "start": 21, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "x" - }, + "start":21,"end":30,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":30},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 22, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":22,"end":30,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":30}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}} } } }, @@ -131,50 +42,16 @@ }, { "type": "ExportNamedDeclaration", - "start": 32, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":32,"end":66,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSDeclareFunction", - "start": 39, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":39,"end":66,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":34}}, "id": { "type": "Identifier", - "start": 56, - "end": 57, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 25 - }, - "identifierName": "f" - }, + "start":56,"end":57,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":25},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -182,32 +59,10 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 59, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":59,"end":65,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":33}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 61, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 33 - } - } + "start":61,"end":65,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":33}} } }, "declare": true @@ -215,67 +70,22 @@ }, { "type": "ExportNamedDeclaration", - "start": 67, - "end": 92, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":67,"end":92,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":25}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "ClassDeclaration", - "start": 74, - "end": 92, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":74,"end":92,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":25}}, "id": { "type": "Identifier", - "start": 88, - "end": 89, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 22 - }, - "identifierName": "C" - }, + "start":88,"end":89,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":22},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 90, - "end": 92, - "loc": { - "start": { - "line": 3, - "column": 23 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":90,"end":92,"loc":{"start":{"line":3,"column":23},"end":{"line":3,"column":25}}, "body": [] }, "declare": true @@ -283,66 +93,21 @@ }, { "type": "ExportNamedDeclaration", - "start": 93, - "end": 122, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":93,"end":122,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":29}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSInterfaceDeclaration", - "start": 100, - "end": 122, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":100,"end":122,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":29}}, "id": { "type": "Identifier", - "start": 118, - "end": 119, - "loc": { - "start": { - "line": 4, - "column": 25 - }, - "end": { - "line": 4, - "column": 26 - }, - "identifierName": "I" - }, + "start":118,"end":119,"loc":{"start":{"line":4,"column":25},"end":{"line":4,"column":26},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 120, - "end": 122, - "loc": { - "start": { - "line": 4, - "column": 27 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":120,"end":122,"loc":{"start":{"line":4,"column":27},"end":{"line":4,"column":29}}, "body": [] }, "declare": true @@ -350,132 +115,42 @@ }, { "type": "ExportNamedDeclaration", - "start": 123, - "end": 154, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 31 - } - }, + "start":123,"end":154,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":31}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSTypeAliasDeclaration", - "start": 130, - "end": 154, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 31 - } - }, + "start":130,"end":154,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":31}}, "id": { "type": "Identifier", - "start": 143, - "end": 144, - "loc": { - "start": { - "line": 5, - "column": 20 - }, - "end": { - "line": 5, - "column": 21 - }, - "identifierName": "T" - }, + "start":143,"end":144,"loc":{"start":{"line":5,"column":20},"end":{"line":5,"column":21},"identifierName":"T"}, "name": "T" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 147, - "end": 153, - "loc": { - "start": { - "line": 5, - "column": 24 - }, - "end": { - "line": 5, - "column": 30 - } - } + "start":147,"end":153,"loc":{"start":{"line":5,"column":24},"end":{"line":5,"column":30}} }, "declare": true } }, { "type": "ExportNamedDeclaration", - "start": 155, - "end": 181, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 26 - } - }, + "start":155,"end":181,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":26}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSModuleDeclaration", - "start": 162, - "end": 181, - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 26 - } - }, + "start":162,"end":181,"loc":{"start":{"line":6,"column":7},"end":{"line":6,"column":26}}, "id": { "type": "Identifier", - "start": 177, - "end": 178, - "loc": { - "start": { - "line": 6, - "column": 22 - }, - "end": { - "line": 6, - "column": 23 - }, - "identifierName": "M" - }, + "start":177,"end":178,"loc":{"start":{"line":6,"column":22},"end":{"line":6,"column":23},"identifierName":"M"}, "name": "M" }, "body": { "type": "TSModuleBlock", - "start": 179, - "end": 181, - "loc": { - "start": { - "line": 6, - "column": 24 - }, - "end": { - "line": 6, - "column": 26 - } - }, + "start":179,"end":181,"loc":{"start":{"line":6,"column":24},"end":{"line":6,"column":26}}, "body": [] }, "declare": true @@ -483,66 +158,21 @@ }, { "type": "ExportNamedDeclaration", - "start": 182, - "end": 211, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 29 - } - }, + "start":182,"end":211,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":29}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSModuleDeclaration", - "start": 189, - "end": 211, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 29 - } - }, + "start":189,"end":211,"loc":{"start":{"line":7,"column":7},"end":{"line":7,"column":29}}, "id": { "type": "Identifier", - "start": 207, - "end": 208, - "loc": { - "start": { - "line": 7, - "column": 25 - }, - "end": { - "line": 7, - "column": 26 - }, - "identifierName": "N" - }, + "start":207,"end":208,"loc":{"start":{"line":7,"column":25},"end":{"line":7,"column":26},"identifierName":"N"}, "name": "N" }, "body": { "type": "TSModuleBlock", - "start": 209, - "end": 211, - "loc": { - "start": { - "line": 7, - "column": 27 - }, - "end": { - "line": 7, - "column": 29 - } - }, + "start":209,"end":211,"loc":{"start":{"line":7,"column":27},"end":{"line":7,"column":29}}, "body": [] }, "declare": true @@ -550,50 +180,16 @@ }, { "type": "ExportNamedDeclaration", - "start": 212, - "end": 238, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 26 - } - }, + "start":212,"end":238,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":26}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSEnumDeclaration", - "start": 219, - "end": 238, - "loc": { - "start": { - "line": 8, - "column": 7 - }, - "end": { - "line": 8, - "column": 26 - } - }, + "start":219,"end":238,"loc":{"start":{"line":8,"column":7},"end":{"line":8,"column":26}}, "id": { "type": "Identifier", - "start": 232, - "end": 235, - "loc": { - "start": { - "line": 8, - "column": 20 - }, - "end": { - "line": 8, - "column": 23 - }, - "identifierName": "foo" - }, + "start":232,"end":235,"loc":{"start":{"line":8,"column":20},"end":{"line":8,"column":23},"identifierName":"foo"}, "name": "foo" }, "members": [], diff --git a/packages/babel-parser/test/fixtures/typescript/export/equals/output.json b/packages/babel-parser/test/fixtures/typescript/export/equals/output.json index 8d7021f0ca..653d3c6888 100644 --- a/packages/babel-parser/test/fixtures/typescript/export/equals/output.json +++ b/packages/babel-parser/test/fixtures/typescript/export/equals/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSExportAssignment", - "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}}, "expression": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" } } diff --git a/packages/babel-parser/test/fixtures/typescript/export/export-type-declaration/output.json b/packages/babel-parser/test/fixtures/typescript/export/export-type-declaration/output.json index 1b6039be15..47da0131e9 100644 --- a/packages/babel-parser/test/fixtures/typescript/export/export-type-declaration/output.json +++ b/packages/babel-parser/test/fixtures/typescript/export/export-type-declaration/output.json @@ -1,110 +1,32 @@ { "type": "File", - "start": 0, - "end": 107, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":0,"end":107,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":29}}, "program": { "type": "Program", - "start": 0, - "end": 107, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":0,"end":107,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":29}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSTypeAliasDeclaration", - "start": 7, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":7,"end":18,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "A" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"A"}, "name": "A" }, "typeAnnotation": { "type": "TSLiteralType", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "literal": { "type": "NumericLiteral", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17}}, "extra": { "rawValue": 2, "raw": "2" @@ -116,116 +38,37 @@ }, { "type": "ExportNamedDeclaration", - "start": 19, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":19,"end":40,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":21}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSInterfaceDeclaration", - "start": 26, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":26,"end":40,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":21}}, "id": { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "B" - }, + "start":36,"end":37,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"B"}, "name": "B" }, "body": { "type": "TSInterfaceBody", - "start": 38, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":38,"end":40,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":21}}, "body": [] } } }, { "type": "ExportNamedDeclaration", - "start": 41, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":41,"end":77,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":36}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSDeclareFunction", - "start": 48, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":48,"end":77,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":36}}, "id": { "type": "Identifier", - "start": 65, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 25 - }, - "identifierName": "a" - }, + "start":65,"end":66,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":25},"identifierName":"a"}, "name": "a" }, "generator": false, @@ -233,32 +76,10 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 68, - "end": 76, - "loc": { - "start": { - "line": 3, - "column": 27 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":68,"end":76,"loc":{"start":{"line":3,"column":27},"end":{"line":3,"column":35}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 70, - "end": 76, - "loc": { - "start": { - "line": 3, - "column": 29 - }, - "end": { - "line": 3, - "column": 35 - } - } + "start":70,"end":76,"loc":{"start":{"line":3,"column":29},"end":{"line":3,"column":35}} } }, "declare": true @@ -266,94 +87,27 @@ }, { "type": "ExportNamedDeclaration", - "start": 78, - "end": 107, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":78,"end":107,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":29}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 85, - "end": 107, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 29 - } - }, + "start":85,"end":107,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":29}}, "declarations": [ { "type": "VariableDeclarator", - "start": 97, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 28 - } - }, + "start":97,"end":106,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":28}}, "id": { "type": "Identifier", - "start": 97, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 19 - }, - "end": { - "line": 4, - "column": 28 - }, - "identifierName": "b" - }, + "start":97,"end":106,"loc":{"start":{"line":4,"column":19},"end":{"line":4,"column":28},"identifierName":"b"}, "name": "b", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 98, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 20 - }, - "end": { - "line": 4, - "column": 28 - } - }, + "start":98,"end":106,"loc":{"start":{"line":4,"column":20},"end":{"line":4,"column":28}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 100, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 22 - }, - "end": { - "line": 4, - "column": 28 - } - } + "start":100,"end":106,"loc":{"start":{"line":4,"column":22},"end":{"line":4,"column":28}} } } }, diff --git a/packages/babel-parser/test/fixtures/typescript/export/export-type-from/output.json b/packages/babel-parser/test/fixtures/typescript/export/export-type-from/output.json index ce157bf4f0..e8399c3863 100644 --- a/packages/babel-parser/test/fixtures/typescript/export/export-type-from/output.json +++ b/packages/babel-parser/test/fixtures/typescript/export/export-type-from/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "exportKind": "type", "specifiers": [ { "type": "ExportSpecifier", - "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}}, "local": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "T" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"T"}, "name": "T" }, "exported": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "T" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"T"}, "name": "T" } } ], "source": { "type": "StringLiteral", - "start": 23, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":23,"end":30,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":30}}, "extra": { "rawValue": "./mod", "raw": "'./mod'" diff --git a/packages/babel-parser/test/fixtures/typescript/export/export-type/output.json b/packages/babel-parser/test/fixtures/typescript/export/export-type/output.json index 5148520274..5c1d6a9647 100644 --- a/packages/babel-parser/test/fixtures/typescript/export/export-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/export/export-type/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeAnnotation": { "type": "TSLiteralType", - "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}}, "literal": { "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": 2, "raw": "2" @@ -98,66 +31,20 @@ }, { "type": "ExportNamedDeclaration", - "start": 12, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":12,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "exportKind": "type", "specifiers": [ { "type": "ExportSpecifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "local": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "A" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"A"}, "name": "A" }, "exported": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "A" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"A"}, "name": "A" } } diff --git a/packages/babel-parser/test/fixtures/typescript/export/export-value-declaration/output.json b/packages/babel-parser/test/fixtures/typescript/export/export-value-declaration/output.json index 9d7eae1f64..ef037867a2 100644 --- a/packages/babel-parser/test/fixtures/typescript/export/export-value-declaration/output.json +++ b/packages/babel-parser/test/fixtures/typescript/export/export-value-declaration/output.json @@ -1,95 +1,28 @@ { "type": "File", - "start": 0, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 21 - } - }, + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":21}}, "program": { "type": "Program", - "start": 0, - "end": 94, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 21 - } - }, + "start":0,"end":94,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":21}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "declarations": [ { "type": "VariableDeclarator", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "a" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"a"}, "name": "a" }, "init": null @@ -100,50 +33,16 @@ }, { "type": "ExportNamedDeclaration", - "start": 14, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":14,"end":36,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":22}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "FunctionDeclaration", - "start": 21, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":21,"end":36,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":22}}, "id": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "b" - }, + "start":30,"end":31,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"b"}, "name": "b" }, "generator": false, @@ -151,18 +50,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":34,"end":36,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":22}}, "body": [], "directives": [] } @@ -170,117 +58,38 @@ }, { "type": "ExportNamedDeclaration", - "start": 37, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":37,"end":54,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":17}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "ClassDeclaration", - "start": 44, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":44,"end":54,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":17}}, "id": { "type": "Identifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 14 - }, - "identifierName": "C" - }, + "start":50,"end":51,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":14},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 52, - "end": 54, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 17 - } - }, + "start":52,"end":54,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":17}}, "body": [] } } }, { "type": "ExportNamedDeclaration", - "start": 56, - "end": 72, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 16 - } - }, + "start":56,"end":72,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":16}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "TSEnumDeclaration", - "start": 63, - "end": 72, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 16 - } - }, + "start":63,"end":72,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":16}}, "id": { "type": "Identifier", - "start": 68, - "end": 69, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 13 - }, - "identifierName": "D" - }, + "start":68,"end":69,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":13},"identifierName":"D"}, "name": "D" }, "members": [] @@ -288,66 +97,21 @@ }, { "type": "ExportNamedDeclaration", - "start": 73, - "end": 94, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 21 - } - }, + "start":73,"end":94,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":21}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "TSModuleDeclaration", - "start": 80, - "end": 94, - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 21 - } - }, + "start":80,"end":94,"loc":{"start":{"line":6,"column":7},"end":{"line":6,"column":21}}, "id": { "type": "Identifier", - "start": 90, - "end": 91, - "loc": { - "start": { - "line": 6, - "column": 17 - }, - "end": { - "line": 6, - "column": 18 - }, - "identifierName": "E" - }, + "start":90,"end":91,"loc":{"start":{"line":6,"column":17},"end":{"line":6,"column":18},"identifierName":"E"}, "name": "E" }, "body": { "type": "TSModuleBlock", - "start": 92, - "end": 94, - "loc": { - "start": { - "line": 6, - "column": 19 - }, - "end": { - "line": 6, - "column": 21 - } - }, + "start":92,"end":94,"loc":{"start":{"line":6,"column":19},"end":{"line":6,"column":21}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/export/nested-same-name/output.json b/packages/babel-parser/test/fixtures/typescript/export/nested-same-name/output.json index e687b30cab..663a8812ec 100644 --- a/packages/babel-parser/test/fixtures/typescript/export/nested-same-name/output.json +++ b/packages/babel-parser/test/fixtures/typescript/export/nested-same-name/output.json @@ -1,111 +1,33 @@ { "type": "File", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "declarations": [ { "type": "VariableDeclarator", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "x" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18}}, "extra": { "rawValue": 0, "raw": "0" @@ -119,144 +41,43 @@ }, { "type": "ExportNamedDeclaration", - "start": 20, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":20,"end":66,"loc":{"start":{"line":2,"column":0},"end":{"line":4,"column":1}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "TSModuleDeclaration", - "start": 27, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":27,"end":66,"loc":{"start":{"line":2,"column":7},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "N" - }, + "start":37,"end":38,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"N"}, "name": "N" }, "body": { "type": "TSModuleBlock", - "start": 39, - "end": 66, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":39,"end":66,"loc":{"start":{"line":2,"column":19},"end":{"line":4,"column":1}}, "body": [ { "type": "ExportNamedDeclaration", - "start": 45, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":45,"end":64,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":23}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 52, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":52,"end":64,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 58, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":58,"end":63,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":22}}, "id": { "type": "Identifier", - "start": 58, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 18 - }, - "identifierName": "x" - }, + "start":58,"end":59,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":18},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 62, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":62,"end":63,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":22}}, "extra": { "rawValue": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/typescript/function/annotated/output.json b/packages/babel-parser/test/fixtures/typescript/function/annotated/output.json index 20dcd3d6d8..6db63dafc2 100644 --- a/packages/babel-parser/test/fixtures/typescript/function/annotated/output.json +++ b/packages/babel-parser/test/fixtures/typescript/function/annotated/output.json @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, "async": false, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13}}, "params": [ { "type": "TSTypeParameter", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12}}, "name": "T" } ] @@ -98,64 +31,18 @@ "params": [ { "type": "Identifier", - "start": 14, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "x" - }, + "start":14,"end":19,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":19},"identifierName":"x"}, "name": "x", "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "typeName": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "T" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"T"}, "name": "T" } } @@ -164,65 +51,20 @@ ], "returnType": { "type": "TSTypeAnnotation", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23}}, "typeName": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "T" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"T"}, "name": "T" } } }, "body": { "type": "BlockStatement", - "start": 24, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":24,"end":26,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":26}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/function/anonymous/output.json b/packages/babel-parser/test/fixtures/typescript/function/anonymous/output.json index 562fb34850..ed420fce06 100644 --- a/packages/babel-parser/test/fixtures/typescript/function/anonymous/output.json +++ b/packages/babel-parser/test/fixtures/typescript/function/anonymous/output.json @@ -1,126 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":6,"end":34,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "f" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"f"}, "name": "f" }, "init": { "type": "FunctionExpression", - "start": 10, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":10,"end":34,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":34}}, "id": null, "generator": false, "async": false, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "params": [ { "type": "TSTypeParameter", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20}}, "name": "T" } ] @@ -128,64 +39,18 @@ "params": [ { "type": "Identifier", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "x" - }, + "start":22,"end":27,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":27},"identifierName":"x"}, "name": "x", "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 24, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":24,"end":27,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "TSTypeReference", - "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}}, "typeName": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "T" - }, + "start":26,"end":27,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":27},"identifierName":"T"}, "name": "T" } } @@ -194,65 +59,20 @@ ], "returnType": { "type": "TSTypeAnnotation", - "start": 28, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":28,"end":31,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":31}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31}}, "typeName": { "type": "Identifier", - "start": 30, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "T" - }, + "start":30,"end":31,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":31},"identifierName":"T"}, "name": "T" } } }, "body": { "type": "BlockStatement", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":32,"end":34,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":34}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/function/declare/output.json b/packages/babel-parser/test/fixtures/typescript/function/declare/output.json index 18554b17a5..edf987a014 100644 --- a/packages/babel-parser/test/fixtures/typescript/function/declare/output.json +++ b/packages/babel-parser/test/fixtures/typescript/function/declare/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSDeclareFunction", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "f" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,98 +20,31 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 22, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 26 - } - } + "start":22,"end":26,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":26}} } }, "declare": true }, { "type": "TSDeclareFunction", - "start": 28, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":28,"end":55,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}}, "id": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "f" - }, + "start":45,"end":46,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"f"}, "name": "f" }, "generator": false, "async": false, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 46, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":46,"end":49,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":21}}, "params": [ { "type": "TSTypeParameter", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":47,"end":48,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20}}, "name": "T" } ] @@ -164,47 +52,13 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 51, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":51,"end":54,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":26}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":53,"end":54,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":26}}, "typeName": { "type": "Identifier", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 26 - }, - "identifierName": "T" - }, + "start":53,"end":54,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":26},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/typescript/function/export-default/output.json b/packages/babel-parser/test/fixtures/typescript/function/export-default/output.json index 42c8c034dd..8aa516aeb7 100644 --- a/packages/babel-parser/test/fixtures/typescript/function/export-default/output.json +++ b/packages/babel-parser/test/fixtures/typescript/function/export-default/output.json @@ -1,144 +1,44 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportDefaultDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":42}}, "exportKind": "value", "declaration": { "type": "TSDeclareFunction", - "start": 15, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":15,"end":42,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":42}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 24, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "x" - }, + "start":24,"end":34,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":34},"identifierName":"x"}, "name": "x", "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 26, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":26,"end":34,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":34}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 34 - } - } + "start":28,"end":34,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":34}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":35,"end":41,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":41}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 37, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 41 - } - } + "start":37,"end":41,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":41}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/function/getter-setter/output.json b/packages/babel-parser/test/fixtures/typescript/function/getter-setter/output.json index ba424efc68..9e3783493f 100644 --- a/packages/babel-parser/test/fixtures/typescript/function/getter-setter/output.json +++ b/packages/babel-parser/test/fixtures/typescript/function/getter-setter/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":6,"end":34,"loc":{"start":{"line":1,"column":6},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "g" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"g"}, "name": "g" }, "init": { "type": "ObjectExpression", - "start": 10, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":10,"end":34,"loc":{"start":{"line":1,"column":10},"end":{"line":3,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 14, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":14,"end":32,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":20}}, "method": false, "key": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "m" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"m"}, "name": "m" }, "computed": false, @@ -130,48 +40,14 @@ "params": [ { "type": "Identifier", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "this" - }, + "start":20,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":16},"identifierName":"this"}, "name": "this", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":24,"end":28,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":16}}, "typeAnnotation": { "type": "TSTypeLiteral", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":26,"end":28,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":16}}, "members": [] } } @@ -179,18 +55,7 @@ ], "body": { "type": "BlockStatement", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":30,"end":32,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20}}, "body": [], "directives": [] } @@ -203,95 +68,27 @@ }, { "type": "VariableDeclaration", - "start": 36, - "end": 78, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 6, - "column": 2 - } - }, + "start":36,"end":78,"loc":{"start":{"line":4,"column":0},"end":{"line":6,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 42, - "end": 77, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":42,"end":77,"loc":{"start":{"line":4,"column":6},"end":{"line":6,"column":1}}, "id": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 7 - }, - "identifierName": "s" - }, + "start":42,"end":43,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":7},"identifierName":"s"}, "name": "s" }, "init": { "type": "ObjectExpression", - "start": 46, - "end": 77, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":46,"end":77,"loc":{"start":{"line":4,"column":10},"end":{"line":6,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 50, - "end": 75, - "loc": { - "start": { - "line": 5, - "column": 2 - }, - "end": { - "line": 5, - "column": 27 - } - }, + "start":50,"end":75,"loc":{"start":{"line":5,"column":2},"end":{"line":5,"column":27}}, "method": false, "key": { "type": "Identifier", - "start": 54, - "end": 55, - "loc": { - "start": { - "line": 5, - "column": 6 - }, - "end": { - "line": 5, - "column": 7 - }, - "identifierName": "m" - }, + "start":54,"end":55,"loc":{"start":{"line":5,"column":6},"end":{"line":5,"column":7},"identifierName":"m"}, "name": "m" }, "computed": false, @@ -302,84 +99,27 @@ "params": [ { "type": "Identifier", - "start": 56, - "end": 64, - "loc": { - "start": { - "line": 5, - "column": 8 - }, - "end": { - "line": 5, - "column": 16 - }, - "identifierName": "this" - }, + "start":56,"end":64,"loc":{"start":{"line":5,"column":8},"end":{"line":5,"column":16},"identifierName":"this"}, "name": "this", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 60, - "end": 64, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 16 - } - }, + "start":60,"end":64,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":16}}, "typeAnnotation": { "type": "TSTypeLiteral", - "start": 62, - "end": 64, - "loc": { - "start": { - "line": 5, - "column": 14 - }, - "end": { - "line": 5, - "column": 16 - } - }, + "start":62,"end":64,"loc":{"start":{"line":5,"column":14},"end":{"line":5,"column":16}}, "members": [] } } }, { "type": "Identifier", - "start": 66, - "end": 71, - "loc": { - "start": { - "line": 5, - "column": 18 - }, - "end": { - "line": 5, - "column": 23 - }, - "identifierName": "value" - }, + "start":66,"end":71,"loc":{"start":{"line":5,"column":18},"end":{"line":5,"column":23},"identifierName":"value"}, "name": "value" } ], "body": { "type": "BlockStatement", - "start": 73, - "end": 75, - "loc": { - "start": { - "line": 5, - "column": 25 - }, - "end": { - "line": 5, - "column": 27 - } - }, + "start":73,"end":75,"loc":{"start":{"line":5,"column":25},"end":{"line":5,"column":27}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/function/overloads/output.json b/packages/babel-parser/test/fixtures/typescript/function/overloads/output.json index 0ed87c620a..cfed1a795c 100644 --- a/packages/babel-parser/test/fixtures/typescript/function/overloads/output.json +++ b/packages/babel-parser/test/fixtures/typescript/function/overloads/output.json @@ -1,80 +1,24 @@ { "type": "File", - "start": 0, - "end": 75, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":0,"end":75,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":37}}, "program": { "type": "Program", - "start": 0, - "end": 75, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":0,"end":75,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":37}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "TSDeclareFunction", - "start": 7, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":7,"end":37,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "f" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -82,130 +26,40 @@ "params": [ { "type": "Identifier", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "x" - }, + "start":18,"end":27,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":27},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 28, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":28,"end":36,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":36}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 36 - } - } + "start":30,"end":36,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":36}} } } } }, { "type": "ExportNamedDeclaration", - "start": 38, - "end": 75, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":38,"end":75,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":37}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "TSDeclareFunction", - "start": 45, - "end": 75, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":45,"end":75,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":37}}, "id": { "type": "Identifier", - "start": 54, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "f" - }, + "start":54,"end":55,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -213,80 +67,24 @@ "params": [ { "type": "Identifier", - "start": 56, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 27 - }, - "identifierName": "x" - }, + "start":56,"end":65,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":27},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 57, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":57,"end":65,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":27}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 59, - "end": 65, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 27 - } - } + "start":59,"end":65,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":27}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 66, - "end": 74, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":66,"end":74,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":36}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 68, - "end": 74, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 36 - } - } + "start":68,"end":74,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":36}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/output.json b/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/output.json index 3ef0fdc07d..8472638da8 100644 --- a/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/output.json +++ b/packages/babel-parser/test/fixtures/typescript/function/pattern-parameters/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "errors": [ "SyntaxError: A binding pattern parameter cannot be optional in an implementation signature. (1:11)" ], "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -68,52 +23,19 @@ "params": [ { "type": "ArrayPattern", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "elements": [], "optional": true }, { "type": "ObjectPattern", - "start": 16, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":16,"end":18,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":18}}, "properties": [] } ], "body": { "type": "BlockStatement", - "start": 20, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":20,"end":22,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":22}}, "body": [], "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 90bae5b4ce..b834fb54eb 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":0,"end":71,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":35}}, "program": { "type": "Program", - "start": 0, - "end": 71, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":0,"end":71,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":35}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,318 +20,94 @@ "params": [ { "type": "Identifier", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "x" - }, + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 12, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":12,"end":17,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":18,"end":32,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":32}}, "parameterName": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "x" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"x"}, "name": "x" }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 25, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32}}, "typeAnnotation": { "type": "TSBooleanKeyword", - "start": 25, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 32 - } - } + "start":25,"end":32,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":32}} } } } }, "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 35 - } - }, + "start":33,"end":35,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":35}}, "body": [], "directives": [] } }, { "type": "ExpressionStatement", - "start": 36, - "end": 71, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 35 - } - }, + "start":36,"end":71,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":35}}, "expression": { "type": "FunctionExpression", - "start": 37, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":37,"end":70,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":34}}, "id": null, "generator": false, "async": false, "params": [ { "type": "Identifier", - "start": 46, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "x" - }, + "start":46,"end":52,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":16},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 47, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":47,"end":52,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":16}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 49, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - } - } + "start":49,"end":52,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16}} } } } ], "returnType": { "type": "TSTypeAnnotation", - "start": 53, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":53,"end":67,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":31}}, "typeAnnotation": { "type": "TSTypePredicate", - "start": 53, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":53,"end":67,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":31}}, "parameterName": { "type": "Identifier", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "x" - }, + "start":55,"end":56,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":20},"identifierName":"x"}, "name": "x" }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 60, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":60,"end":67,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":31}}, "typeAnnotation": { "type": "TSBooleanKeyword", - "start": 60, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 31 - } - } + "start":60,"end":67,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":31}} } } } }, "body": { "type": "BlockStatement", - "start": 68, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 32 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":68,"end":70,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":34}}, "body": [], "directives": [] }, diff --git a/packages/babel-parser/test/fixtures/typescript/import/equals-require/output.json b/packages/babel-parser/test/fixtures/typescript/import/equals-require/output.json index cc6ca197d7..a0d01df372 100644 --- a/packages/babel-parser/test/fixtures/typescript/import/equals-require/output.json +++ b/packages/babel-parser/test/fixtures/typescript/import/equals-require/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSImportEqualsDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "isExport": false, "id": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, "moduleReference": { "type": "TSExternalModuleReference", - "start": 11, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":11,"end":23,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":23}}, "expression": { "type": "StringLiteral", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, "extra": { "rawValue": "a", "raw": "\"a\"" diff --git a/packages/babel-parser/test/fixtures/typescript/import/equals/output.json b/packages/babel-parser/test/fixtures/typescript/import/equals/output.json index 4ced84dace..956c79da82 100644 --- a/packages/babel-parser/test/fixtures/typescript/import/equals/output.json +++ b/packages/babel-parser/test/fixtures/typescript/import/equals/output.json @@ -1,112 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSImportEqualsDeclaration", - "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}}, "isExport": false, "id": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "A" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"A"}, "name": "A" }, "moduleReference": { "type": "TSQualifiedName", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14}}, "left": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "B" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"B"}, "name": "B" }, "right": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "C" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"C"}, "name": "C" } } diff --git a/packages/babel-parser/test/fixtures/typescript/import/export-import-require/output.json b/packages/babel-parser/test/fixtures/typescript/import/export-import-require/output.json index 03e8106d81..0c26c566c6 100644 --- a/packages/babel-parser/test/fixtures/typescript/import/export-import-require/output.json +++ b/packages/babel-parser/test/fixtures/typescript/import/export-import-require/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSImportEqualsDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":31}}, "isExport": true, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "a" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"a"}, "name": "a" }, "moduleReference": { "type": "TSExternalModuleReference", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":18,"end":30,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":30}}, "expression": { "type": "StringLiteral", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29}}, "extra": { "rawValue": "a", "raw": "\"a\"" diff --git a/packages/babel-parser/test/fixtures/typescript/import/export-import/output.json b/packages/babel-parser/test/fixtures/typescript/import/export-import/output.json index 0620bc35a3..e35c550f8a 100644 --- a/packages/babel-parser/test/fixtures/typescript/import/export-import/output.json +++ b/packages/babel-parser/test/fixtures/typescript/import/export-import/output.json @@ -1,112 +1,32 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSImportEqualsDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "isExport": true, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "A" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"A"}, "name": "A" }, "moduleReference": { "type": "TSQualifiedName", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":21}}, "left": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "B" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"B"}, "name": "B" }, "right": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "C" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"C"}, "name": "C" } } diff --git a/packages/babel-parser/test/fixtures/typescript/import/export-named-import-require/output.json b/packages/babel-parser/test/fixtures/typescript/import/export-named-import-require/output.json index e69632d570..adc29a8ab4 100644 --- a/packages/babel-parser/test/fixtures/typescript/import/export-named-import-require/output.json +++ b/packages/babel-parser/test/fixtures/typescript/import/export-named-import-require/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSImportEqualsDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "isExport": false, "id": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "a" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"a"}, "name": "a" }, "moduleReference": { "type": "TSExternalModuleReference", - "start": 11, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":11,"end":23,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":23}}, "expression": { "type": "StringLiteral", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, "extra": { "rawValue": "a", "raw": "\"a\"" @@ -99,66 +32,20 @@ }, { "type": "ExportNamedDeclaration", - "start": 25, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":25,"end":38,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "exportKind": "value", "specifiers": [ { "type": "ExportSpecifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":34,"end":35,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "local": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "a" - }, + "start":34,"end":35,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"a"}, "name": "a" }, "exported": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "a" - }, + "start":34,"end":35,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"a"}, "name": "a" } } diff --git a/packages/babel-parser/test/fixtures/typescript/import/import-default-and-named-id-type/output.json b/packages/babel-parser/test/fixtures/typescript/import/import-default-and-named-id-type/output.json index 1140ce07c2..b91fcd5078 100644 --- a/packages/babel-parser/test/fixtures/typescript/import/import-default-and-named-id-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/import/import-default-and-named-id-type/output.json @@ -1,146 +1,44 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "importKind": "value", "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "local": { "type": "Identifier", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "type" - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11},"identifierName":"type"}, "name": "type" } }, { "type": "ImportSpecifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "imported": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "bar" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"bar"}, "name": "bar" }, "local": { "type": "Identifier", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "bar" - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18},"identifierName":"bar"}, "name": "bar" } } ], "source": { "type": "StringLiteral", - "start": 26, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":26,"end":31,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":31}}, "extra": { "rawValue": "foo", "raw": "'foo'" diff --git a/packages/babel-parser/test/fixtures/typescript/import/import-default-id-type/output.json b/packages/babel-parser/test/fixtures/typescript/import/import-default-id-type/output.json index a340498869..32c0a85958 100644 --- a/packages/babel-parser/test/fixtures/typescript/import/import-default-id-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/import/import-default-id-type/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "importKind": "value", "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "local": { "type": "Identifier", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "type" - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11},"identifierName":"type"}, "name": "type" } } ], "source": { "type": "StringLiteral", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "extra": { "rawValue": "foo", "raw": "'foo'" diff --git a/packages/babel-parser/test/fixtures/typescript/import/import-named/output.json b/packages/babel-parser/test/fixtures/typescript/import/import-named/output.json index cbad2bcfaa..4f82219721 100644 --- a/packages/babel-parser/test/fixtures/typescript/import/import-named/output.json +++ b/packages/babel-parser/test/fixtures/typescript/import/import-named/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "importKind": "value", "specifiers": [ { "type": "ImportSpecifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "imported": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "local": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" } } ], "source": { "type": "StringLiteral", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25}}, "extra": { "rawValue": "bar", "raw": "\"bar\"" diff --git a/packages/babel-parser/test/fixtures/typescript/import/import-star-as/output.json b/packages/babel-parser/test/fixtures/typescript/import/import-star-as/output.json index 3a27b871b8..c5eaa9021e 100644 --- a/packages/babel-parser/test/fixtures/typescript/import/import-star-as/output.json +++ b/packages/babel-parser/test/fixtures/typescript/import/import-star-as/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "importKind": "value", "specifiers": [ { "type": "ImportNamespaceSpecifier", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}}, "local": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "a" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"a"}, "name": "a" } } ], "source": { "type": "StringLiteral", - "start": 19, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":19,"end":22,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":22}}, "extra": { "rawValue": "a", "raw": "\"a\"" diff --git a/packages/babel-parser/test/fixtures/typescript/import/not-top-level/output.json b/packages/babel-parser/test/fixtures/typescript/import/not-top-level/output.json index 1a7dcef7a9..dd3c9e4ddd 100644 --- a/packages/babel-parser/test/fixtures/typescript/import/not-top-level/output.json +++ b/packages/babel-parser/test/fixtures/typescript/import/not-top-level/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSModuleDeclaration", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "extra": { "rawValue": "m", "raw": "\"m\"" @@ -65,82 +21,26 @@ }, "body": { "type": "TSModuleBlock", - "start": 19, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":19,"end":50,"loc":{"start":{"line":1,"column":19},"end":{"line":3,"column":1}}, "body": [ { "type": "ImportDeclaration", - "start": 25, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":25,"end":48,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":27}}, "importKind": "value", "specifiers": [ { "type": "ImportNamespaceSpecifier", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":32,"end":38,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":17}}, "local": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "a" - }, + "start":37,"end":38,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"a"}, "name": "a" } } ], "source": { "type": "StringLiteral", - "start": 44, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":44,"end":47,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":26}}, "extra": { "rawValue": "a", "raw": "\"a\"" diff --git a/packages/babel-parser/test/fixtures/typescript/interface/call-signature/output.json b/packages/babel-parser/test/fixtures/typescript/interface/call-signature/output.json index 66865baeaa..e08c41659e 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/call-signature/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/call-signature/output.json @@ -1,171 +1,48 @@ { "type": "File", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":38,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 12, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":38,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "body": [ { "type": "TSCallSignatureDeclaration", - "start": 18, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":18,"end":36,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":22}}, "parameters": [ { "type": "Identifier", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "x" - }, + "start":19,"end":28,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":14},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":20,"end":28,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":14}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - } - } + "start":22,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14}} } } } ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":29,"end":35,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":21}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 31, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 21 - } - } + "start":31,"end":35,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":21}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/construct-signature/output.json b/packages/babel-parser/test/fixtures/typescript/interface/construct-signature/output.json index d3902ee1e9..00ed1c2cc1 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/construct-signature/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/construct-signature/output.json @@ -1,171 +1,48 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 12, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":42,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "body": [ { "type": "TSConstructSignatureDeclaration", - "start": 18, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":18,"end":40,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":26}}, "parameters": [ { "type": "Identifier", - "start": 23, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "x" - }, + "start":23,"end":32,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":18},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":24,"end":32,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":18}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 18 - } - } + "start":26,"end":32,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":18}} } } } ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 19 - }, - "end": { - "line": 2, - "column": 25 - } - }, + "start":33,"end":39,"loc":{"start":{"line":2,"column":19},"end":{"line":2,"column":25}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 35, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 25 - } - } + "start":35,"end":39,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":25}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/export/output.json b/packages/babel-parser/test/fixtures/typescript/interface/export/output.json index f7fe8f0c03..d6b463c693 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/export/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/export/output.json @@ -1,160 +1,48 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":29}}, "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":29}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSInterfaceDeclaration", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "I" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":19,"end":21,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":21}}, "body": [] } } }, { "type": "ExportDefaultDeclaration", - "start": 22, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":22,"end":51,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":29}}, "exportKind": "value", "declaration": { "type": "TSInterfaceDeclaration", - "start": 37, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":37,"end":51,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":29}}, "id": { "type": "Identifier", - "start": 47, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 26 - }, - "identifierName": "A" - }, + "start":47,"end":48,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":26},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSInterfaceBody", - "start": 49, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":49,"end":51,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":29}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/extends/output.json b/packages/babel-parser/test/fixtures/typescript/interface/extends/output.json index f8891d5641..a01e69d56c 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/extends/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/extends/output.json @@ -1,173 +1,48 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "extends": [ { "type": "TSExpressionWithTypeArguments", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26}}, "expression": { "type": "TSQualifiedName", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":20,"end":23,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":23}}, "left": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "X" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"X"}, "name": "X" }, "right": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 23 - }, - "identifierName": "Y" - }, + "start":22,"end":23,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":23},"identifierName":"Y"}, "name": "Y" } }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":23,"end":26,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":26}}, "params": [ { "type": "TSTypeReference", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}}, "typeName": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "Z" - }, + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25},"identifierName":"Z"}, "name": "Z" } } @@ -177,18 +52,7 @@ ], "body": { "type": "TSInterfaceBody", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":27,"end":29,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":29}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/generic/output.json b/packages/babel-parser/test/fixtures/typescript/interface/generic/output.json index 5b09114bb2..7ab2f684e8 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/generic/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/generic/output.json @@ -1,185 +1,51 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 11, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":11,"end":45,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":45}}, "params": [ { "type": "TSTypeParameter", - "start": 12, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":12,"end":44,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":44}}, "name": "T", "constraint": { "type": "TSObjectKeyword", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":22,"end":28,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":28}} }, "default": { "type": "TSTypeLiteral", - "start": 31, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":31,"end":44,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":44}}, "members": [ { "type": "TSPropertySignature", - "start": 33, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":33,"end":42,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":42}}, "key": { "type": "Identifier", - "start": 33, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 33 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "x" - }, + "start":33,"end":34,"loc":{"start":{"line":1,"column":33},"end":{"line":1,"column":34},"identifierName":"x"}, "name": "x" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 34, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":34,"end":42,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":42}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 36, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 42 - } - } + "start":36,"end":42,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":42}} } } } @@ -190,18 +56,7 @@ }, "body": { "type": "TSInterfaceBody", - "start": 46, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":46,"end":48,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":48}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/index-signature/output.json b/packages/babel-parser/test/fixtures/typescript/interface/index-signature/output.json index 6a4a98afb5..f0c2997079 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/index-signature/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/index-signature/output.json @@ -1,171 +1,48 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 12, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":40,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "body": [ { "type": "TSIndexSignature", - "start": 18, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 24 - } - }, + "start":18,"end":38,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":24}}, "parameters": [ { "type": "Identifier", - "start": 19, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "s" - }, + "start":19,"end":28,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":14},"identifierName":"s"}, "name": "s", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":20,"end":28,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":14}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - } - } + "start":22,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14}} } } } ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 29, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":29,"end":37,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":23}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 23 - } - } + "start":31,"end":37,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":23}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/method-computed/output.json b/packages/babel-parser/test/fixtures/typescript/interface/method-computed/output.json index b9bc92ecb7..0546e0e21d 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/method-computed/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/method-computed/output.json @@ -1,141 +1,39 @@ { "type": "File", - "start": 0, - "end": 80, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":80,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 80, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":80,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 80, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":80,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 12, - "end": 80, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":12,"end":80,"loc":{"start":{"line":1,"column":12},"end":{"line":4,"column":1}}, "body": [ { "type": "TSMethodSignature", - "start": 18, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":18,"end":44,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":30}}, "computed": true, "key": { "type": "MemberExpression", - "start": 19, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":19,"end":34,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":20}}, "object": { "type": "Identifier", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "Symbol" - }, + "start":19,"end":25,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, "property": { "type": "Identifier", - "start": 26, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "iterator" - }, + "start":26,"end":34,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":20},"identifierName":"iterator"}, "name": "iterator" }, "computed": false @@ -143,96 +41,28 @@ "parameters": [], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":37,"end":43,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":29}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 39, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 29 - } - } + "start":39,"end":43,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":29}} } } }, { "type": "TSMethodSignature", - "start": 49, - "end": 78, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 33 - } - }, + "start":49,"end":78,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":33}}, "computed": true, "key": { "type": "MemberExpression", - "start": 50, - "end": 65, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":50,"end":65,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":20}}, "object": { "type": "Identifier", - "start": 50, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "Symbol" - }, + "start":50,"end":56,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, "property": { "type": "Identifier", - "start": 57, - "end": 65, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 20 - }, - "identifierName": "iterator" - }, + "start":57,"end":65,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":20},"identifierName":"iterator"}, "name": "iterator" }, "computed": false @@ -241,32 +71,10 @@ "parameters": [], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 69, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 32 - } - }, + "start":69,"end":77,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":32}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 71, - "end": 77, - "loc": { - "start": { - "line": 3, - "column": 26 - }, - "end": { - "line": 3, - "column": 32 - } - } + "start":71,"end":77,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":32}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/method-generic/output.json b/packages/babel-parser/test/fixtures/typescript/interface/method-generic/output.json index 37f707e8f8..dcd0be5cd3 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/method-generic/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/method-generic/output.json @@ -1,232 +1,64 @@ { "type": "File", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":61,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 12, - "end": 61, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":61,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "body": [ { "type": "TSMethodSignature", - "start": 18, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 45 - } - }, + "start":18,"end":59,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":45}}, "key": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "m" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"m"}, "name": "m" }, "computed": false, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 19, - "end": 53, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 39 - } - }, + "start":19,"end":53,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":39}}, "params": [ { "type": "TSTypeParameter", - "start": 20, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":20,"end":52,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":38}}, "name": "T", "constraint": { "type": "TSObjectKeyword", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 22 - } - } + "start":30,"end":36,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":22}} }, "default": { "type": "TSTypeLiteral", - "start": 39, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 25 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":39,"end":52,"loc":{"start":{"line":2,"column":25},"end":{"line":2,"column":38}}, "members": [ { "type": "TSPropertySignature", - "start": 41, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":41,"end":50,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":36}}, "key": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 28 - }, - "identifierName": "x" - }, + "start":41,"end":42,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":28},"identifierName":"x"}, "name": "x" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 42, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 36 - } - }, + "start":42,"end":50,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":36}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 44, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 36 - } - } + "start":44,"end":50,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":36}} } } } @@ -238,47 +70,13 @@ "parameters": [], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 55, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 41 - }, - "end": { - "line": 2, - "column": 44 - } - }, + "start":55,"end":58,"loc":{"start":{"line":2,"column":41},"end":{"line":2,"column":44}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 57, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 43 - }, - "end": { - "line": 2, - "column": 44 - } - }, + "start":57,"end":58,"loc":{"start":{"line":2,"column":43},"end":{"line":2,"column":44}}, "typeName": { "type": "Identifier", - "start": 57, - "end": 58, - "loc": { - "start": { - "line": 2, - "column": 43 - }, - "end": { - "line": 2, - "column": 44 - }, - "identifierName": "T" - }, + "start":57,"end":58,"loc":{"start":{"line":2,"column":43},"end":{"line":2,"column":44},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/method-optional/output.json b/packages/babel-parser/test/fixtures/typescript/interface/method-optional/output.json index fa745450cd..dfaf36169a 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/method-optional/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/method-optional/output.json @@ -1,109 +1,30 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 12, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":31,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "body": [ { "type": "TSMethodSignature", - "start": 18, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":18,"end":29,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":15}}, "key": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "m" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"m"}, "name": "m" }, "computed": false, @@ -111,32 +32,10 @@ "parameters": [], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":28,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 14 - } - } + "start":24,"end":28,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":14}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/method-plain/output.json b/packages/babel-parser/test/fixtures/typescript/interface/method-plain/output.json index c1c3b22a61..48f549db12 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/method-plain/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/method-plain/output.json @@ -1,109 +1,30 @@ { "type": "File", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":65,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 12, - "end": 65, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":12,"end":65,"loc":{"start":{"line":1,"column":12},"end":{"line":4,"column":1}}, "body": [ { "type": "TSMethodSignature", - "start": 18, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":18,"end":22,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":8}}, "key": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "m" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"m"}, "name": "m" }, "computed": false, @@ -111,158 +32,45 @@ }, { "type": "TSMethodSignature", - "start": 27, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 40 - } - }, + "start":27,"end":63,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":40}}, "key": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "m" - }, + "start":27,"end":28,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"m"}, "name": "m" }, "computed": false, "parameters": [ { "type": "Identifier", - "start": 29, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 6 - }, - "end": { - "line": 3, - "column": 16 - }, - "identifierName": "x" - }, + "start":29,"end":39,"loc":{"start":{"line":3,"column":6},"end":{"line":3,"column":16},"identifierName":"x"}, "name": "x", "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 31, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 16 - } - }, + "start":31,"end":39,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":16}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 16 - } - } + "start":33,"end":39,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":16}} } } }, { "type": "RestElement", - "start": 41, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 3, - "column": 32 - } - }, + "start":41,"end":55,"loc":{"start":{"line":3,"column":18},"end":{"line":3,"column":32}}, "argument": { "type": "Identifier", - "start": 44, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 22 - }, - "identifierName": "y" - }, + "start":44,"end":45,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":22},"identifierName":"y"}, "name": "y" }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 45, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 32 - } - }, + "start":45,"end":55,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":32}}, "typeAnnotation": { "type": "TSArrayType", - "start": 47, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 32 - } - }, + "start":47,"end":55,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":32}}, "elementType": { "type": "TSNumberKeyword", - "start": 47, - "end": 53, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 30 - } - } + "start":47,"end":53,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":30}} } } } @@ -270,32 +78,10 @@ ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 56, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 33 - }, - "end": { - "line": 3, - "column": 39 - } - }, + "start":56,"end":62,"loc":{"start":{"line":3,"column":33},"end":{"line":3,"column":39}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 58, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 3, - "column": 39 - } - } + "start":58,"end":62,"loc":{"start":{"line":3,"column":35},"end":{"line":3,"column":39}} } } } 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 0c1b0a87b1..0038b79005 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/modifiers/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/modifiers/output.json @@ -1,141 +1,40 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 12, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":39,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "body": [ { "type": "TSPropertySignature", - "start": 18, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":18,"end":37,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":23}}, "key": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "x" - }, + "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 - } - }, + "start":28,"end":36,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":22}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 22 - } - } + "start":30,"end":36,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":22}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/new-line/output.json b/packages/babel-parser/test/fixtures/typescript/interface/new-line/output.json index 56e109b261..f4f22a613f 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/new-line/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":14,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "interface" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"interface"}, "name": "interface" } }, { "type": "ExpressionStatement", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":10,"end":11,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1}}, "expression": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "F" - }, + "start":10,"end":11,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"F"}, "name": "F" } }, { "type": "BlockStatement", - "start": 12, - "end": 14, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":12,"end":14,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":2}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/properties/output.json b/packages/babel-parser/test/fixtures/typescript/interface/properties/output.json index ae16a8b7dd..9b822018f0 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/properties/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/properties/output.json @@ -1,237 +1,68 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 12, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":12,"end":53,"loc":{"start":{"line":1,"column":12},"end":{"line":5,"column":1}}, "body": [ { "type": "TSPropertySignature", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":18,"end":20,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":6}}, "key": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"x"}, "name": "x" }, "computed": false }, { "type": "TSPropertySignature", - "start": 25, - "end": 35, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":25,"end":35,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":14}}, "key": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - }, - "identifierName": "y" - }, + "start":25,"end":26,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":5},"identifierName":"y"}, "name": "y" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 26, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":26,"end":34,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":13}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 28, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 13 - } - } + "start":28,"end":34,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":13}} } } }, { "type": "TSPropertySignature", - "start": 40, - "end": 51, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 15 - } - }, + "start":40,"end":51,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":15}}, "key": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "z" - }, + "start":40,"end":41,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":5},"identifierName":"z"}, "name": "z" }, "computed": false, "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 42, - "end": 50, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":42,"end":50,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":14}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 44, - "end": 50, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 14 - } - } + "start":44,"end":50,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":14}} } } } 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 7e53f4c701..4d2a307286 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 @@ -1,237 +1,67 @@ { "type": "File", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":78,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 12, - "end": 78, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":12,"end":78,"loc":{"start":{"line":1,"column":12},"end":{"line":4,"column":1}}, "body": [ { "type": "TSPropertySignature", - "start": 18, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":18,"end":44,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":30}}, "computed": true, "key": { "type": "MemberExpression", - "start": 19, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":19,"end":34,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":20}}, "object": { "type": "Identifier", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "Symbol" - }, + "start":19,"end":25,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, "property": { "type": "Identifier", - "start": 26, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "iterator" - }, + "start":26,"end":34,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":20},"identifierName":"iterator"}, "name": "iterator" }, "computed": false }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 35, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 29 - } - }, + "start":35,"end":43,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":29}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 23 - }, - "end": { - "line": 2, - "column": 29 - } - } + "start":37,"end":43,"loc":{"start":{"line":2,"column":23},"end":{"line":2,"column":29}} } } }, { "type": "TSPropertySignature", - "start": 49, - "end": 76, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 31 - } - }, + "start":49,"end":76,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":31}}, "computed": true, "key": { "type": "MemberExpression", - "start": 50, - "end": 65, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":50,"end":65,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":20}}, "object": { "type": "Identifier", - "start": 50, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 11 - }, - "identifierName": "Symbol" - }, + "start":50,"end":56,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":11},"identifierName":"Symbol"}, "name": "Symbol" }, "property": { "type": "Identifier", - "start": 57, - "end": 65, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 20 - }, - "identifierName": "iterator" - }, + "start":57,"end":65,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":20},"identifierName":"iterator"}, "name": "iterator" }, "computed": false @@ -239,32 +69,10 @@ "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 67, - "end": 75, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 30 - } - }, + "start":67,"end":75,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":30}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 69, - "end": 75, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 30 - } - } + "start":69,"end":75,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":30}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/property-named-public/output.json b/packages/babel-parser/test/fixtures/typescript/interface/property-named-public/output.json index 0f7e0a88bb..d9710b301c 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/property-named-public/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/property-named-public/output.json @@ -1,140 +1,39 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 12, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":32,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "body": [ { "type": "TSPropertySignature", - "start": 15, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":15,"end":30,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":16}}, "key": { "type": "Identifier", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "public" - }, + "start":15,"end":21,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":7},"identifierName":"public"}, "name": "public" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":21,"end":29,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":15}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":23,"end":29,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/reserved-method-name/output.json b/packages/babel-parser/test/fixtures/typescript/interface/reserved-method-name/output.json index ea83a7bd8d..59bb78a048 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/reserved-method-name/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/reserved-method-name/output.json @@ -1,141 +1,40 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "I" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 12, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":34,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "body": [ { "type": "TSMethodSignature", - "start": 18, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":18,"end":32,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":18}}, "key": { "type": "Identifier", - "start": 18, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 9 - }, - "identifierName": "catch" - }, + "start":18,"end":23,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9},"identifierName":"catch"}, "name": "catch" }, "computed": false, "parameters": [], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":25,"end":31,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":17}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 17 - } - } + "start":27,"end":31,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":17}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/interface/separators/output.json b/packages/babel-parser/test/fixtures/typescript/interface/separators/output.json index 6b7b44d5d9..f4e4aad0c2 100644 --- a/packages/babel-parser/test/fixtures/typescript/interface/separators/output.json +++ b/packages/babel-parser/test/fixtures/typescript/interface/separators/output.json @@ -1,203 +1,57 @@ { "type": "File", - "start": 0, - "end": 130, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":130,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 130, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":130,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":40}}, "id": { "type": "Identifier", - "start": 10, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "Comma" - }, + "start":10,"end":15,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":15},"identifierName":"Comma"}, "name": "Comma" }, "body": { "type": "TSInterfaceBody", - "start": 16, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":16,"end":40,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":40}}, "body": [ { "type": "TSPropertySignature", - "start": 18, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":18,"end":28,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":28}}, "key": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "x" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"x"}, "name": "x" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } } }, { "type": "TSPropertySignature", - "start": 29, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":29,"end":38,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":38}}, "key": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - }, - "identifierName": "y" - }, + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30},"identifierName":"y"}, "name": "y" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 30, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":30,"end":38,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":38}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 32, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 32 - }, - "end": { - "line": 1, - "column": 38 - } - } + "start":32,"end":38,"loc":{"start":{"line":1,"column":32},"end":{"line":1,"column":38}} } } } @@ -206,173 +60,49 @@ }, { "type": "TSInterfaceDeclaration", - "start": 41, - "end": 80, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 39 - } - }, + "start":41,"end":80,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":39}}, "id": { "type": "Identifier", - "start": 51, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "Semi" - }, + "start":51,"end":55,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":14},"identifierName":"Semi"}, "name": "Semi" }, "body": { "type": "TSInterfaceBody", - "start": 56, - "end": 80, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 39 - } - }, + "start":56,"end":80,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":39}}, "body": [ { "type": "TSPropertySignature", - "start": 58, - "end": 68, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":58,"end":68,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":27}}, "key": { "type": "Identifier", - "start": 58, - "end": 59, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "x" - }, + "start":58,"end":59,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"x"}, "name": "x" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 59, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":59,"end":67,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":26}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 61, - "end": 67, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 26 - } - } + "start":61,"end":67,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":26}} } } }, { "type": "TSPropertySignature", - "start": 69, - "end": 78, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":69,"end":78,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":37}}, "key": { "type": "Identifier", - "start": 69, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 29 - }, - "identifierName": "y" - }, + "start":69,"end":70,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":29},"identifierName":"y"}, "name": "y" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 70, - "end": 78, - "loc": { - "start": { - "line": 2, - "column": 29 - }, - "end": { - "line": 2, - "column": 37 - } - }, + "start":70,"end":78,"loc":{"start":{"line":2,"column":29},"end":{"line":2,"column":37}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 72, - "end": 78, - "loc": { - "start": { - "line": 2, - "column": 31 - }, - "end": { - "line": 2, - "column": 37 - } - } + "start":72,"end":78,"loc":{"start":{"line":2,"column":31},"end":{"line":2,"column":37}} } } } @@ -381,173 +111,49 @@ }, { "type": "TSInterfaceDeclaration", - "start": 81, - "end": 130, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":81,"end":130,"loc":{"start":{"line":3,"column":0},"end":{"line":6,"column":1}}, "id": { "type": "Identifier", - "start": 91, - "end": 98, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 17 - }, - "identifierName": "Newline" - }, + "start":91,"end":98,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":17},"identifierName":"Newline"}, "name": "Newline" }, "body": { "type": "TSInterfaceBody", - "start": 99, - "end": 130, - "loc": { - "start": { - "line": 3, - "column": 18 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":99,"end":130,"loc":{"start":{"line":3,"column":18},"end":{"line":6,"column":1}}, "body": [ { "type": "TSPropertySignature", - "start": 105, - "end": 114, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":105,"end":114,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":13}}, "key": { "type": "Identifier", - "start": 105, - "end": 106, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - }, - "identifierName": "x" - }, + "start":105,"end":106,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":5},"identifierName":"x"}, "name": "x" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 106, - "end": 114, - "loc": { - "start": { - "line": 4, - "column": 5 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":106,"end":114,"loc":{"start":{"line":4,"column":5},"end":{"line":4,"column":13}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 108, - "end": 114, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 13 - } - } + "start":108,"end":114,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":13}} } } }, { "type": "TSPropertySignature", - "start": 119, - "end": 128, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":119,"end":128,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":13}}, "key": { "type": "Identifier", - "start": 119, - "end": 120, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 5 - }, - "identifierName": "y" - }, + "start":119,"end":120,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":5},"identifierName":"y"}, "name": "y" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 120, - "end": 128, - "loc": { - "start": { - "line": 5, - "column": 5 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":120,"end":128,"loc":{"start":{"line":5,"column":5},"end":{"line":5,"column":13}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 122, - "end": 128, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 13 - } - } + "start":122,"end":128,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":13}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/legacy-decorators/abstract-class/output.json b/packages/babel-parser/test/fixtures/typescript/legacy-decorators/abstract-class/output.json index d286de258e..2494ecbfc4 100644 --- a/packages/babel-parser/test/fixtures/typescript/legacy-decorators/abstract-class/output.json +++ b/packages/babel-parser/test/fixtures/typescript/legacy-decorators/abstract-class/output.json @@ -1,93 +1,26 @@ { "type": "File", - "start": 0, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":85,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":85,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 85, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":85,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "abstract": true, "decorators": [ { "type": "Decorator", - "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}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":1,"end":11,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":11}}, "callee": { "type": "Identifier", - "start": 1, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "decorate" - }, + "start":1,"end":9,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":9},"identifierName":"decorate"}, "name": "decorate" }, "arguments": [] @@ -96,83 +29,25 @@ ], "id": { "type": "Identifier", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "Test" - }, + "start":27,"end":31,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":19},"identifierName":"Test"}, "name": "Test" }, "superClass": { "type": "Identifier", - "start": 40, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 28 - }, - "end": { - "line": 2, - "column": 34 - }, - "identifierName": "Object" - }, + "start":40,"end":46,"loc":{"start":{"line":2,"column":28},"end":{"line":2,"column":34},"identifierName":"Object"}, "name": "Object" }, "body": { "type": "ClassBody", - "start": 47, - "end": 85, - "loc": { - "start": { - "line": 2, - "column": 35 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":47,"end":85,"loc":{"start":{"line":2,"column":35},"end":{"line":6,"column":1}}, "body": [ { "type": "ClassMethod", - "start": 51, - "end": 83, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":51,"end":83,"loc":{"start":{"line":3,"column":2},"end":{"line":5,"column":3}}, "static": false, "key": { "type": "Identifier", - "start": 51, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 2 - }, - "end": { - "line": 3, - "column": 13 - }, - "identifierName": "constructor" - }, + "start":51,"end":62,"loc":{"start":{"line":3,"column":2},"end":{"line":3,"column":13},"identifierName":"constructor"}, "name": "constructor" }, "computed": false, @@ -183,61 +58,17 @@ "params": [], "body": { "type": "BlockStatement", - "start": 65, - "end": 83, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 5, - "column": 3 - } - }, + "start":65,"end":83,"loc":{"start":{"line":3,"column":16},"end":{"line":5,"column":3}}, "body": [ { "type": "ExpressionStatement", - "start": 71, - "end": 79, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 12 - } - }, + "start":71,"end":79,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":12}}, "expression": { "type": "CallExpression", - "start": 71, - "end": 78, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 11 - } - }, + "start":71,"end":78,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":11}}, "callee": { "type": "Super", - "start": 71, - "end": 76, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 9 - } - } + "start":71,"end":76,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":9}} }, "arguments": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/legacy-decorators/type-arguments/output.json b/packages/babel-parser/test/fixtures/typescript/legacy-decorators/type-arguments/output.json index 91add31ed1..f546aad369 100644 --- a/packages/babel-parser/test/fixtures/typescript/legacy-decorators/type-arguments/output.json +++ b/packages/babel-parser/test/fixtures/typescript/legacy-decorators/type-arguments/output.json @@ -1,124 +1,35 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "decorators": [ { "type": "Decorator", - "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}}, "expression": { "type": "CallExpression", - "start": 1, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":1,"end":20,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":20}}, "callee": { "type": "Identifier", - "start": 1, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "decorator" - }, + "start":1,"end":10,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":10},"identifierName":"decorator"}, "name": "decorator" }, "arguments": [], "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 10, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":10,"end":18,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":18}}, "params": [ { "type": "TSStringKeyword", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}} } ] } @@ -127,36 +38,13 @@ ], "id": { "type": "Identifier", - "start": 27, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "Test" - }, + "start":27,"end":31,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":10},"identifierName":"Test"}, "name": "Test" }, "superClass": null, "body": { "type": "ClassBody", - "start": 32, - "end": 34, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":32,"end":34,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":13}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/body-declare/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/body-declare/output.json index 5f8ae8eb5b..8bcf5ab69d 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/body-declare/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/body-declare/output.json @@ -1,153 +1,41 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSModuleDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "N" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"N"}, "name": "N" }, "body": { "type": "TSModuleBlock", - "start": 20, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":20,"end":44,"loc":{"start":{"line":1,"column":20},"end":{"line":3,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 26, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":26,"end":42,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":20}}, "declarations": [ { "type": "VariableDeclarator", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":32,"end":41,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":19}}, "id": { "type": "Identifier", - "start": 32, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "x" - }, + "start":32,"end":41,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":19},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 33, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":33,"end":41,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":19}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 19 - } - } + "start":35,"end":41,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":19}} } } }, diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/body-nested-declare/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/body-nested-declare/output.json index ff0da7268c..649baf03a4 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/body-nested-declare/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/body-nested-declare/output.json @@ -1,199 +1,53 @@ { "type": "File", - "start": 0, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":72,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":72,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSModuleDeclaration", - "start": 0, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":72,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "A" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSModuleBlock", - "start": 20, - "end": 72, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":20,"end":72,"loc":{"start":{"line":1,"column":20},"end":{"line":5,"column":1}}, "body": [ { "type": "TSModuleDeclaration", - "start": 26, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":26,"end":70,"loc":{"start":{"line":2,"column":4},"end":{"line":4,"column":5}}, "id": { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "B" - }, + "start":36,"end":37,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"B"}, "name": "B" }, "body": { "type": "TSModuleBlock", - "start": 38, - "end": 70, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":38,"end":70,"loc":{"start":{"line":2,"column":16},"end":{"line":4,"column":5}}, "body": [ { "type": "VariableDeclaration", - "start": 48, - "end": 64, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":48,"end":64,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":24}}, "declarations": [ { "type": "VariableDeclarator", - "start": 54, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":54,"end":63,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":23}}, "id": { "type": "Identifier", - "start": 54, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 23 - }, - "identifierName": "x" - }, + "start":54,"end":63,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":23},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 55, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 23 - } - }, + "start":55,"end":63,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":23}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 57, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 23 - } - } + "start":57,"end":63,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":23}} } } }, diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/body-nested/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/body-nested/output.json index 67d5f30c5d..0d107dd672 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/body-nested/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/body-nested/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSModuleDeclaration", - "start": 0, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":0,"end":39,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSModuleBlock", - "start": 12, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 4, - "column": 1 - } - }, + "start":12,"end":39,"loc":{"start":{"line":1,"column":12},"end":{"line":4,"column":1}}, "body": [ { "type": "TSModuleDeclaration", - "start": 18, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":18,"end":37,"loc":{"start":{"line":2,"column":4},"end":{"line":3,"column":5}}, "id": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "B" - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"B"}, "name": "B" }, "body": { "type": "TSModuleBlock", - "start": 30, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 3, - "column": 5 - } - }, + "start":30,"end":37,"loc":{"start":{"line":2,"column":16},"end":{"line":3,"column":5}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/body/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/body/output.json index efae4d5c92..1bd3f38ff7 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/body/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/body/output.json @@ -1,140 +1,39 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSModuleDeclaration", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "N" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"N"}, "name": "N" }, "body": { "type": "TSModuleBlock", - "start": 12, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":12,"end":32,"loc":{"start":{"line":1,"column":12},"end":{"line":3,"column":1}}, "body": [ { "type": "VariableDeclaration", - "start": 18, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":18,"end":30,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":16}}, "declarations": [ { "type": "VariableDeclarator", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":24,"end":29,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "x" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"x"}, "name": "x" }, "init": { "type": "NumericLiteral", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":28,"end":29,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "extra": { "rawValue": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/declare-shorthand/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/declare-shorthand/output.json index 347a92127a..24d18495a9 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/declare-shorthand/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/declare-shorthand/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "program": { "type": "Program", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSModuleDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "extra": { "rawValue": "m", "raw": "\"m\"" diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/global-in-module/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/global-in-module/output.json index c0f886e673..74eabed8ab 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/global-in-module/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/global-in-module/output.json @@ -1,62 +1,18 @@ { "type": "File", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSModuleDeclaration", - "start": 0, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":64,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "StringLiteral", - "start": 15, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":15,"end":18,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":18}}, "extra": { "rawValue": "m", "raw": "\"m\"" @@ -65,139 +21,38 @@ }, "body": { "type": "TSModuleBlock", - "start": 19, - "end": 64, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":19,"end":64,"loc":{"start":{"line":1,"column":19},"end":{"line":5,"column":1}}, "body": [ { "type": "TSModuleDeclaration", - "start": 25, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":25,"end":62,"loc":{"start":{"line":2,"column":4},"end":{"line":4,"column":5}}, "global": true, "id": { "type": "Identifier", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "global" - }, + "start":25,"end":31,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":10},"identifierName":"global"}, "name": "global" }, "body": { "type": "TSModuleBlock", - "start": 32, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 4, - "column": 5 - } - }, + "start":32,"end":62,"loc":{"start":{"line":2,"column":11},"end":{"line":4,"column":5}}, "body": [ { "type": "VariableDeclaration", - "start": 42, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":42,"end":56,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 46, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":46,"end":55,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":21}}, "id": { "type": "Identifier", - "start": 46, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 21 - }, - "identifierName": "x" - }, + "start":46,"end":55,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":21},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 47, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 13 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":47,"end":55,"loc":{"start":{"line":3,"column":13},"end":{"line":3,"column":21}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 49, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 21 - } - } + "start":49,"end":55,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":21}} } } }, diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/head-declare/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/head-declare/output.json index 06f9037318..449aeeac49 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/head-declare/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/head-declare/output.json @@ -1,110 +1,31 @@ { "type": "File", - "start": 0, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 17 - } - }, + "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":17}}, "program": { "type": "Program", - "start": 0, - "end": 84, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 17 - } - }, + "start":0,"end":84,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":17}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSModuleDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "N" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"N"}, "name": "N" }, "body": { "type": "TSModuleDeclaration", - "start": 20, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":20,"end":24,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "M" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"M"}, "name": "M" }, "body": { "type": "TSModuleBlock", - "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}}, "body": [] } }, @@ -112,81 +33,25 @@ }, { "type": "TSModuleDeclaration", - "start": 25, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":25,"end":44,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":19}}, "id": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 16 - }, - "identifierName": "M" - }, + "start":40,"end":41,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":16},"identifierName":"M"}, "name": "M" }, "body": { "type": "TSModuleBlock", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":42,"end":44,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":19}}, "body": [] }, "declare": true }, { "type": "TSModuleDeclaration", - "start": 45, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":45,"end":66,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":21}}, "id": { "type": "StringLiteral", - "start": 60, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":60,"end":63,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":18}}, "extra": { "rawValue": "m", "raw": "\"m\"" @@ -195,68 +60,23 @@ }, "body": { "type": "TSModuleBlock", - "start": 64, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":64,"end":66,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":21}}, "body": [] }, "declare": true }, { "type": "TSModuleDeclaration", - "start": 67, - "end": 84, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 17 - } - }, + "start":67,"end":84,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":17}}, "global": true, "id": { "type": "Identifier", - "start": 75, - "end": 81, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 14 - }, - "identifierName": "global" - }, + "start":75,"end":81,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":14},"identifierName":"global"}, "name": "global" }, "body": { "type": "TSModuleBlock", - "start": 82, - "end": 84, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 17 - } - }, + "start":82,"end":84,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":17}}, "body": [] }, "declare": true diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/head-export/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/head-export/output.json index d731128cf4..6562e2f336 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/head-export/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/head-export/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":0,"end":42,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "TSModuleDeclaration", - "start": 7, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":7,"end":23,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "X" - }, + "start":17,"end":18,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":18},"identifierName":"X"}, "name": "X" }, "body": { "type": "TSModuleDeclaration", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":19,"end":23,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "Y" - }, + "start":19,"end":20,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":20},"identifierName":"Y"}, "name": "Y" }, "body": { "type": "TSModuleBlock", - "start": 21, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":21,"end":23,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":23}}, "body": [] } } @@ -129,66 +39,21 @@ }, { "type": "ExportNamedDeclaration", - "start": 24, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":24,"end":42,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "TSModuleDeclaration", - "start": 31, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":31,"end":42,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "X" - }, + "start":38,"end":39,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"X"}, "name": "X" }, "body": { "type": "TSModuleBlock", - "start": 40, - "end": 42, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":40,"end":42,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/head/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/head/output.json index 6c3609f59e..57fe9bd33c 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/head/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/head/output.json @@ -1,189 +1,53 @@ { "type": "File", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":13}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSModuleDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "N" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"N"}, "name": "N" }, "body": { "type": "TSModuleBlock", - "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}}, "body": [] } }, { "type": "TSModuleDeclaration", - "start": 15, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":15,"end":33,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "M" - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"M"}, "name": "M" }, "body": { "type": "TSModuleDeclaration", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":27,"end":33,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "N" - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"N"}, "name": "N" }, "body": { "type": "TSModuleDeclaration", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":29,"end":33,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":18}}, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "O" - }, + "start":29,"end":30,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"O"}, "name": "O" }, "body": { "type": "TSModuleBlock", - "start": 31, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":31,"end":33,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":18}}, "body": [] } } @@ -191,80 +55,24 @@ }, { "type": "TSModuleDeclaration", - "start": 34, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":34,"end":45,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":11}}, "id": { "type": "Identifier", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 8 - }, - "identifierName": "M" - }, + "start":41,"end":42,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":8},"identifierName":"M"}, "name": "M" }, "body": { "type": "TSModuleBlock", - "start": 43, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":43,"end":45,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":11}}, "body": [] } }, { "type": "TSModuleDeclaration", - "start": 46, - "end": 59, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":46,"end":59,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":13}}, "id": { "type": "StringLiteral", - "start": 53, - "end": 56, - "loc": { - "start": { - "line": 4, - "column": 7 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":53,"end":56,"loc":{"start":{"line":4,"column":7},"end":{"line":4,"column":10}}, "extra": { "rawValue": "m", "raw": "\"m\"" @@ -273,18 +81,7 @@ }, "body": { "type": "TSModuleBlock", - "start": 57, - "end": 59, - "loc": { - "start": { - "line": 4, - "column": 11 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":57,"end":59,"loc":{"start":{"line":4,"column":11},"end":{"line":4,"column":13}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/module-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/module-new-line/output.json index bee3b058a5..172c4f6675 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/module-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/module-new-line/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":13,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "module" - }, + "start":0,"end":6,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":6},"identifierName":"module"}, "name": "module" } }, { "type": "ExpressionStatement", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":7,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "expression": { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "Foo" - }, + "start":7,"end":10,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3},"identifierName":"Foo"}, "name": "Foo" } }, { "type": "BlockStatement", - "start": 11, - "end": 13, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":11,"end":13,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":2}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-new-line/output.json b/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-new-line/output.json index eadadded28..69d543dc89 100644 --- a/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/module-namespace/namespace-new-line/output.json @@ -1,112 +1,33 @@ { "type": "File", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":0,"end":16,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "Identifier", - "start": 0, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "namespace" - }, + "start":0,"end":9,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":9},"identifierName":"namespace"}, "name": "namespace" } }, { "type": "ExpressionStatement", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":10,"end":13,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3}}, "expression": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "Foo" - }, + "start":10,"end":13,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3},"identifierName":"Foo"}, "name": "Foo" } }, { "type": "BlockStatement", - "start": 14, - "end": 16, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":14,"end":16,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":2}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/output.json b/packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/output.json index 42f6c8b98b..0a92626ffd 100644 --- a/packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/output.json +++ b/packages/babel-parser/test/fixtures/typescript/optional-chaining/type-arguments/output.json @@ -1,141 +1,39 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "expression": { "type": "OptionalCallExpression", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "callee": { "type": "OptionalMemberExpression", - "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": 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": 7, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "example" - }, + "start":0,"end":7,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":7},"identifierName":"example"}, "name": "example" }, "property": { "type": "Identifier", - "start": 8, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "inner" - }, + "start":8,"end":13,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":13},"identifierName":"inner"}, "name": "inner" }, "computed": false }, "property": { "type": "Identifier", - "start": 15, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "greet" - }, + "start":15,"end":20,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":20},"identifierName":"greet"}, "name": "greet" }, "computed": false, @@ -144,33 +42,11 @@ "arguments": [], "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 20, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":20,"end":28,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":28}}, "params": [ { "type": "TSStringKeyword", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 27 - } - } + "start":21,"end":27,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":27}} } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/regression/async-arrow-generic-9560/output.json b/packages/babel-parser/test/fixtures/typescript/regression/async-arrow-generic-9560/output.json index 8cbb94861b..967a411d65 100644 --- a/packages/babel-parser/test/fixtures/typescript/regression/async-arrow-generic-9560/output.json +++ b/packages/babel-parser/test/fixtures/typescript/regression/async-arrow-generic-9560/output.json @@ -1,157 +1,45 @@ { "type": "File", - "start": 0, - "end": 80, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":0,"end":80,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 80, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":0,"end":80,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 80, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":0,"end":80,"loc":{"start":{"line":1,"column":0},"end":{"line":8,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "Cl" - }, + "start":6,"end":8,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":8},"identifierName":"Cl"}, "name": "Cl" }, "superClass": null, "body": { "type": "ClassBody", - "start": 9, - "end": 80, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 8, - "column": 1 - } - }, + "start":9,"end":80,"loc":{"start":{"line":1,"column":9},"end":{"line":8,"column":1}}, "body": [ { "type": "ClassProperty", - "start": 13, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 4 - } - }, + "start":13,"end":50,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":4}}, "static": false, "key": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "a" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"a"}, "name": "a" }, "computed": false, "value": { "type": "ArrowFunctionExpression", - "start": 17, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":17,"end":49,"loc":{"start":{"line":2,"column":6},"end":{"line":4,"column":3}}, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 22, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":25,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14}}, "params": [ { "type": "TSTypeParameter", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13}}, "name": "T" } ] @@ -162,61 +50,17 @@ "async": true, "body": { "type": "BlockStatement", - "start": 31, - "end": 49, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":31,"end":49,"loc":{"start":{"line":2,"column":20},"end":{"line":4,"column":3}}, "body": [ { "type": "ExpressionStatement", - "start": 37, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":37,"end":45,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":12}}, "expression": { "type": "AwaitExpression", - "start": 37, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":37,"end":44,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":11}}, "argument": { "type": "NumericLiteral", - "start": 43, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 11 - } - }, + "start":43,"end":44,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":11}}, "extra": { "rawValue": 0, "raw": "0" @@ -232,80 +76,24 @@ }, { "type": "ClassProperty", - "start": 54, - "end": 78, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 7, - "column": 4 - } - }, + "start":54,"end":78,"loc":{"start":{"line":6,"column":2},"end":{"line":7,"column":4}}, "static": false, "key": { "type": "Identifier", - "start": 54, - "end": 55, - "loc": { - "start": { - "line": 6, - "column": 2 - }, - "end": { - "line": 6, - "column": 3 - }, - "identifierName": "b" - }, + "start":54,"end":55,"loc":{"start":{"line":6,"column":2},"end":{"line":6,"column":3},"identifierName":"b"}, "name": "b" }, "computed": false, "value": { "type": "ArrowFunctionExpression", - "start": 58, - "end": 77, - "loc": { - "start": { - "line": 6, - "column": 6 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":58,"end":77,"loc":{"start":{"line":6,"column":6},"end":{"line":7,"column":3}}, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 63, - "end": 66, - "loc": { - "start": { - "line": 6, - "column": 11 - }, - "end": { - "line": 6, - "column": 14 - } - }, + "start":63,"end":66,"loc":{"start":{"line":6,"column":11},"end":{"line":6,"column":14}}, "params": [ { "type": "TSTypeParameter", - "start": 64, - "end": 65, - "loc": { - "start": { - "line": 6, - "column": 12 - }, - "end": { - "line": 6, - "column": 13 - } - }, + "start":64,"end":65,"loc":{"start":{"line":6,"column":12},"end":{"line":6,"column":13}}, "name": "T" } ] @@ -316,18 +104,7 @@ "async": true, "body": { "type": "BlockStatement", - "start": 72, - "end": 77, - "loc": { - "start": { - "line": 6, - "column": 20 - }, - "end": { - "line": 7, - "column": 3 - } - }, + "start":72,"end":77,"loc":{"start":{"line":6,"column":20},"end":{"line":7,"column":3}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/regression/comments-disappearing/output.json b/packages/babel-parser/test/fixtures/typescript/regression/comments-disappearing/output.json index 29dfe9b555..63473abe78 100644 --- a/packages/babel-parser/test/fixtures/typescript/regression/comments-disappearing/output.json +++ b/packages/babel-parser/test/fixtures/typescript/regression/comments-disappearing/output.json @@ -1,141 +1,41 @@ { "type": "File", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":0,"end":70,"loc":{"start":{"line":1,"column":0},"end":{"line":6,"column":1}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":4,"end":70,"loc":{"start":{"line":1,"column":4},"end":{"line":6,"column":1}}, "id": { "type": "Identifier", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "fun" - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7},"identifierName":"fun"}, "name": "fun" }, "init": { "type": "ArrowFunctionExpression", - "start": 10, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":10,"end":70,"loc":{"start":{"line":1,"column":10},"end":{"line":6,"column":1}}, "id": null, "generator": false, "async": false, "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 70, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 6, - "column": 1 - } - }, + "start":16,"end":70,"loc":{"start":{"line":1,"column":16},"end":{"line":6,"column":1}}, "body": [ { "type": "ReturnStatement", - "start": 57, - "end": 68, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 15 - } - }, + "start":57,"end":68,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":15}}, "argument": { "type": "NumericLiteral", - "start": 65, - "end": 66, - "loc": { - "start": { - "line": 5, - "column": 12 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":65,"end":66,"loc":{"start":{"line":5,"column":12},"end":{"line":5,"column":13}}, "extra": { "rawValue": 1, "raw": "1", @@ -148,50 +48,17 @@ { "type": "CommentLine", "value": " one", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":22,"end":28,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":10}} }, { "type": "CommentLine", "value": " two", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 10 - } - } + "start":33,"end":39,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":10}} }, { "type": "CommentLine", "value": " three", - "start": 44, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 12 - } - } + "start":44,"end":52,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":12}} } ] } @@ -210,50 +77,17 @@ { "type": "CommentLine", "value": " one", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 10 - } - } + "start":22,"end":28,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":10}} }, { "type": "CommentLine", "value": " two", - "start": 33, - "end": 39, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 10 - } - } + "start":33,"end":39,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":10}} }, { "type": "CommentLine", "value": " three", - "start": 44, - "end": 52, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 12 - } - } + "start":44,"end":52,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":12}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/regression/destructuring-in-function-type/output.json b/packages/babel-parser/test/fixtures/typescript/regression/destructuring-in-function-type/output.json index 38916a8426..c7a987bc3f 100644 --- a/packages/babel-parser/test/fixtures/typescript/regression/destructuring-in-function-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/regression/destructuring-in-function-type/output.json @@ -1,144 +1,42 @@ { "type": "File", - "start": 0, - "end": 75, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":0,"end":75,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 75, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":0,"end":75,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "id": { "type": "Identifier", - "start": 5, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "MyType" - }, + "start":5,"end":11,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":11},"identifierName":"MyType"}, "name": "MyType" }, "typeAnnotation": { "type": "TSFunctionType", - "start": 14, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":14,"end":37,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":37}}, "parameters": [ { "type": "ObjectPattern", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":15,"end":29,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":29}}, "properties": [ { "type": "ObjectProperty", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22}}, "method": false, "key": { "type": "Identifier", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "theme" - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22},"identifierName":"theme"}, "name": "theme" }, "computed": false, "shorthand": true, "value": { "type": "Identifier", - "start": 17, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "theme" - }, + "start":17,"end":22,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":22},"identifierName":"theme"}, "name": "theme" }, "extra": { @@ -148,207 +46,62 @@ ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 24, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":24,"end":29,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":29}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - } - } + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29}} } } } ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":31,"end":37,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":37}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":34,"end":37,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":37}} } } } }, { "type": "TSTypeAliasDeclaration", - "start": 39, - "end": 75, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":39,"end":75,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":36}}, "id": { "type": "Identifier", - "start": 44, - "end": 55, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 16 - }, - "identifierName": "AnotherType" - }, + "start":44,"end":55,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":16},"identifierName":"AnotherType"}, "name": "AnotherType" }, "typeAnnotation": { "type": "TSFunctionType", - "start": 58, - "end": 75, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":58,"end":75,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":36}}, "parameters": [ { "type": "ArrayPattern", - "start": 59, - "end": 67, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 28 - } - }, + "start":59,"end":67,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":28}}, "elements": [ { "type": "Identifier", - "start": 60, - "end": 61, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 3, - "column": 22 - }, - "identifierName": "a" - }, + "start":60,"end":61,"loc":{"start":{"line":3,"column":21},"end":{"line":3,"column":22},"identifierName":"a"}, "name": "a" } ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 62, - "end": 67, - "loc": { - "start": { - "line": 3, - "column": 23 - }, - "end": { - "line": 3, - "column": 28 - } - }, + "start":62,"end":67,"loc":{"start":{"line":3,"column":23},"end":{"line":3,"column":28}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 64, - "end": 67, - "loc": { - "start": { - "line": 3, - "column": 25 - }, - "end": { - "line": 3, - "column": 28 - } - } + "start":64,"end":67,"loc":{"start":{"line":3,"column":25},"end":{"line":3,"column":28}} } } } ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 69, - "end": 75, - "loc": { - "start": { - "line": 3, - "column": 30 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":69,"end":75,"loc":{"start":{"line":3,"column":30},"end":{"line":3,"column":36}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 72, - "end": 75, - "loc": { - "start": { - "line": 3, - "column": 33 - }, - "end": { - "line": 3, - "column": 36 - } - } + "start":72,"end":75,"loc":{"start":{"line":3,"column":33},"end":{"line":3,"column":36}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/regression/is-default-export/output.json b/packages/babel-parser/test/fixtures/typescript/regression/is-default-export/output.json index c2d937d1bd..f8b77aefeb 100644 --- a/packages/babel-parser/test/fixtures/typescript/regression/is-default-export/output.json +++ b/packages/babel-parser/test/fixtures/typescript/regression/is-default-export/output.json @@ -1,145 +1,44 @@ { "type": "File", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":21}}, "program": { "type": "Program", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":21}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSTypeAliasDeclaration", - "start": 7, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":7,"end":23,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "T" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"T"}, "name": "T" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} } } }, { "type": "ExportNamedDeclaration", - "start": 24, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":24,"end":40,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "TSEnumDeclaration", - "start": 31, - "end": 40, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":31,"end":40,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":16}}, "id": { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "E" - }, + "start":36,"end":37,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":13},"identifierName":"E"}, "name": "E" }, "members": [] @@ -147,66 +46,21 @@ }, { "type": "ExportNamedDeclaration", - "start": 41, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":41,"end":62,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":21}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSInterfaceDeclaration", - "start": 48, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":48,"end":62,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":21}}, "id": { "type": "Identifier", - "start": 58, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 18 - }, - "identifierName": "I" - }, + "start":58,"end":59,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":18},"identifierName":"I"}, "name": "I" }, "body": { "type": "TSInterfaceBody", - "start": 60, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 19 - }, - "end": { - "line": 3, - "column": 21 - } - }, + "start":60,"end":62,"loc":{"start":{"line":3,"column":19},"end":{"line":3,"column":21}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/regression/issue-7742/output.json b/packages/babel-parser/test/fixtures/typescript/regression/issue-7742/output.json index ad154a88fd..dee4911127 100644 --- a/packages/babel-parser/test/fixtures/typescript/regression/issue-7742/output.json +++ b/packages/babel-parser/test/fixtures/typescript/regression/issue-7742/output.json @@ -1,156 +1,45 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "Foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"Foo"}, "name": "Foo" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":13,"end":16,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":16}}, "params": [ { "type": "TSTypeParameter", - "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}}, "name": "G" } ] }, "body": { "type": "TSInterfaceBody", - "start": 17, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":17,"end":40,"loc":{"start":{"line":1,"column":17},"end":{"line":3,"column":1}}, "body": [ { "type": "TSCallSignatureDeclaration", - "start": 23, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":23,"end":38,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":19}}, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":23,"end":26,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}}, "params": [ { "type": "TSTypeParameter", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6}}, "name": "T" } ] @@ -158,63 +47,17 @@ "parameters": [ { "type": "Identifier", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "bar" - }, + "start":27,"end":33,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":14},"identifierName":"bar"}, "name": "bar", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":30,"end":33,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":32,"end":33,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14}}, "typeName": { "type": "Identifier", - "start": 32, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "G" - }, + "start":32,"end":33,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":14},"identifierName":"G"}, "name": "G" } } @@ -223,47 +66,13 @@ ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":34,"end":37,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":18}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":36,"end":37,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18}}, "typeName": { "type": "Identifier", - "start": 36, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "T" - }, + "start":36,"end":37,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"T"}, "name": "T" } } 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 d111311054..ed163c6994 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 @@ -1,108 +1,30 @@ { "type": "File", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ForStatement", - "start": 0, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":58,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "init": { "type": "VariableDeclaration", - "start": 5, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":5,"end":14,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 9, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":9,"end":14,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "i" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"i"}, "name": "i" }, "init": { "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": 0, "raw": "0" @@ -115,96 +37,28 @@ }, "test": { "type": "BinaryExpression", - "start": 16, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":16,"end":38,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":38}}, "left": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "i" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"i"}, "name": "i" }, "operator": "<", "right": { "type": "MemberExpression", - "start": 20, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":20,"end":38,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":38}}, "object": { "type": "CallExpression", - "start": 20, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":20,"end":34,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":34}}, "callee": { "type": "Identifier", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "require" - }, + "start":20,"end":27,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":27},"identifierName":"require"}, "name": "require" }, "arguments": [ { "type": "StringLiteral", - "start": 28, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":28,"end":33,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":33}}, "extra": { "rawValue": "foo", "raw": "'foo'" @@ -215,19 +69,7 @@ }, "property": { "type": "Identifier", - "start": 35, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 38 - }, - "identifierName": "bar" - }, + "start":35,"end":38,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":38},"identifierName":"bar"}, "name": "bar" }, "computed": false @@ -235,114 +77,34 @@ }, "update": { "type": "UpdateExpression", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":40,"end":43,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":43}}, "operator": "++", "prefix": false, "argument": { "type": "Identifier", - "start": 40, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 41 - }, - "identifierName": "i" - }, + "start":40,"end":41,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":41},"identifierName":"i"}, "name": "i" } }, "body": { "type": "BlockStatement", - "start": 45, - "end": 58, - "loc": { - "start": { - "line": 1, - "column": 45 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":45,"end":58,"loc":{"start":{"line":1,"column":45},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 51, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":51,"end":56,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":9}}, "expression": { "type": "CallExpression", - "start": 51, - "end": 55, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":51,"end":55,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":8}}, "callee": { "type": "Identifier", - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "x" - }, + "start":51,"end":52,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"x"}, "name": "x" }, "arguments": [ { "type": "Identifier", - "start": 53, - "end": 54, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "i" - }, + "start":53,"end":54,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"i"}, "name": "i" } ] 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 d62f3bba74..9369b9ba7d 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 @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":27}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, + "declare": true, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "C" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}}, "body": [] - }, - "declare": true + } }, { "type": "TSDeclareFunction", - "start": 20, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 27 - } - }, + "start":20,"end":47,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":27}}, "id": { "type": "Identifier", - "start": 37, - "end": 38, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "C" - }, + "start":37,"end":38,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"C"}, "name": "C" }, "generator": false, @@ -115,32 +36,10 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 40, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 26 - } - }, + "start":40,"end":46,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":26}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 42, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 26 - } - } + "start":42,"end":46,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":26}} } }, "declare": true diff --git a/packages/babel-parser/test/fixtures/typescript/scope/callable-class/output.json b/packages/babel-parser/test/fixtures/typescript/scope/callable-class/output.json index 205c683a02..e6a42390d2 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/callable-class/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/callable-class/output.json @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "program": { "type": "Program", - "start": 0, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":36,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "declare": true, "id": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "C" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"C"}, "name": "C" }, "superClass": null, "body": { "type": "ClassBody", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":16,"end":19,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":19}}, "body": [] } }, { "type": "FunctionDeclaration", - "start": 20, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":20,"end":36,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "C" - }, + "start":29,"end":30,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"C"}, "name": "C" }, "generator": false, @@ -115,18 +36,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 33, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":33,"end":36,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":16}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/enum-block-scoped/output.json b/packages/babel-parser/test/fixtures/typescript/scope/enum-block-scoped/output.json index ddaa635e8f..9c74c8de9d 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/enum-block-scoped/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/enum-block-scoped/output.json @@ -1,78 +1,22 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "BlockStatement", - "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}}, "body": [ { "type": "TSEnumDeclaration", - "start": 2, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":2,"end":13,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":13}}, "id": { "type": "Identifier", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "Foo" - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10},"identifierName":"Foo"}, "name": "Foo" }, "members": [] @@ -82,48 +26,14 @@ }, { "type": "VariableDeclaration", - "start": 16, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":16,"end":24,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}}, "declarations": [ { "type": "VariableDeclarator", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}}, "id": { "type": "Identifier", - "start": 20, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "Foo" - }, + "start":20,"end":23,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"Foo"}, "name": "Foo" }, "init": null 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 3532a53a3f..72f0f6635a 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 @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":15}}, "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":15}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSDeclareFunction", - "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}}, "id": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "foo" - }, + "start":17,"end":20,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":20},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,98 +20,30 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":22,"end":28,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":28}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 24, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":24,"end":28,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":28}} } }, "declare": true }, { "type": "ExportNamedDeclaration", - "start": 31, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":31,"end":46,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":15}}, "exportKind": "value", "specifiers": [ { "type": "ExportSpecifier", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":40,"end":43,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":12}}, "local": { "type": "Identifier", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 12 - }, - "identifierName": "foo" - }, + "start":40,"end":43,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":12},"identifierName":"foo"}, "name": "foo" }, "exported": { "type": "Identifier", - "start": 40, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 12 - }, - "identifierName": "foo" - }, + "start":40,"end":43,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":12},"identifierName":"foo"}, "name": "foo" } } 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 df5b73f76c..2dc87e91b6 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 @@ -1,96 +1,28 @@ { "type": "File", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":29}}, "program": { "type": "Program", - "start": 0, - "end": 46, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":0,"end":46,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":29}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "exportKind": "value", "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, "local": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "exported": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" } } @@ -100,33 +32,10 @@ }, { "type": "TSDeclareFunction", - "start": 17, - "end": 46, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 29 - } - }, + "start":17,"end":46,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":29}}, "id": { "type": "Identifier", - "start": 34, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 20 - }, - "identifierName": "foo" - }, + "start":34,"end":37,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":20},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -134,32 +43,10 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 39, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 22 - }, - "end": { - "line": 3, - "column": 28 - } - }, + "start":39,"end":45,"loc":{"start":{"line":3,"column":22},"end":{"line":3,"column":28}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 41, - "end": 45, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 28 - } - } + "start":41,"end":45,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":28}} } }, "declare": true diff --git a/packages/babel-parser/test/fixtures/typescript/scope/export-enum-after/output.json b/packages/babel-parser/test/fixtures/typescript/scope/export-enum-after/output.json index 4033028297..46d31f603b 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/export-enum-after/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/export-enum-after/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 26 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 26 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "start": 47, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":47,"end":59,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "id": { "type": "Identifier", - "start": 52, - "end": 56, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "Test" - }, + "start":52,"end":56,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":9},"identifierName":"Test"}, "name": "Test" }, "members": [], @@ -65,83 +20,26 @@ { "type": "CommentLine", "value": " https://github.com/babel/babel/issues/9763", - "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}} } ] }, { "type": "ExportNamedDeclaration", - "start": 61, - "end": 87, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 26 - } - }, + "start":61,"end":87,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":26}}, "exportKind": "value", "specifiers": [ { "type": "ExportSpecifier", - "start": 70, - "end": 85, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 24 - } - }, + "start":70,"end":85,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":24}}, "local": { "type": "Identifier", - "start": 70, - "end": 74, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 13 - }, - "identifierName": "Test" - }, + "start":70,"end":74,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":13},"identifierName":"Test"}, "name": "Test" }, "exported": { "type": "Identifier", - "start": 78, - "end": 85, - "loc": { - "start": { - "line": 5, - "column": 17 - }, - "end": { - "line": 5, - "column": 24 - }, - "identifierName": "default" - }, + "start":78,"end":85,"loc":{"start":{"line":5,"column":17},"end":{"line":5,"column":24},"identifierName":"default"}, "name": "default" } } @@ -156,18 +54,7 @@ { "type": "CommentLine", "value": " https://github.com/babel/babel/issues/9763", - "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}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/scope/export-enum-before/output.json b/packages/babel-parser/test/fixtures/typescript/scope/export-enum-before/output.json index 40da2edef6..1ee9c0bf6b 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/export-enum-before/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/export-enum-before/output.json @@ -1,96 +1,28 @@ { "type": "File", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":12}}, "program": { "type": "Program", - "start": 0, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":0,"end":40,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":12}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "exportKind": "value", "specifiers": [ { "type": "ExportSpecifier", - "start": 9, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":9,"end":24,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":24}}, "local": { "type": "Identifier", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "Test" - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13},"identifierName":"Test"}, "name": "Test" }, "exported": { "type": "Identifier", - "start": 17, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "default" - }, + "start":17,"end":24,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":24},"identifierName":"default"}, "name": "default" } } @@ -100,33 +32,10 @@ }, { "type": "TSEnumDeclaration", - "start": 28, - "end": 40, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":28,"end":40,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":12}}, "id": { "type": "Identifier", - "start": 33, - "end": 37, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 9 - }, - "identifierName": "Test" - }, + "start":33,"end":37,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":9},"identifierName":"Test"}, "name": "Test" }, "members": [] diff --git a/packages/babel-parser/test/fixtures/typescript/scope/export-interface-after/output.json b/packages/babel-parser/test/fixtures/typescript/scope/export-interface-after/output.json index 263dec8e48..b246384688 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/export-interface-after/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/export-interface-after/output.json @@ -1,144 +1,42 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSInterfaceBody", - "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}}, "body": [] } }, { "type": "ExportNamedDeclaration", - "start": 15, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":15,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "exportKind": "value", "specifiers": [ { "type": "ExportSpecifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "local": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "A" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"A"}, "name": "A" }, "exported": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "A" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"A"}, "name": "A" } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/export-interface-before/output.json b/packages/babel-parser/test/fixtures/typescript/scope/export-interface-before/output.json index b568f8c098..1d0567998e 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/export-interface-before/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/export-interface-before/output.json @@ -1,96 +1,28 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "exportKind": "value", "specifiers": [ { "type": "ExportSpecifier", - "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}}, "local": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "A" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"A"}, "name": "A" }, "exported": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "A" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"A"}, "name": "A" } } @@ -100,49 +32,15 @@ }, { "type": "TSInterfaceDeclaration", - "start": 14, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":14,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "A" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSInterfaceBody", - "start": 26, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":26,"end":28,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/export-namespace/output.json b/packages/babel-parser/test/fixtures/typescript/scope/export-namespace/output.json index 301c98de69..80c8faf0bb 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/export-namespace/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/export-namespace/output.json @@ -1,144 +1,42 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":13}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSModuleDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "N" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"N"}, "name": "N" }, "body": { "type": "TSModuleBlock", - "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}}, "body": [] } }, { "type": "ExportNamedDeclaration", - "start": 16, - "end": 29, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":16,"end":29,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":13}}, "exportKind": "value", "specifiers": [ { "type": "ExportSpecifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - } - }, + "start":25,"end":26,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10}}, "local": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "N" - }, + "start":25,"end":26,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"N"}, "name": "N" }, "exported": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "N" - }, + "start":25,"end":26,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"N"}, "name": "N" } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/export-type-after/output.json b/packages/babel-parser/test/fixtures/typescript/scope/export-type-after/output.json index 3053978d88..b5f2fb8ebd 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/export-type-after/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/export-type-after/output.json @@ -1,143 +1,41 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } }, { "type": "ExportNamedDeclaration", - "start": 17, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":17,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "exportKind": "value", "specifiers": [ { "type": "ExportSpecifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "local": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "A" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"A"}, "name": "A" }, "exported": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "A" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"A"}, "name": "A" } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/export-type-before/output.json b/packages/babel-parser/test/fixtures/typescript/scope/export-type-before/output.json index 7b700a883b..3da921f988 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/export-type-before/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/export-type-before/output.json @@ -1,96 +1,28 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "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}}, "exportKind": "value", "specifiers": [ { "type": "ExportSpecifier", - "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}}, "local": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "A" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"A"}, "name": "A" }, "exported": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "A" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"A"}, "name": "A" } } @@ -100,49 +32,15 @@ }, { "type": "TSTypeAliasDeclaration", - "start": 14, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":14,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "A" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"A"}, "name": "A" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":23,"end":29,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} } } ], diff --git a/packages/babel-parser/test/fixtures/typescript/scope/function-type-before-declaration/output.json b/packages/babel-parser/test/fixtures/typescript/scope/function-type-before-declaration/output.json index d3685c7d0d..54e57b9a6d 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/function-type-before-declaration/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/function-type-before-declaration/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":0,"end":50,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":13}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSDeclareFunction", - "start": 0, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":0,"end":19,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,64 +20,19 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 12, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":12,"end":18,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":18}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 14, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 18 - } - } + "start":14,"end":18,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":18}} } } }, { "type": "FunctionDeclaration", - "start": 20, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":20,"end":35,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "f" - }, + "start":29,"end":30,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -130,84 +40,27 @@ "params": [], "body": { "type": "BlockStatement", - "start": 33, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":33,"end":35,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "body": [], "directives": [] } }, { "type": "ExportNamedDeclaration", - "start": 37, - "end": 50, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":37,"end":50,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":13}}, "exportKind": "value", "specifiers": [ { "type": "ExportSpecifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 10 - } - }, + "start":46,"end":47,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10}}, "local": { "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 10 - }, - "identifierName": "f" - }, + "start":46,"end":47,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10},"identifierName":"f"}, "name": "f" }, "exported": { "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 10 - }, - "identifierName": "f" - }, + "start":46,"end":47,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":10},"identifierName":"f"}, "name": "f" } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var-2/output.json b/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var-2/output.json index e1b72e08c7..4d37ea056a 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var-2/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var-2/output.json @@ -1,220 +1,63 @@ { "type": "File", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 59, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":59,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "declare": true, "id": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"foo"}, "name": "foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":2,"column":1}}, "body": [] } }, { "type": "TSModuleDeclaration", - "start": 22, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":22,"end":59,"loc":{"start":{"line":3,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "bar" - }, + "start":29,"end":32,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":10},"identifierName":"bar"}, "name": "bar" }, "body": { "type": "TSModuleBlock", - "start": 33, - "end": 59, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":33,"end":59,"loc":{"start":{"line":3,"column":11},"end":{"line":5,"column":1}}, "body": [ { "type": "ExportNamedDeclaration", - "start": 37, - "end": 57, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 22 - } - }, + "start":37,"end":57,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":22}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 44, - "end": 57, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 22 - } - }, + "start":44,"end":57,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 48, - "end": 56, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 21 - } - }, + "start":48,"end":56,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":21}}, "id": { "type": "Identifier", - "start": 48, - "end": 56, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 21 - }, - "identifierName": "foo" - }, + "start":48,"end":56,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":21},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 51, - "end": 56, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 21 - } - }, + "start":51,"end":56,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":21}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 53, - "end": 56, - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 21 - } - } + "start":53,"end":56,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":21}} } } }, diff --git a/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var/output.json b/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var/output.json index 0de95961df..b5e7e60123 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/module-declaration-var/output.json @@ -1,112 +1,34 @@ { "type": "File", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 69, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":0,"end":69,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":1}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":1}}, "declare": true, "id": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "foo" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"foo"}, "name": "foo" }, "superClass": null, "body": { "type": "ClassBody", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":18,"end":21,"loc":{"start":{"line":1,"column":18},"end":{"line":2,"column":1}}, "body": [] } }, { "type": "TSModuleDeclaration", - "start": 22, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":22,"end":69,"loc":{"start":{"line":3,"column":0},"end":{"line":5,"column":1}}, "id": { "type": "StringLiteral", - "start": 37, - "end": 42, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 20 - } - }, + "start":37,"end":42,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":20}}, "extra": { "rawValue": "bar", "raw": "'bar'" @@ -115,109 +37,31 @@ }, "body": { "type": "TSModuleBlock", - "start": 43, - "end": 69, - "loc": { - "start": { - "line": 3, - "column": 21 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":43,"end":69,"loc":{"start":{"line":3,"column":21},"end":{"line":5,"column":1}}, "body": [ { "type": "ExportNamedDeclaration", - "start": 47, - "end": 67, - "loc": { - "start": { - "line": 4, - "column": 2 - }, - "end": { - "line": 4, - "column": 22 - } - }, + "start":47,"end":67,"loc":{"start":{"line":4,"column":2},"end":{"line":4,"column":22}}, "exportKind": "value", "specifiers": [], "source": null, "declaration": { "type": "VariableDeclaration", - "start": 54, - "end": 67, - "loc": { - "start": { - "line": 4, - "column": 9 - }, - "end": { - "line": 4, - "column": 22 - } - }, + "start":54,"end":67,"loc":{"start":{"line":4,"column":9},"end":{"line":4,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 58, - "end": 66, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 21 - } - }, + "start":58,"end":66,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":21}}, "id": { "type": "Identifier", - "start": 58, - "end": 66, - "loc": { - "start": { - "line": 4, - "column": 13 - }, - "end": { - "line": 4, - "column": 21 - }, - "identifierName": "foo" - }, + "start":58,"end":66,"loc":{"start":{"line":4,"column":13},"end":{"line":4,"column":21},"identifierName":"foo"}, "name": "foo", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 61, - "end": 66, - "loc": { - "start": { - "line": 4, - "column": 16 - }, - "end": { - "line": 4, - "column": 21 - } - }, + "start":61,"end":66,"loc":{"start":{"line":4,"column":16},"end":{"line":4,"column":21}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 63, - "end": 66, - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 21 - } - } + "start":63,"end":66,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":21}} } } }, diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/output.json index 5642df62a5..b3b42d74d8 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-class/output.json @@ -1,132 +1,42 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "body": [] } }, { "type": "ClassDeclaration", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":11,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "A" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":10}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/output.json index 6d6bbe9626..a1cc8e60fc 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-enum/output.json @@ -1,115 +1,36 @@ { "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "body": [] } }, { "type": "TSEnumDeclaration", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":11,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "A" - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"A"}, "name": "A" }, "members": [] diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-interface/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-interface/output.json index b44cc7caf5..aa8b62bd86 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-interface/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-interface/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "body": [] } }, { "type": "TSInterfaceDeclaration", - "start": 11, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":11,"end":25,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "A" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSInterfaceBody", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/output.json index c6886d1947..caddda18d8 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-class-type/output.json @@ -1,131 +1,41 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "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}}, "id": { "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" }, "superClass": null, "body": { "type": "ClassBody", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "body": [] } }, { "type": "TSTypeAliasDeclaration", - "start": 11, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":11,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "A" - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"A"}, "name": "A" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":20,"end":26,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} } } ], diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-const-type/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-const-type/output.json index b51eb30f5c..ceb37c4d1a 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-const-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-const-type/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "id": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "X" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"X"}, "name": "X" }, "init": { "type": "StringLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "extra": { "rawValue": "", "raw": "\"\"" @@ -101,49 +34,15 @@ }, { "type": "TSTypeAliasDeclaration", - "start": 14, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":14,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "X" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"X"}, "name": "X" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":23,"end":29,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} } } ], diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-constenum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-constenum/output.json index 2120fa78e3..d8c2160f1f 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-constenum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-constenum/output.json @@ -1,98 +1,30 @@ { "type": "File", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "program": { "type": "Program", - "start": 0, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":35,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "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}}, "const": true, "id": { "type": "Identifier", - "start": 11, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "Foo" - }, + "start":11,"end":14,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":14},"identifierName":"Foo"}, "name": "Foo" }, "members": [] }, { "type": "TSEnumDeclaration", - "start": 18, - "end": 35, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":18,"end":35,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "const": true, "id": { "type": "Identifier", - "start": 29, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 14 - }, - "identifierName": "Foo" - }, + "start":29,"end":32,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":14},"identifierName":"Foo"}, "name": "Foo" }, "members": [] diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/output.json index b6b67ebef9..baf3fa807a 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-constenum-enum/output.json @@ -1,100 +1,32 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "errors": [ "SyntaxError: Identifier 'X' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "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}}, "const": true, "id": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "X" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"X"}, "name": "X" }, "members": [] }, { "type": "TSEnumDeclaration", - "start": 16, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":16,"end":25,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "X" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"X"}, "name": "X" }, "members": [] diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/output.json index 8518fac0e7..6a310f8171 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-class/output.json @@ -1,116 +1,37 @@ { "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ "SyntaxError: Identifier 'X' has already been declared (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "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}}, "id": { "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" }, "members": [] }, { "type": "ClassDeclaration", - "start": 10, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":10,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "id": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "X" - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"X"}, "name": "X" }, "superClass": null, "body": { "type": "ClassBody", - "start": 18, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":18,"end":20,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":10}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/output.json index 8a9778e368..0660bfd166 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-constenum/output.json @@ -1,100 +1,32 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "errors": [ "SyntaxError: Identifier 'X' has already been declared (2:11)" ], "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "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}}, "id": { "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" }, "members": [] }, { "type": "TSEnumDeclaration", - "start": 10, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":10,"end":25,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":15}}, "const": true, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 11 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "X" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":11},"end":{"line":2,"column":12},"identifierName":"X"}, "name": "X" }, "members": [] diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-enum/output.json index a270131731..fe1203f2f8 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-enum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-enum/output.json @@ -1,96 +1,28 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "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}}, "id": { "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" }, "members": [] }, { "type": "TSEnumDeclaration", - "start": 12, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":12,"end":23,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 17, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "Foo" - }, + "start":17,"end":20,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8},"identifierName":"Foo"}, "name": "Foo" }, "members": [] diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/output.json index ab31065f58..d254111a61 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-function/output.json @@ -1,99 +1,31 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "errors": [ "SyntaxError: Identifier 'Foo' has already been declared (2:9)" ], "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":17}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "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}}, "id": { "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" }, "members": [] }, { "type": "FunctionDeclaration", - "start": 12, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":12,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":17}}, "id": { "type": "Identifier", - "start": 21, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "Foo" - }, + "start":21,"end":24,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":12},"identifierName":"Foo"}, "name": "Foo" }, "generator": false, @@ -101,18 +33,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 15 - }, - "end": { - "line": 2, - "column": 17 - } - }, + "start":27,"end":29,"loc":{"start":{"line":2,"column":15},"end":{"line":2,"column":17}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/output.json index 80905a927d..62bf37e86c 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-interface/output.json @@ -1,115 +1,36 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ "SyntaxError: Identifier 'X' has already been declared (2:10)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "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}}, "id": { "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" }, "members": [] }, { "type": "TSInterfaceDeclaration", - "start": 10, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":10,"end":24,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "X" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"X"}, "name": "X" }, "body": { "type": "TSInterfaceBody", - "start": 22, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":22,"end":24,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/output.json index 4f8b478357..cf541c4247 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-let/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "errors": [ "SyntaxError: Identifier 'Foo' has already been declared (2:4)" ], "program": { "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "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}}, "id": { "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" }, "members": [] }, { "type": "VariableDeclaration", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":12,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}}, "declarations": [ { "type": "VariableDeclarator", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":16,"end":19,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}}, "id": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "Foo" - }, + "start":16,"end":19,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"Foo"}, "name": "Foo" }, "init": null diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/output.json index e347d9e0a5..7b8d2e208c 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-type/output.json @@ -1,115 +1,36 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "errors": [ "SyntaxError: Identifier 'X' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "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}}, "id": { "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" }, "members": [] }, { "type": "TSTypeAliasDeclaration", - "start": 10, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":10,"end":26,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "id": { "type": "Identifier", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "X" - }, + "start":15,"end":16,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"X"}, "name": "X" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":19,"end":25,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} } } ], diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/output.json index 4f8b478357..cf541c4247 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-enum-var/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "errors": [ "SyntaxError: Identifier 'Foo' has already been declared (2:4)" ], "program": { "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":8}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSEnumDeclaration", - "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}}, "id": { "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" }, "members": [] }, { "type": "VariableDeclaration", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":12,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":8}}, "declarations": [ { "type": "VariableDeclarator", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":16,"end":19,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7}}, "id": { "type": "Identifier", - "start": 16, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "Foo" - }, + "start":16,"end":19,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":7},"identifierName":"Foo"}, "name": "Foo" }, "init": null diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/output.json index c8a1a8f8dc..2613394dc0 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-enum/output.json @@ -1,66 +1,21 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "errors": [ "SyntaxError: Identifier 'Foo' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "Foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"Foo"}, "name": "Foo" }, "generator": false, @@ -68,51 +23,17 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } }, { "type": "TSEnumDeclaration", - "start": 18, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":18,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 23, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "Foo" - }, + "start":23,"end":26,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8},"identifierName":"Foo"}, "name": "Foo" }, "members": [] diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-interface/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-interface/output.json index 13e97e869b..b5b280602a 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-interface/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-interface/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "A" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"A"}, "name": "A" }, "generator": false, @@ -65,67 +20,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "body": [], "directives": [] } }, { "type": "TSInterfaceDeclaration", - "start": 16, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":16,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "A" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSInterfaceBody", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":28,"end":30,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-type/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-type/output.json index 4258090807..7b3e29f9ad 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-function-type/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "A" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"A"}, "name": "A" }, "generator": false, @@ -65,67 +20,22 @@ "params": [], "body": { "type": "BlockStatement", - "start": 13, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":13,"end":15,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":15}}, "body": [], "directives": [] } }, { "type": "TSTypeAliasDeclaration", - "start": 16, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":16,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "A" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"A"}, "name": "A" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 25, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":25,"end":31,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} } } ], diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-import-ambient-class/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-import-ambient-class/output.json index 351802cc62..479d69c1a1 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-import-ambient-class/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-import-ambient-class/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 26 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 66, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 26 - } - }, + "start":0,"end":66,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":26}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "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}}, "importKind": "value", "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 7, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":7,"end":16,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":16}}, "local": { "type": "Identifier", - "start": 7, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 16 - }, - "identifierName": "Something" - }, + "start":7,"end":16,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":16},"identifierName":"Something"}, "name": "Something" } } ], "source": { "type": "StringLiteral", - "start": 22, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":22,"end":38,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":38}}, "extra": { "rawValue": "./somewhere.js", "raw": "'./somewhere.js'" @@ -101,51 +34,17 @@ }, { "type": "ClassDeclaration", - "start": 40, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 26 - } - }, + "start":40,"end":66,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":26}}, "declare": true, "id": { "type": "Identifier", - "start": 54, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 23 - }, - "identifierName": "Something" - }, + "start":54,"end":63,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":23},"identifierName":"Something"}, "name": "Something" }, "superClass": null, "body": { "type": "ClassBody", - "start": 64, - "end": 66, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 26 - } - }, + "start":64,"end":66,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":26}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-class/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-class/output.json index 5b0af1060c..49647a7e08 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-class/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-class/output.json @@ -1,128 +1,38 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSInterfaceBody", - "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}}, "body": [] } }, { "type": "ClassDeclaration", - "start": 15, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":15,"end":25,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "A" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 23, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":23,"end":25,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":10}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/output.json index 63b26bca44..27a720cd09 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-enum/output.json @@ -1,114 +1,35 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "errors": [ "SyntaxError: Identifier 'X' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "X" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"X"}, "name": "X" }, "body": { "type": "TSInterfaceBody", - "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}}, "body": [] } }, { "type": "TSEnumDeclaration", - "start": 15, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":15,"end":24,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "X" - }, + "start":20,"end":21,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"X"}, "name": "X" }, "members": [] diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-function/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-function/output.json index 166403881b..390d3ba24d 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-function/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-function/output.json @@ -1,111 +1,32 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSInterfaceBody", - "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}}, "body": [] } }, { "type": "FunctionDeclaration", - "start": 15, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":15,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "A" - }, + "start":24,"end":25,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"A"}, "name": "A" }, "generator": false, @@ -113,18 +34,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 28, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":28,"end":30,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-interface/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-interface/output.json index 598f4999cf..c109866762 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-interface/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-interface/output.json @@ -1,127 +1,37 @@ { "type": "File", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":29,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSInterfaceBody", - "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}}, "body": [] } }, { "type": "TSInterfaceDeclaration", - "start": 15, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":15,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "A" - }, + "start":25,"end":26,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSInterfaceBody", - "start": 27, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":27,"end":29,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-let/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-let/output.json index 0c96b1cd89..55bc9a70c4 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-let/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-let/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSInterfaceBody", - "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}}, "body": [] } }, { "type": "VariableDeclaration", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":15,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "declarations": [ { "type": "VariableDeclarator", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "A" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"A"}, "name": "A" }, "init": null diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-var/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-var/output.json index e353b5cd0b..873109cdac 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-var/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-interface-var/output.json @@ -1,126 +1,36 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSInterfaceDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "A" - }, + "start":10,"end":11,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":11},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSInterfaceBody", - "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}}, "body": [] } }, { "type": "VariableDeclaration", - "start": 15, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":15,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "declarations": [ { "type": "VariableDeclarator", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}}, "id": { "type": "Identifier", - "start": 19, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "A" - }, + "start":19,"end":20,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"A"}, "name": "A" }, "init": null diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/output.json index 1c1cfb5c16..cb3f09c087 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-enum/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "errors": [ "SyntaxError: Identifier 'Foo' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "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" }, "init": null @@ -85,33 +29,10 @@ }, { "type": "TSEnumDeclaration", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":9,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "Foo" - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8},"identifierName":"Foo"}, "name": "Foo" }, "members": [] diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-interface/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-interface/output.json index d1833f6413..46c02e61c9 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-interface/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-interface/output.json @@ -1,78 +1,22 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "A" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"A"}, "name": "A" }, "init": null @@ -82,49 +26,15 @@ }, { "type": "TSInterfaceDeclaration", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":7,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "A" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSInterfaceBody", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-type/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-type/output.json index 8c157d8a36..9de57fd629 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-let-type/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "X" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"X"}, "name": "X" }, "init": { "type": "StringLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": "", "raw": "\"\"" @@ -101,49 +34,15 @@ }, { "type": "TSTypeAliasDeclaration", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "X" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"X"}, "name": "X" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":21,"end":27,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} } } ], diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/output.json index 3e63a0f7f2..7738c56de6 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-class/output.json @@ -1,130 +1,40 @@ { "type": "File", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:6)" ], "program": { "type": "Program", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } }, { "type": "ClassDeclaration", - "start": 17, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":17,"end":27,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "id": { "type": "Identifier", - "start": 23, - "end": 24, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "A" - }, + "start":23,"end":24,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"A"}, "name": "A" }, "superClass": null, "body": { "type": "ClassBody", - "start": 25, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":25,"end":27,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":10}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/output.json index ba27b683a4..775af30641 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-enum/output.json @@ -1,113 +1,34 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":9}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } }, { "type": "TSEnumDeclaration", - "start": 17, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":17,"end":26,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":9}}, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "A" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"A"}, "name": "A" }, "members": [] diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-function/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-function/output.json index 805839ca3c..a301d8fa07 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-function/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-function/output.json @@ -1,110 +1,31 @@ { "type": "File", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "program": { "type": "Program", - "start": 0, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":0,"end":32,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":15}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } }, { "type": "FunctionDeclaration", - "start": 17, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":17,"end":32,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 26, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "A" - }, + "start":26,"end":27,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"A"}, "name": "A" }, "generator": false, @@ -112,18 +33,7 @@ "params": [], "body": { "type": "BlockStatement", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 13 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":30,"end":32,"loc":{"start":{"line":2,"column":13},"end":{"line":2,"column":15}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/output.json index 4983be3664..2e27314bf5 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-interface/output.json @@ -1,129 +1,39 @@ { "type": "File", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:10)" ], "program": { "type": "Program", - "start": 0, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":31,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } }, { "type": "TSInterfaceDeclaration", - "start": 17, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":17,"end":31,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 27, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "A" - }, + "start":27,"end":28,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSInterfaceBody", - "start": 29, - "end": 31, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":29,"end":31,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-let/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-let/output.json index fb4fc242ea..c0b3d027b1 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-let/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-let/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } }, { "type": "VariableDeclaration", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":17,"end":23,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "declarations": [ { "type": "VariableDeclarator", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "A" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"A"}, "name": "A" }, "init": null diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/output.json index 02fde75620..48fee42b09 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-type/output.json @@ -1,129 +1,39 @@ { "type": "File", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "errors": [ "SyntaxError: Identifier 'A' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":33,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } }, { "type": "TSTypeAliasDeclaration", - "start": 17, - "end": 33, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":17,"end":33,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "id": { "type": "Identifier", - "start": 22, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "A" - }, + "start":22,"end":23,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"A"}, "name": "A" }, "typeAnnotation": { "type": "TSStringKeyword", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":26,"end":32,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} } } ], diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-var/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-var/output.json index 8a2375272f..32a03fa8d7 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-var/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-type-var/output.json @@ -1,125 +1,35 @@ { "type": "File", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "program": { "type": "Program", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":6}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "A" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"A"}, "name": "A" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } }, { "type": "VariableDeclaration", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":17,"end":23,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":6}}, "declarations": [ { "type": "VariableDeclarator", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5}}, "id": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "A" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"A"}, "name": "A" }, "init": null diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/output.json index 1c1cfb5c16..cb3f09c087 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-enum/output.json @@ -1,81 +1,25 @@ { "type": "File", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "errors": [ "SyntaxError: Identifier 'Foo' has already been declared (2:5)" ], "program": { "type": "Program", - "start": 0, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":0,"end":20,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":11}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":4,"end":7,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":7}}, "id": { "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" }, "init": null @@ -85,33 +29,10 @@ }, { "type": "TSEnumDeclaration", - "start": 9, - "end": 20, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":9,"end":20,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "id": { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - }, - "identifierName": "Foo" - }, + "start":14,"end":17,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8},"identifierName":"Foo"}, "name": "Foo" }, "members": [] diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-interface/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-interface/output.json index 068b9e0779..1dd2dd5d62 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-interface/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-interface/output.json @@ -1,78 +1,22 @@ { "type": "File", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":21,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "A" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"A"}, "name": "A" }, "init": null @@ -82,49 +26,15 @@ }, { "type": "TSInterfaceDeclaration", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":7,"end":21,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 11 - }, - "identifierName": "A" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":11},"identifierName":"A"}, "name": "A" }, "body": { "type": "TSInterfaceBody", - "start": 19, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 12 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":19,"end":21,"loc":{"start":{"line":2,"column":12},"end":{"line":2,"column":14}}, "body": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-type/output.json b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-type/output.json index 6cfc11c093..b8b8f8ad71 100644 --- a/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-type/output.json +++ b/packages/babel-parser/test/fixtures/typescript/scope/redeclaration-var-type/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":16}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "id": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "X" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"X"}, "name": "X" }, "init": { "type": "StringLiteral", - "start": 8, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":8,"end":10,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":10}}, "extra": { "rawValue": "", "raw": "\"\"" @@ -101,49 +34,15 @@ }, { "type": "TSTypeAliasDeclaration", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "id": { "type": "Identifier", - "start": 17, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "X" - }, + "start":17,"end":18,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"X"}, "name": "X" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 21, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":21,"end":27,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":15}} } } ], diff --git a/packages/babel-parser/test/fixtures/typescript/tsx/brace-is-block/output.json b/packages/babel-parser/test/fixtures/typescript/tsx/brace-is-block/output.json index ec9f551e1f..851aa22923 100644 --- a/packages/babel-parser/test/fixtures/typescript/tsx/brace-is-block/output.json +++ b/packages/babel-parser/test/fixtures/typescript/tsx/brace-is-block/output.json @@ -1,126 +1,35 @@ { "type": "File", - "start": 0, - "end": 127, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":0,"end":127,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":4}}, "program": { "type": "Program", - "start": 0, - "end": 127, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":0,"end":127,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":4}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ClassDeclaration", - "start": 99, - "end": 122, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":99,"end":122,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}}, "id": { "type": "Identifier", - "start": 105, - "end": 106, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "C" - }, + "start":105,"end":106,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"C"}, "name": "C" }, "superClass": { "type": "Identifier", - "start": 115, - "end": 116, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 17 - }, - "identifierName": "D" - }, + "start":115,"end":116,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":17},"identifierName":"D"}, "name": "D" }, "superTypeParameters": { "type": "TSTypeParameterInstantiation", - "start": 116, - "end": 119, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":116,"end":119,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":20}}, "params": [ { "type": "TSTypeReference", - "start": 117, - "end": 118, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":117,"end":118,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19}}, "typeName": { "type": "Identifier", - "start": 117, - "end": 118, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 19 - }, - "identifierName": "T" - }, + "start":117,"end":118,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":19},"identifierName":"T"}, "name": "T" } } @@ -128,98 +37,32 @@ }, "body": { "type": "ClassBody", - "start": 120, - "end": 122, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":120,"end":122,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":23}}, "body": [] }, "leadingComments": [ { "type": "CommentLine", "value": " Regression test for tokenizer bug where the `{` after `` was considered a JSX interpolation.", - "start": 0, - "end": 98, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 98 - } - } + "start":0,"end":98,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":98}} } ] }, { "type": "ExpressionStatement", - "start": 123, - "end": 127, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":123,"end":127,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":4}}, "expression": { "type": "JSXElement", - "start": 123, - "end": 127, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 4 - } - }, + "start":123,"end":127,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":4}}, "openingElement": { "type": "JSXOpeningElement", - "start": 123, - "end": 127, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 4 - } - }, - "attributes": [], + "start":123,"end":127,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":4}}, "name": { "type": "JSXIdentifier", - "start": 124, - "end": 125, - "loc": { - "start": { - "line": 3, - "column": 1 - }, - "end": { - "line": 3, - "column": 2 - } - }, + "start":124,"end":125,"loc":{"start":{"line":3,"column":1},"end":{"line":3,"column":2}}, "name": "C" }, + "attributes": [], "selfClosing": true }, "closingElement": null, @@ -233,18 +76,7 @@ { "type": "CommentLine", "value": " Regression test for tokenizer bug where the `{` after `` was considered a JSX interpolation.", - "start": 0, - "end": 98, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 98 - } - } + "start":0,"end":98,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":98}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/tsx/type-arguments/output.json b/packages/babel-parser/test/fixtures/typescript/tsx/type-arguments/output.json index a61beb416a..f29bd2729b 100644 --- a/packages/babel-parser/test/fixtures/typescript/tsx/type-arguments/output.json +++ b/packages/babel-parser/test/fixtures/typescript/tsx/type-arguments/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "arguments": [], "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "params": [ { "type": "TSTypeReference", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "typeName": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "T" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"T"}, "name": "T" } } @@ -128,93 +38,25 @@ }, { "type": "ExpressionStatement", - "start": 8, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":8,"end":19,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":11}}, "expression": { "type": "NewExpression", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":8,"end":18,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "callee": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "C" - }, + "start":12,"end":13,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"C"}, "name": "C" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 13, - "end": 16, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 8 - } - }, + "start":13,"end":16,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":8}}, "params": [ { "type": "TSTypeReference", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "typeName": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "T" - }, + "start":14,"end":15,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"T"}, "name": "T" } } @@ -225,110 +67,30 @@ }, { "type": "TSTypeAliasDeclaration", - "start": 20, - "end": 34, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":20,"end":34,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":14}}, "id": { "type": "Identifier", - "start": 25, - "end": 26, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 6 - }, - "identifierName": "A" - }, + "start":25,"end":26,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":6},"identifierName":"A"}, "name": "A" }, "typeAnnotation": { "type": "TSTypeReference", - "start": 29, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":29,"end":33,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":13}}, "typeName": { "type": "Identifier", - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 3, - "column": 9 - }, - "end": { - "line": 3, - "column": 10 - }, - "identifierName": "T" - }, + "start":29,"end":30,"loc":{"start":{"line":3,"column":9},"end":{"line":3,"column":10},"identifierName":"T"}, "name": "T" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 30, - "end": 33, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 13 - } - }, + "start":30,"end":33,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":13}}, "params": [ { "type": "TSTypeReference", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 12 - } - }, + "start":31,"end":32,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":12}}, "typeName": { "type": "Identifier", - "start": 31, - "end": 32, - "loc": { - "start": { - "line": 3, - "column": 11 - }, - "end": { - "line": 3, - "column": 12 - }, - "identifierName": "T" - }, + "start":31,"end":32,"loc":{"start":{"line":3,"column":11},"end":{"line":3,"column":12},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/typescript/tsx/type-parameters/output.json b/packages/babel-parser/test/fixtures/typescript/tsx/type-parameters/output.json index 6a3a623457..f4a610d0d3 100644 --- a/packages/babel-parser/test/fixtures/typescript/tsx/type-parameters/output.json +++ b/packages/babel-parser/test/fixtures/typescript/tsx/type-parameters/output.json @@ -1,63 +1,18 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, @@ -65,61 +20,17 @@ "params": [], "returnType": { "type": "TSTypeAnnotation", - "start": 12, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":12,"end":29,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":29}}, "typeAnnotation": { "type": "TSFunctionType", - "start": 14, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":14,"end":29,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":29}}, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "params": [ { "type": "TSTypeParameter", - "start": 15, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 15 - }, - "end": { - "line": 1, - "column": 16 - } - }, + "start":15,"end":16,"loc":{"start":{"line":1,"column":15},"end":{"line":1,"column":16}}, "name": "T" } ] @@ -127,50 +38,17 @@ "parameters": [], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 20, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":20,"end":29,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":29}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - } - } + "start":23,"end":29,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":29}} } } } }, "body": { "type": "BlockStatement", - "start": 30, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 30 - }, - "end": { - "line": 1, - "column": 32 - } - }, + "start":30,"end":32,"loc":{"start":{"line":1,"column":30},"end":{"line":1,"column":32}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/type-alias/declare/output.json b/packages/babel-parser/test/fixtures/typescript/type-alias/declare/output.json index a172139f6a..fcf7b553f9 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-alias/declare/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-alias/declare/output.json @@ -1,79 +1,23 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"T"}, "name": "T" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} }, "declare": true } diff --git a/packages/babel-parser/test/fixtures/typescript/type-alias/export/output.json b/packages/babel-parser/test/fixtures/typescript/type-alias/export/output.json index 7f9c1f9fd3..0e13050d39 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-alias/export/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-alias/export/output.json @@ -1,114 +1,36 @@ { "type": "File", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":38}}, "program": { "type": "Program", - "start": 0, - "end": 62, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 38 - } - }, + "start":0,"end":62,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":38}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExportNamedDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "exportKind": "type", "specifiers": [], "source": null, "declaration": { "type": "TSTypeAliasDeclaration", - "start": 7, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":7,"end":23,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":23}}, "id": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "T" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"T"}, "name": "T" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} } }, "trailingComments": [ { "type": "CommentLine", "value": " `export default type` is not valid.", - "start": 24, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 38 - } - } + "start":24,"end":62,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":38}} } ] } @@ -119,18 +41,7 @@ { "type": "CommentLine", "value": " `export default type` is not valid.", - "start": 24, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 38 - } - } + "start":24,"end":62,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":38}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/type-alias/generic-complex-tokens-true/output.json b/packages/babel-parser/test/fixtures/typescript/type-alias/generic-complex-tokens-true/output.json index e92d91a761..844c6486be 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-alias/generic-complex-tokens-true/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-alias/generic-complex-tokens-true/output.json @@ -1,185 +1,51 @@ { "type": "File", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "program": { "type": "Program", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "start": 0, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":0,"end":52,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":52}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "T" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 6, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":6,"end":40,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":40}}, "params": [ { "type": "TSTypeParameter", - "start": 7, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":7,"end":39,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":39}}, "name": "U", "constraint": { "type": "TSObjectKeyword", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} }, "default": { "type": "TSTypeLiteral", - "start": 26, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":26,"end":39,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":39}}, "members": [ { "type": "TSPropertySignature", - "start": 28, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":28,"end":37,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":37}}, "key": { "type": "Identifier", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "x" - }, + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29},"identifierName":"x"}, "name": "x" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 29, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":29,"end":37,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":37}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":31,"end":37,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":37}} } } } @@ -190,79 +56,22 @@ }, "typeAnnotation": { "type": "TSTypeReference", - "start": 43, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":43,"end":51,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":51}}, "typeName": { "type": "Identifier", - "start": 43, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 48 - }, - "identifierName": "Array" - }, + "start":43,"end":48,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":48},"identifierName":"Array"}, "name": "Array" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 48, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":48,"end":51,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":51}}, "params": [ { "type": "TSTypeReference", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":49,"end":50,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":50}}, "typeName": { "type": "Identifier", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 50 - }, - "identifierName": "U" - }, + "start":49,"end":50,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":50},"identifierName":"U"}, "name": "U" } } @@ -287,18 +96,7 @@ "binop": null }, "value": "type", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - } + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}} }, { "type": { @@ -313,18 +111,7 @@ "binop": null }, "value": "T", - "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}} }, { "type": { @@ -340,18 +127,7 @@ "updateContext": null }, "value": "<", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - } + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}} }, { "type": { @@ -366,18 +142,7 @@ "binop": null }, "value": "U", - "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}} }, { "type": { @@ -394,18 +159,7 @@ "updateContext": null }, "value": "extends", - "start": 9, - "end": 16, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 16 - } - } + "start":9,"end":16,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":16}} }, { "type": { @@ -420,18 +174,7 @@ "binop": null }, "value": "object", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} }, { "type": { @@ -447,18 +190,7 @@ "updateContext": null }, "value": "=", - "start": 24, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":24,"end":25,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":25}} }, { "type": { @@ -472,18 +204,7 @@ "postfix": false, "binop": null }, - "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}} }, { "type": { @@ -498,18 +219,7 @@ "binop": null }, "value": "x", - "start": 28, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 29 - } - } + "start":28,"end":29,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":29}} }, { "type": { @@ -524,18 +234,7 @@ "binop": null, "updateContext": null }, - "start": 29, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":29,"end":30,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":30}} }, { "type": { @@ -550,18 +249,7 @@ "binop": null }, "value": "number", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":31,"end":37,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":37}} }, { "type": { @@ -575,18 +263,7 @@ "postfix": false, "binop": null }, - "start": 38, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 38 - }, - "end": { - "line": 1, - "column": 39 - } - } + "start":38,"end":39,"loc":{"start":{"line":1,"column":38},"end":{"line":1,"column":39}} }, { "type": { @@ -602,18 +279,7 @@ "updateContext": null }, "value": ">", - "start": 39, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 39 - }, - "end": { - "line": 1, - "column": 40 - } - } + "start":39,"end":40,"loc":{"start":{"line":1,"column":39},"end":{"line":1,"column":40}} }, { "type": { @@ -629,18 +295,7 @@ "updateContext": null }, "value": "=", - "start": 41, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 42 - } - } + "start":41,"end":42,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":42}} }, { "type": { @@ -655,18 +310,7 @@ "binop": null }, "value": "Array", - "start": 43, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 48 - } - } + "start":43,"end":48,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":48}} }, { "type": { @@ -682,18 +326,7 @@ "updateContext": null }, "value": "<", - "start": 48, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 48 - }, - "end": { - "line": 1, - "column": 49 - } - } + "start":48,"end":49,"loc":{"start":{"line":1,"column":48},"end":{"line":1,"column":49}} }, { "type": { @@ -708,18 +341,7 @@ "binop": null }, "value": "U", - "start": 49, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 49 - }, - "end": { - "line": 1, - "column": 50 - } - } + "start":49,"end":50,"loc":{"start":{"line":1,"column":49},"end":{"line":1,"column":50}} }, { "type": { @@ -735,18 +357,7 @@ "updateContext": null }, "value": ">", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 51 - } - } + "start":50,"end":51,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":51}} }, { "type": { @@ -761,18 +372,7 @@ "binop": null, "updateContext": null }, - "start": 51, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 51 - }, - "end": { - "line": 1, - "column": 52 - } - } + "start":51,"end":52,"loc":{"start":{"line":1,"column":51},"end":{"line":1,"column":52}} }, { "type": { @@ -787,18 +387,7 @@ "binop": null, "updateContext": null }, - "start": 52, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 52 - }, - "end": { - "line": 1, - "column": 52 - } - } + "start":52,"end":52,"loc":{"start":{"line":1,"column":52},"end":{"line":1,"column":52}} } ] -} +} \ No newline at end of file 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 914be894cb..436c0c9bfe 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 @@ -1,127 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "T" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"T"}, "name": "T" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 6, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":6,"end":9,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":9}}, "params": [ { "type": "TSTypeParameter", - "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}}, "name": "U" } ] }, "typeAnnotation": { "type": "TSTypeReference", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "typeName": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "U" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"U"}, "name": "U" } } diff --git a/packages/babel-parser/test/fixtures/typescript/type-alias/plain/output.json b/packages/babel-parser/test/fixtures/typescript/type-alias/plain/output.json index 6cb8924344..e267751ff0 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-alias/plain/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-alias/plain/output.json @@ -1,79 +1,23 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "T" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"T"}, "name": "T" }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } } ], diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/call/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/call/output.json index 5b329de354..2f64bc6a46 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/call/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/call/output.json @@ -1,124 +1,34 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":10}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "callee": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "arguments": [], "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "params": [ { "type": "TSTypeReference", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "typeName": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "T" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"T"}, "name": "T" } } @@ -128,126 +38,35 @@ }, { "type": "ExpressionStatement", - "start": 8, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":8,"end":18,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":10}}, "expression": { "type": "CallExpression", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 9 - } - }, + "start":8,"end":17,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":9}}, "callee": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 1 - }, - "identifierName": "f" - }, + "start":8,"end":9,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":1},"identifierName":"f"}, "name": "f" }, "arguments": [], "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":9,"end":15,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":7}}, "params": [ { "type": "TSTypeReference", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - } - }, + "start":10,"end":11,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3}}, "typeName": { "type": "Identifier", - "start": 10, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "T" - }, + "start":10,"end":11,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":3},"identifierName":"T"}, "name": "T" } }, { "type": "TSTypeReference", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - } - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6}}, "typeName": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 6 - }, - "identifierName": "U" - }, + "start":13,"end":14,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":6},"identifierName":"U"}, "name": "U" } } diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty/output.json index ce11198360..7de727879d 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/empty/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/empty/output.json @@ -1,94 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "CallExpression", - "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}}, "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": [], "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 3, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":3,"end":5,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":5}}, "params": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/new-false-positive/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/new-false-positive/output.json index f648588de1..b2b541d1be 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/new-false-positive/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/new-false-positive/output.json @@ -1,91 +1,24 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "NewExpression", - "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}}, "callee": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "A" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"A"}, "name": "A" }, "arguments": [] @@ -93,19 +26,7 @@ "operator": "<", "right": { "type": "Identifier", - "start": 8, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "T" - }, + "start":8,"end":9,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":9},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/new/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/new/output.json index 692ded13ea..5071d457d7 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/new/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/new/output.json @@ -1,123 +1,33 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "C" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"C"}, "name": "C" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "params": [ { "type": "TSTypeReference", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "typeName": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "T" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"T"}, "name": "T" } } @@ -128,125 +38,34 @@ }, { "type": "ExpressionStatement", - "start": 12, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":12,"end":26,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "expression": { "type": "NewExpression", - "start": 12, - "end": 25, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":12,"end":25,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "callee": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "C" - }, + "start":16,"end":17,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":5},"identifierName":"C"}, "name": "C" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 11 - } - }, + "start":17,"end":23,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":11}}, "params": [ { "type": "TSTypeReference", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - } - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7}}, "typeName": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 7 - }, - "identifierName": "T" - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":7},"identifierName":"T"}, "name": "T" } }, { "type": "TSTypeReference", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10}}, "typeName": { "type": "Identifier", - "start": 21, - "end": 22, - "loc": { - "start": { - "line": 2, - "column": 9 - }, - "end": { - "line": 2, - "column": 10 - }, - "identifierName": "U" - }, + "start":21,"end":22,"loc":{"start":{"line":2,"column":9},"end":{"line":2,"column":10},"identifierName":"U"}, "name": "U" } } diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/tagged-template-no-asi/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/tagged-template-no-asi/output.json index 8721061b7f..a5917216b2 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/tagged-template-no-asi/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/tagged-template-no-asi/output.json @@ -1,123 +1,34 @@ { "type": "File", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "expression": { "type": "NewExpression", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":2}}, "callee": { "type": "TaggedTemplateExpression", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":2,"column":2}}, "tag": { "type": "Identifier", - "start": 4, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 5 - }, - "identifierName": "C" - }, + "start":4,"end":5,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":5},"identifierName":"C"}, "name": "C" }, "quasi": { "type": "TemplateLiteral", - "start": 9, - "end": 11, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":9,"end":11,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":2}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 10, - "end": 10, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 1 - } - }, + "start":10,"end":10,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":1}}, "value": { "raw": "", "cooked": "" @@ -128,48 +39,14 @@ }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "params": [ { "type": "TSTypeReference", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - } - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7}}, "typeName": { "type": "Identifier", - "start": 6, - "end": 7, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 7 - }, - "identifierName": "T" - }, + "start":6,"end":7,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":7},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/tagged-template/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/tagged-template/output.json index c8b549d700..6063c08f37 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/tagged-template/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/tagged-template/output.json @@ -1,109 +1,31 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "TaggedTemplateExpression", - "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}}, "tag": { "type": "Identifier", - "start": 0, - "end": 1, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 1 - }, - "identifierName": "f" - }, + "start":0,"end":1,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":1},"identifierName":"f"}, "name": "f" }, "quasi": { "type": "TemplateLiteral", - "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}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 5, - "end": 5, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 5 - } - }, + "start":5,"end":5,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":5}}, "value": { "raw": "", "cooked": "" @@ -114,48 +36,14 @@ }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 1, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 1 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":1,"end":4,"loc":{"start":{"line":1,"column":1},"end":{"line":1,"column":4}}, "params": [ { "type": "TSTypeReference", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - } - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3}}, "typeName": { "type": "Identifier", - "start": 2, - "end": 3, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 3 - }, - "identifierName": "T" - }, + "start":2,"end":3,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":3},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/tsx/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/tsx/output.json index 15f1e7ebde..94c356bcf7 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/tsx/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/tsx/output.json @@ -1,121 +1,33 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "type": "JSXElement", - "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}}, "openingElement": { "type": "JSXOpeningElement", - "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}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "C" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 2, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 2 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":2,"end":10,"loc":{"start":{"line":1,"column":2},"end":{"line":1,"column":10}}, "params": [ { "type": "TSNumberKeyword", - "start": 3, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 3 - }, - "end": { - "line": 1, - "column": 9 - } - } + "start":3,"end":9,"loc":{"start":{"line":1,"column":3},"end":{"line":1,"column":9}} } ] }, @@ -124,32 +36,10 @@ }, "closingElement": { "type": "JSXClosingElement", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15}}, "name": { "type": "JSXIdentifier", - "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}}, "name": "C" } }, @@ -158,91 +48,25 @@ }, { "type": "ExpressionStatement", - "start": 17, - "end": 30, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":17,"end":30,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "expression": { "type": "JSXElement", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":17,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "openingElement": { "type": "JSXOpeningElement", - "start": 17, - "end": 29, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":17,"end":29,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "name": { "type": "JSXIdentifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 2, - "column": 1 - }, - "end": { - "line": 2, - "column": 2 - } - }, + "start":18,"end":19,"loc":{"start":{"line":2,"column":1},"end":{"line":2,"column":2}}, "name": "C" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 10 - } - }, + "start":19,"end":27,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":10}}, "params": [ { "type": "TSNumberKeyword", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 2, - "column": 3 - }, - "end": { - "line": 2, - "column": 9 - } - } + "start":20,"end":26,"loc":{"start":{"line":2,"column":3},"end":{"line":2,"column":9}} } ] }, diff --git a/packages/babel-parser/test/fixtures/typescript/type-arguments/whitespace/output.json b/packages/babel-parser/test/fixtures/typescript/type-arguments/whitespace/output.json index 88035f30fd..503d9fd01c 100644 --- a/packages/babel-parser/test/fixtures/typescript/type-arguments/whitespace/output.json +++ b/packages/babel-parser/test/fixtures/typescript/type-arguments/whitespace/output.json @@ -1,96 +1,29 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "f" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"f"}, "name": "f" }, "generator": false, "async": false, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 10, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":10,"end":19,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":19}}, "params": [ { "type": "TSTypeParameter", - "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}}, "name": "T" } ] @@ -98,18 +31,7 @@ "params": [], "body": { "type": "BlockStatement", - "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}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/types/array/output.json b/packages/babel-parser/test/fixtures/typescript/types/array/output.json index b710e28b8d..84bd90c471 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/array/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/array/output.json @@ -1,135 +1,35 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "arr" - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19},"identifierName":"arr"}, "name": "arr", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "typeAnnotation": { "type": "TSArrayType", - "start": 9, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":9,"end":19,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":19}}, "elementType": { "type": "TSArrayType", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "elementType": { "type": "TSNumberKeyword", - "start": 9, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 15 - } - } + "start":9,"end":15,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":15}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/types/conditional-infer/output.json b/packages/babel-parser/test/fixtures/typescript/types/conditional-infer/output.json index 221b2e1d9d..72dae30c84 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/conditional-infer/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/conditional-infer/output.json @@ -1,200 +1,55 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "id": { "type": "Identifier", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "Element" - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12},"identifierName":"Element"}, "name": "Element" }, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15}}, "params": [ { "type": "TSTypeParameter", - "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}}, "name": "T" } ] }, "typeAnnotation": { "type": "TSConditionalType", - "start": 18, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":18,"end":47,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":47}}, "checkType": { "type": "TSTypeReference", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19}}, "typeName": { "type": "Identifier", - "start": 18, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "T" - }, + "start":18,"end":19,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":19},"identifierName":"T"}, "name": "T" } }, "extendsType": { "type": "TSArrayType", - "start": 28, - "end": 39, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 39 - } - }, + "start":28,"end":39,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":39}}, "elementType": { "type": "TSParenthesizedType", - "start": 28, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 28 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":28,"end":37,"loc":{"start":{"line":1,"column":28},"end":{"line":1,"column":37}}, "typeAnnotation": { "type": "TSInferType", - "start": 29, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":29,"end":36,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":36}}, "typeParameter": { "type": "TSTypeParameter", - "start": 35, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":35,"end":36,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":36}}, "name": "U" } } @@ -202,65 +57,19 @@ }, "trueType": { "type": "TSTypeReference", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43}}, "typeName": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 43 - }, - "identifierName": "U" - }, + "start":42,"end":43,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":43},"identifierName":"U"}, "name": "U" } }, "falseType": { "type": "TSTypeReference", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":46,"end":47,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":47}}, "typeName": { "type": "Identifier", - "start": 46, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 46 - }, - "end": { - "line": 1, - "column": 47 - }, - "identifierName": "T" - }, + "start":46,"end":47,"loc":{"start":{"line":1,"column":46},"end":{"line":1,"column":47},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/typescript/types/conditional/output.json b/packages/babel-parser/test/fixtures/typescript/types/conditional/output.json index 39c4253845..6917332b04 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/conditional/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/conditional/output.json @@ -1,166 +1,44 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":4,"end":45,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":45}}, "id": { "type": "Identifier", - "start": 4, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 45 - }, - "identifierName": "x" - }, + "start":4,"end":45,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":45},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":5,"end":45,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":45}}, "typeAnnotation": { "type": "TSConditionalType", - "start": 7, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":7,"end":45,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":45}}, "checkType": { "type": "TSNumberKeyword", - "start": 7, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 13 - } - } + "start":7,"end":13,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":13}} }, "extendsType": { "type": "TSStringKeyword", - "start": 22, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 28 - } - } + "start":22,"end":28,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":28}} }, "trueType": { "type": "TSBooleanKeyword", - "start": 31, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 38 - } - } + "start":31,"end":38,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":38}} }, "falseType": { "type": "TSNullKeyword", - "start": 41, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 41 - }, - "end": { - "line": 1, - "column": 45 - } - } + "start":41,"end":45,"loc":{"start":{"line":1,"column":41},"end":{"line":1,"column":45}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/types/function-generic/output.json b/packages/babel-parser/test/fixtures/typescript/types/function-generic/output.json index eeb30b1574..e359150e73 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/function-generic/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/function-generic/output.json @@ -1,136 +1,36 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":4,"end":21,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":21}}, "id": { "type": "Identifier", - "start": 4, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "f" - }, + "start":4,"end":21,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":21},"identifierName":"f"}, "name": "f", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":5,"end":21,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "TSFunctionType", - "start": 7, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":7,"end":21,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":21}}, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}}, "params": [ { "type": "TSTypeParameter", - "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}}, "name": "T" } ] @@ -138,63 +38,17 @@ "parameters": [ { "type": "Identifier", - "start": 11, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "a" - }, + "start":11,"end":15,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":15},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15}}, "typeAnnotation": { "type": "TSTypeReference", - "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}}, "typeName": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "T" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"T"}, "name": "T" } } @@ -203,47 +57,13 @@ ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 17, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":17,"end":21,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":21}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "typeName": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "T" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/typescript/types/function-in-generic/output.json b/packages/babel-parser/test/fixtures/typescript/types/function-in-generic/output.json index 708c18dc7c..9a7acd6e59 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/function-in-generic/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/function-in-generic/output.json @@ -1,182 +1,48 @@ { "type": "File", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "program": { "type": "Program", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "x" - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":5,"end":24,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":24}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 7, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":24}}, "typeName": { "type": "Identifier", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "Array" - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12},"identifierName":"Array"}, "name": "Array" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 12, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":12,"end":24,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":24}}, "params": [ { "type": "TSFunctionType", - "start": 13, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":13,"end":23,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":23}}, "parameters": [], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":16,"end":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 19, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":19,"end":23,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":23}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/types/function-with-this/output.json b/packages/babel-parser/test/fixtures/typescript/types/function-with-this/output.json index 91e208a34f..cae696cfb5 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/function-with-this/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/function-with-this/output.json @@ -1,184 +1,50 @@ { "type": "File", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "program": { "type": "Program", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 30 - } - }, + "start":0,"end":30,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":30}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":4,"end":29,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":29}}, "id": { "type": "Identifier", - "start": 4, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "f" - }, + "start":4,"end":29,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":29},"identifierName":"f"}, "name": "f", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":5,"end":29,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":29}}, "typeAnnotation": { "type": "TSFunctionType", - "start": 7, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":7,"end":29,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":29}}, "parameters": [ { "type": "Identifier", - "start": 8, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "this" - }, + "start":8,"end":20,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":20},"identifierName":"this"}, "name": "this", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}} } } } ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 22, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":22,"end":29,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":29}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 25, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 29 - } - } + "start":25,"end":29,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":29}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/types/function/output.json b/packages/babel-parser/test/fixtures/typescript/types/function/output.json index be6f63c9ee..454bedceab 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/function/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/function/output.json @@ -1,276 +1,74 @@ { "type": "File", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "program": { "type": "Program", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 55, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 55 - } - }, + "start":0,"end":55,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":55}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":4,"end":54,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":54}}, "id": { "type": "Identifier", - "start": 4, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 54 - }, - "identifierName": "f" - }, + "start":4,"end":54,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":54},"identifierName":"f"}, "name": "f", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":5,"end":54,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":54}}, "typeAnnotation": { "type": "TSFunctionType", - "start": 7, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":7,"end":54,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":54}}, "parameters": [ { "type": "Identifier", - "start": 8, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "a" - }, + "start":8,"end":17,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":17},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 9, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":9,"end":17,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}} } } }, { "type": "Identifier", - "start": 19, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "b" - }, + "start":19,"end":29,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":29},"identifierName":"b"}, "name": "b", "optional": true, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 21, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":21,"end":29,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":29}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - } - } + "start":23,"end":29,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":29}} } } }, { "type": "RestElement", - "start": 31, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":31,"end":45,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":45}}, "argument": { "type": "Identifier", - "start": 34, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 34 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "c" - }, + "start":34,"end":35,"loc":{"start":{"line":1,"column":34},"end":{"line":1,"column":35},"identifierName":"c"}, "name": "c" }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 35, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":35,"end":45,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":45}}, "typeAnnotation": { "type": "TSArrayType", - "start": 37, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":37,"end":45,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":45}}, "elementType": { "type": "TSNumberKeyword", - "start": 37, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 37 - }, - "end": { - "line": 1, - "column": 43 - } - } + "start":37,"end":43,"loc":{"start":{"line":1,"column":37},"end":{"line":1,"column":43}} } } } @@ -278,32 +76,10 @@ ], "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 47, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 47 - }, - "end": { - "line": 1, - "column": 54 - } - }, + "start":47,"end":54,"loc":{"start":{"line":1,"column":47},"end":{"line":1,"column":54}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 50, - "end": 54, - "loc": { - "start": { - "line": 1, - "column": 50 - }, - "end": { - "line": 1, - "column": 54 - } - } + "start":50,"end":54,"loc":{"start":{"line":1,"column":50},"end":{"line":1,"column":54}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/types/import-type-declaration-error/output.json b/packages/babel-parser/test/fixtures/typescript/types/import-type-declaration-error/output.json index 13de762ac4..3df1338cbc 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/import-type-declaration-error/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/import-type-declaration-error/output.json @@ -1,198 +1,61 @@ { "type": "File", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "errors": [ "SyntaxError: A type-only import can specify a default import or named bindings, but not both. (1:0)" ], "program": { "type": "Program", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":0,"end":51,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":51}}, "importKind": "type", "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":12,"end":22,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":22}}, "local": { "type": "Identifier", - "start": 12, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "FooDefault" - }, + "start":12,"end":22,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":22},"identifierName":"FooDefault"}, "name": "FooDefault" } }, { "type": "ImportSpecifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29}}, "imported": { "type": "Identifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "Bar" - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29},"identifierName":"Bar"}, "name": "Bar" }, "local": { "type": "Identifier", - "start": 26, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "Bar" - }, + "start":26,"end":29,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":29},"identifierName":"Bar"}, "name": "Bar" } }, { "type": "ImportSpecifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":31,"end":34,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":34}}, "imported": { "type": "Identifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "Baz" - }, + "start":31,"end":34,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":34},"identifierName":"Baz"}, "name": "Baz" }, "local": { "type": "Identifier", - "start": 31, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 34 - }, - "identifierName": "Baz" - }, + "start":31,"end":34,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":34},"identifierName":"Baz"}, "name": "Baz" } } ], "source": { "type": "StringLiteral", - "start": 42, - "end": 50, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 50 - } - }, + "start":42,"end":50,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":50}}, "extra": { "rawValue": "module", "raw": "\"module\"" diff --git a/packages/babel-parser/test/fixtures/typescript/types/import-type-declaration/output.json b/packages/babel-parser/test/fixtures/typescript/types/import-type-declaration/output.json index bd2d69938b..b0f9cac400 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/import-type-declaration/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/import-type-declaration/output.json @@ -1,97 +1,30 @@ { "type": "File", - "start": 0, - "end": 99, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":0,"end":99,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 99, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":0,"end":99,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ImportDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "importKind": "type", "specifiers": [ { "type": "ImportDefaultSpecifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13}}, "local": { "type": "Identifier", - "start": 12, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "T" - }, + "start":12,"end":13,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":13},"identifierName":"T"}, "name": "T" } } ], "source": { "type": "StringLiteral", - "start": 19, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":19,"end":26,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":26}}, "extra": { "rawValue": "./mod", "raw": "'./mod'" @@ -101,133 +34,41 @@ }, { "type": "ImportDeclaration", - "start": 28, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":28,"end":62,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}}, "importKind": "type", "specifiers": [ { "type": "ImportSpecifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":42,"end":43,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15}}, "imported": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "A" - }, + "start":42,"end":43,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"A"}, "name": "A" }, "local": { "type": "Identifier", - "start": 42, - "end": 43, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "A" - }, + "start":42,"end":43,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":15},"identifierName":"A"}, "name": "A" } }, { "type": "ImportSpecifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - } - }, + "start":45,"end":46,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18}}, "imported": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "B" - }, + "start":45,"end":46,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"B"}, "name": "B" }, "local": { "type": "Identifier", - "start": 45, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 17 - }, - "end": { - "line": 2, - "column": 18 - }, - "identifierName": "B" - }, + "start":45,"end":46,"loc":{"start":{"line":2,"column":17},"end":{"line":2,"column":18},"identifierName":"B"}, "name": "B" } } ], "source": { "type": "StringLiteral", - "start": 54, - "end": 61, - "loc": { - "start": { - "line": 2, - "column": 26 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":54,"end":61,"loc":{"start":{"line":2,"column":26},"end":{"line":2,"column":33}}, "extra": { "rawValue": "./mod", "raw": "'./mod'" @@ -237,67 +78,22 @@ }, { "type": "ImportDeclaration", - "start": 63, - "end": 99, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":63,"end":99,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":36}}, "importKind": "type", "specifiers": [ { "type": "ImportNamespaceSpecifier", - "start": 75, - "end": 85, - "loc": { - "start": { - "line": 3, - "column": 12 - }, - "end": { - "line": 3, - "column": 22 - } - }, + "start":75,"end":85,"loc":{"start":{"line":3,"column":12},"end":{"line":3,"column":22}}, "local": { "type": "Identifier", - "start": 80, - "end": 85, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 22 - }, - "identifierName": "Types" - }, + "start":80,"end":85,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":22},"identifierName":"Types"}, "name": "Types" } } ], "source": { "type": "StringLiteral", - "start": 91, - "end": 98, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":91,"end":98,"loc":{"start":{"line":3,"column":28},"end":{"line":3,"column":35}}, "extra": { "rawValue": "./mod", "raw": "'./mod'" diff --git a/packages/babel-parser/test/fixtures/typescript/types/import-type-dynamic/output.json b/packages/babel-parser/test/fixtures/typescript/types/import-type-dynamic/output.json index a3aa6c8c53..0c20c2d20d 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/import-type-dynamic/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/import-type-dynamic/output.json @@ -1,135 +1,35 @@ { "type": "File", - "start": 0, - "end": 89, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":0,"end":89,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":36}}, "program": { "type": "Program", - "start": 0, - "end": 89, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":0,"end":89,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":36}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "x" - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":5,"end":27,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "TSTypeQuery", - "start": 7, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":7,"end":27,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":27}}, "exprName": { "type": "TSImportType", - "start": 14, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":14,"end":27,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":27}}, "argument": { "type": "StringLiteral", - "start": 21, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 21 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":21,"end":26,"loc":{"start":{"line":1,"column":21},"end":{"line":1,"column":26}}, "extra": { "rawValue": "./x", "raw": "'./x'" @@ -147,91 +47,24 @@ }, { "type": "VariableDeclaration", - "start": 29, - "end": 52, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 23 - } - }, + "start":29,"end":52,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 33, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":33,"end":51,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":22}}, "id": { "type": "Identifier", - "start": 33, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "Y" - }, + "start":33,"end":51,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":22},"identifierName":"Y"}, "name": "Y", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 34, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":34,"end":51,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":22}}, "typeAnnotation": { "type": "TSImportType", - "start": 36, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 22 - } - }, + "start":36,"end":51,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":22}}, "argument": { "type": "StringLiteral", - "start": 43, - "end": 48, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 19 - } - }, + "start":43,"end":48,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":19}}, "extra": { "rawValue": "./y", "raw": "'./y'" @@ -240,19 +73,7 @@ }, "qualifier": { "type": "Identifier", - "start": 50, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 21 - }, - "end": { - "line": 2, - "column": 22 - }, - "identifierName": "Y" - }, + "start":50,"end":51,"loc":{"start":{"line":2,"column":21},"end":{"line":2,"column":22},"identifierName":"Y"}, "name": "Y" } } @@ -265,91 +86,24 @@ }, { "type": "VariableDeclaration", - "start": 53, - "end": 89, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 36 - } - }, + "start":53,"end":89,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":36}}, "declarations": [ { "type": "VariableDeclarator", - "start": 57, - "end": 88, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":57,"end":88,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":35}}, "id": { "type": "Identifier", - "start": 57, - "end": 88, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 35 - }, - "identifierName": "z" - }, + "start":57,"end":88,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":35},"identifierName":"z"}, "name": "z", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 58, - "end": 88, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":58,"end":88,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":35}}, "typeAnnotation": { "type": "TSImportType", - "start": 60, - "end": 88, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":60,"end":88,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":35}}, "argument": { "type": "StringLiteral", - "start": 67, - "end": 71, - "loc": { - "start": { - "line": 3, - "column": 14 - }, - "end": { - "line": 3, - "column": 18 - } - }, + "start":67,"end":71,"loc":{"start":{"line":3,"column":14},"end":{"line":3,"column":18}}, "extra": { "rawValue": "/z", "raw": "\"/z\"" @@ -358,82 +112,25 @@ }, "qualifier": { "type": "TSQualifiedName", - "start": 73, - "end": 80, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 27 - } - }, + "start":73,"end":80,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":27}}, "left": { "type": "Identifier", - "start": 73, - "end": 76, - "loc": { - "start": { - "line": 3, - "column": 20 - }, - "end": { - "line": 3, - "column": 23 - }, - "identifierName": "foo" - }, + "start":73,"end":76,"loc":{"start":{"line":3,"column":20},"end":{"line":3,"column":23},"identifierName":"foo"}, "name": "foo" }, "right": { "type": "Identifier", - "start": 77, - "end": 80, - "loc": { - "start": { - "line": 3, - "column": 24 - }, - "end": { - "line": 3, - "column": 27 - }, - "identifierName": "bar" - }, + "start":77,"end":80,"loc":{"start":{"line":3,"column":24},"end":{"line":3,"column":27},"identifierName":"bar"}, "name": "bar" } }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 80, - "end": 88, - "loc": { - "start": { - "line": 3, - "column": 27 - }, - "end": { - "line": 3, - "column": 35 - } - }, + "start":80,"end":88,"loc":{"start":{"line":3,"column":27},"end":{"line":3,"column":35}}, "params": [ { "type": "TSStringKeyword", - "start": 81, - "end": 87, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 34 - } - } + "start":81,"end":87,"loc":{"start":{"line":3,"column":28},"end":{"line":3,"column":34}} } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/types/indexed/output.json b/packages/babel-parser/test/fixtures/typescript/types/indexed/output.json index ee52d9dd6d..309a765c97 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/indexed/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/indexed/output.json @@ -1,168 +1,44 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "x" - }, + "start":4,"end":11,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":11},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "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}}, "typeAnnotation": { "type": "TSIndexedAccessType", - "start": 7, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":7,"end":11,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":11}}, "objectType": { "type": "TSTypeReference", - "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}}, "typeName": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "T" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"T"}, "name": "T" } }, "indexType": { "type": "TSTypeReference", - "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}}, "typeName": { "type": "Identifier", - "start": 9, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "K" - }, + "start":9,"end":10,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":10},"identifierName":"K"}, "name": "K" } } diff --git a/packages/babel-parser/test/fixtures/typescript/types/keywords/output.json b/packages/babel-parser/test/fixtures/typescript/types/keywords/output.json index 4c6e48290b..1bb07f7670 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/keywords/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/keywords/output.json @@ -1,107 +1,29 @@ { "type": "File", - "start": 0, - "end": 184, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 12, - "column": 14 - } - }, + "start":0,"end":184,"loc":{"start":{"line":1,"column":0},"end":{"line":12,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 184, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 12, - "column": 14 - } - }, + "start":0,"end":184,"loc":{"start":{"line":1,"column":0},"end":{"line":12,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - } - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10}}, "id": { "type": "Identifier", - "start": 4, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 10 - }, - "identifierName": "a" - }, + "start":4,"end":10,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":10},"identifierName":"a"}, "name": "a", "typeAnnotation": { "type": "TSTypeAnnotation", - "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}}, "typeAnnotation": { "type": "TSAnyKeyword", - "start": 7, - "end": 10, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 10 - } - } + "start":7,"end":10,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":10}} } } }, @@ -112,77 +34,21 @@ }, { "type": "VariableDeclaration", - "start": 12, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 16 - } - }, + "start":12,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":16}}, "declarations": [ { "type": "VariableDeclarator", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":16,"end":27,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":15}}, "id": { "type": "Identifier", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 15 - }, - "identifierName": "un" - }, + "start":16,"end":27,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":15},"identifierName":"un"}, "name": "un", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 15 - } - }, + "start":18,"end":27,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":15}}, "typeAnnotation": { "type": "TSUnknownKeyword", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 15 - } - } + "start":20,"end":27,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":15}} } } }, @@ -193,77 +59,21 @@ }, { "type": "VariableDeclaration", - "start": 29, - "end": 44, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 15 - } - }, + "start":29,"end":44,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":15}}, "declarations": [ { "type": "VariableDeclarator", - "start": 33, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":33,"end":43,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":14}}, "id": { "type": "Identifier", - "start": 33, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 14 - }, - "identifierName": "b" - }, + "start":33,"end":43,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":14},"identifierName":"b"}, "name": "b", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 34, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 14 - } - }, + "start":34,"end":43,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":14}}, "typeAnnotation": { "type": "TSBooleanKeyword", - "start": 36, - "end": 43, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 14 - } - } + "start":36,"end":43,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":14}} } } }, @@ -274,77 +84,21 @@ }, { "type": "VariableDeclaration", - "start": 45, - "end": 59, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 14 - } - }, + "start":45,"end":59,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 49, - "end": 58, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":49,"end":58,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":13}}, "id": { "type": "Identifier", - "start": 49, - "end": 58, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 13 - }, - "identifierName": "ne" - }, + "start":49,"end":58,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":13},"identifierName":"ne"}, "name": "ne", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 51, - "end": 58, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 13 - } - }, + "start":51,"end":58,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":13}}, "typeAnnotation": { "type": "TSNeverKeyword", - "start": 53, - "end": 58, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 13 - } - } + "start":53,"end":58,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":13}} } } }, @@ -355,77 +109,21 @@ }, { "type": "VariableDeclaration", - "start": 60, - "end": 74, - "loc": { - "start": { - "line": 5, - "column": 0 - }, - "end": { - "line": 5, - "column": 14 - } - }, + "start":60,"end":74,"loc":{"start":{"line":5,"column":0},"end":{"line":5,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 64, - "end": 73, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":64,"end":73,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":13}}, "id": { "type": "Identifier", - "start": 64, - "end": 73, - "loc": { - "start": { - "line": 5, - "column": 4 - }, - "end": { - "line": 5, - "column": 13 - }, - "identifierName": "nul" - }, + "start":64,"end":73,"loc":{"start":{"line":5,"column":4},"end":{"line":5,"column":13},"identifierName":"nul"}, "name": "nul", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 67, - "end": 73, - "loc": { - "start": { - "line": 5, - "column": 7 - }, - "end": { - "line": 5, - "column": 13 - } - }, + "start":67,"end":73,"loc":{"start":{"line":5,"column":7},"end":{"line":5,"column":13}}, "typeAnnotation": { "type": "TSNullKeyword", - "start": 69, - "end": 73, - "loc": { - "start": { - "line": 5, - "column": 9 - }, - "end": { - "line": 5, - "column": 13 - } - } + "start":69,"end":73,"loc":{"start":{"line":5,"column":9},"end":{"line":5,"column":13}} } } }, @@ -436,77 +134,21 @@ }, { "type": "VariableDeclaration", - "start": 75, - "end": 91, - "loc": { - "start": { - "line": 6, - "column": 0 - }, - "end": { - "line": 6, - "column": 16 - } - }, + "start":75,"end":91,"loc":{"start":{"line":6,"column":0},"end":{"line":6,"column":16}}, "declarations": [ { "type": "VariableDeclarator", - "start": 79, - "end": 90, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 15 - } - }, + "start":79,"end":90,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":15}}, "id": { "type": "Identifier", - "start": 79, - "end": 90, - "loc": { - "start": { - "line": 6, - "column": 4 - }, - "end": { - "line": 6, - "column": 15 - }, - "identifierName": "num" - }, + "start":79,"end":90,"loc":{"start":{"line":6,"column":4},"end":{"line":6,"column":15},"identifierName":"num"}, "name": "num", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 82, - "end": 90, - "loc": { - "start": { - "line": 6, - "column": 7 - }, - "end": { - "line": 6, - "column": 15 - } - }, + "start":82,"end":90,"loc":{"start":{"line":6,"column":7},"end":{"line":6,"column":15}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 84, - "end": 90, - "loc": { - "start": { - "line": 6, - "column": 9 - }, - "end": { - "line": 6, - "column": 15 - } - } + "start":84,"end":90,"loc":{"start":{"line":6,"column":9},"end":{"line":6,"column":15}} } } }, @@ -517,77 +159,21 @@ }, { "type": "VariableDeclaration", - "start": 92, - "end": 106, - "loc": { - "start": { - "line": 7, - "column": 0 - }, - "end": { - "line": 7, - "column": 14 - } - }, + "start":92,"end":106,"loc":{"start":{"line":7,"column":0},"end":{"line":7,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 96, - "end": 105, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 13 - } - }, + "start":96,"end":105,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":13}}, "id": { "type": "Identifier", - "start": 96, - "end": 105, - "loc": { - "start": { - "line": 7, - "column": 4 - }, - "end": { - "line": 7, - "column": 13 - }, - "identifierName": "o" - }, + "start":96,"end":105,"loc":{"start":{"line":7,"column":4},"end":{"line":7,"column":13},"identifierName":"o"}, "name": "o", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 97, - "end": 105, - "loc": { - "start": { - "line": 7, - "column": 5 - }, - "end": { - "line": 7, - "column": 13 - } - }, + "start":97,"end":105,"loc":{"start":{"line":7,"column":5},"end":{"line":7,"column":13}}, "typeAnnotation": { "type": "TSObjectKeyword", - "start": 99, - "end": 105, - "loc": { - "start": { - "line": 7, - "column": 7 - }, - "end": { - "line": 7, - "column": 13 - } - } + "start":99,"end":105,"loc":{"start":{"line":7,"column":7},"end":{"line":7,"column":13}} } } }, @@ -598,77 +184,21 @@ }, { "type": "VariableDeclaration", - "start": 107, - "end": 122, - "loc": { - "start": { - "line": 8, - "column": 0 - }, - "end": { - "line": 8, - "column": 15 - } - }, + "start":107,"end":122,"loc":{"start":{"line":8,"column":0},"end":{"line":8,"column":15}}, "declarations": [ { "type": "VariableDeclarator", - "start": 111, - "end": 121, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 14 - } - }, + "start":111,"end":121,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":14}}, "id": { "type": "Identifier", - "start": 111, - "end": 121, - "loc": { - "start": { - "line": 8, - "column": 4 - }, - "end": { - "line": 8, - "column": 14 - }, - "identifierName": "st" - }, + "start":111,"end":121,"loc":{"start":{"line":8,"column":4},"end":{"line":8,"column":14},"identifierName":"st"}, "name": "st", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 113, - "end": 121, - "loc": { - "start": { - "line": 8, - "column": 6 - }, - "end": { - "line": 8, - "column": 14 - } - }, + "start":113,"end":121,"loc":{"start":{"line":8,"column":6},"end":{"line":8,"column":14}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 115, - "end": 121, - "loc": { - "start": { - "line": 8, - "column": 8 - }, - "end": { - "line": 8, - "column": 14 - } - } + "start":115,"end":121,"loc":{"start":{"line":8,"column":8},"end":{"line":8,"column":14}} } } }, @@ -679,77 +209,21 @@ }, { "type": "VariableDeclaration", - "start": 123, - "end": 138, - "loc": { - "start": { - "line": 9, - "column": 0 - }, - "end": { - "line": 9, - "column": 15 - } - }, + "start":123,"end":138,"loc":{"start":{"line":9,"column":0},"end":{"line":9,"column":15}}, "declarations": [ { "type": "VariableDeclarator", - "start": 127, - "end": 137, - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 9, - "column": 14 - } - }, + "start":127,"end":137,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":14}}, "id": { "type": "Identifier", - "start": 127, - "end": 137, - "loc": { - "start": { - "line": 9, - "column": 4 - }, - "end": { - "line": 9, - "column": 14 - }, - "identifierName": "sy" - }, + "start":127,"end":137,"loc":{"start":{"line":9,"column":4},"end":{"line":9,"column":14},"identifierName":"sy"}, "name": "sy", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 129, - "end": 137, - "loc": { - "start": { - "line": 9, - "column": 6 - }, - "end": { - "line": 9, - "column": 14 - } - }, + "start":129,"end":137,"loc":{"start":{"line":9,"column":6},"end":{"line":9,"column":14}}, "typeAnnotation": { "type": "TSSymbolKeyword", - "start": 131, - "end": 137, - "loc": { - "start": { - "line": 9, - "column": 8 - }, - "end": { - "line": 9, - "column": 14 - } - } + "start":131,"end":137,"loc":{"start":{"line":9,"column":8},"end":{"line":9,"column":14}} } } }, @@ -760,77 +234,21 @@ }, { "type": "VariableDeclaration", - "start": 139, - "end": 156, - "loc": { - "start": { - "line": 10, - "column": 0 - }, - "end": { - "line": 10, - "column": 17 - } - }, + "start":139,"end":156,"loc":{"start":{"line":10,"column":0},"end":{"line":10,"column":17}}, "declarations": [ { "type": "VariableDeclarator", - "start": 143, - "end": 155, - "loc": { - "start": { - "line": 10, - "column": 4 - }, - "end": { - "line": 10, - "column": 16 - } - }, + "start":143,"end":155,"loc":{"start":{"line":10,"column":4},"end":{"line":10,"column":16}}, "id": { "type": "Identifier", - "start": 143, - "end": 155, - "loc": { - "start": { - "line": 10, - "column": 4 - }, - "end": { - "line": 10, - "column": 16 - }, - "identifierName": "u" - }, + "start":143,"end":155,"loc":{"start":{"line":10,"column":4},"end":{"line":10,"column":16},"identifierName":"u"}, "name": "u", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 144, - "end": 155, - "loc": { - "start": { - "line": 10, - "column": 5 - }, - "end": { - "line": 10, - "column": 16 - } - }, + "start":144,"end":155,"loc":{"start":{"line":10,"column":5},"end":{"line":10,"column":16}}, "typeAnnotation": { "type": "TSUndefinedKeyword", - "start": 146, - "end": 155, - "loc": { - "start": { - "line": 10, - "column": 7 - }, - "end": { - "line": 10, - "column": 16 - } - } + "start":146,"end":155,"loc":{"start":{"line":10,"column":7},"end":{"line":10,"column":16}} } } }, @@ -841,77 +259,21 @@ }, { "type": "VariableDeclaration", - "start": 157, - "end": 169, - "loc": { - "start": { - "line": 11, - "column": 0 - }, - "end": { - "line": 11, - "column": 12 - } - }, + "start":157,"end":169,"loc":{"start":{"line":11,"column":0},"end":{"line":11,"column":12}}, "declarations": [ { "type": "VariableDeclarator", - "start": 161, - "end": 168, - "loc": { - "start": { - "line": 11, - "column": 4 - }, - "end": { - "line": 11, - "column": 11 - } - }, + "start":161,"end":168,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":11}}, "id": { "type": "Identifier", - "start": 161, - "end": 168, - "loc": { - "start": { - "line": 11, - "column": 4 - }, - "end": { - "line": 11, - "column": 11 - }, - "identifierName": "v" - }, + "start":161,"end":168,"loc":{"start":{"line":11,"column":4},"end":{"line":11,"column":11},"identifierName":"v"}, "name": "v", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 162, - "end": 168, - "loc": { - "start": { - "line": 11, - "column": 5 - }, - "end": { - "line": 11, - "column": 11 - } - }, + "start":162,"end":168,"loc":{"start":{"line":11,"column":5},"end":{"line":11,"column":11}}, "typeAnnotation": { "type": "TSVoidKeyword", - "start": 164, - "end": 168, - "loc": { - "start": { - "line": 11, - "column": 7 - }, - "end": { - "line": 11, - "column": 11 - } - } + "start":164,"end":168,"loc":{"start":{"line":11,"column":7},"end":{"line":11,"column":11}} } } }, @@ -922,77 +284,21 @@ }, { "type": "VariableDeclaration", - "start": 170, - "end": 184, - "loc": { - "start": { - "line": 12, - "column": 0 - }, - "end": { - "line": 12, - "column": 14 - } - }, + "start":170,"end":184,"loc":{"start":{"line":12,"column":0},"end":{"line":12,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 174, - "end": 183, - "loc": { - "start": { - "line": 12, - "column": 4 - }, - "end": { - "line": 12, - "column": 13 - } - }, + "start":174,"end":183,"loc":{"start":{"line":12,"column":4},"end":{"line":12,"column":13}}, "id": { "type": "Identifier", - "start": 174, - "end": 183, - "loc": { - "start": { - "line": 12, - "column": 4 - }, - "end": { - "line": 12, - "column": 13 - }, - "identifierName": "n" - }, + "start":174,"end":183,"loc":{"start":{"line":12,"column":4},"end":{"line":12,"column":13},"identifierName":"n"}, "name": "n", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 175, - "end": 183, - "loc": { - "start": { - "line": 12, - "column": 5 - }, - "end": { - "line": 12, - "column": 13 - } - }, + "start":175,"end":183,"loc":{"start":{"line":12,"column":5},"end":{"line":12,"column":13}}, "typeAnnotation": { "type": "TSBigIntKeyword", - "start": 177, - "end": 183, - "loc": { - "start": { - "line": 12, - "column": 7 - }, - "end": { - "line": 12, - "column": 13 - } - } + "start":177,"end":183,"loc":{"start":{"line":12,"column":7},"end":{"line":12,"column":13}} } } }, diff --git a/packages/babel-parser/test/fixtures/typescript/types/literal-boolean/output.json b/packages/babel-parser/test/fixtures/typescript/types/literal-boolean/output.json index 44bc4f2acb..fdab5fe10c 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/literal-boolean/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/literal-boolean/output.json @@ -1,121 +1,32 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":14}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x1" - }, + "start":4,"end":12,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":12},"identifierName":"x1"}, "name": "x1", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 6, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":6,"end":12,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":12}}, "typeAnnotation": { "type": "TSLiteralType", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "literal": { "type": "BooleanLiteral", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "value": true } } @@ -128,91 +39,24 @@ }, { "type": "VariableDeclaration", - "start": 14, - "end": 28, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 14 - } - }, + "start":14,"end":28,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":14}}, "declarations": [ { "type": "VariableDeclarator", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":18,"end":27,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":13}}, "id": { "type": "Identifier", - "start": 18, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 13 - }, - "identifierName": "x2" - }, + "start":18,"end":27,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":13},"identifierName":"x2"}, "name": "x2", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 20, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":20,"end":27,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":13}}, "typeAnnotation": { "type": "TSLiteralType", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":22,"end":27,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":13}}, "literal": { "type": "BooleanLiteral", - "start": 22, - "end": 27, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":22,"end":27,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":13}}, "value": false } } diff --git a/packages/babel-parser/test/fixtures/typescript/types/literal-number-negative/output.json b/packages/babel-parser/test/fixtures/typescript/types/literal-number-negative/output.json index 70e1614350..98188ca7ad 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/literal-number-negative/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/literal-number-negative/output.json @@ -1,137 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "typeAnnotation": { "type": "TSLiteralType", - "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}}, "literal": { "type": "UnaryExpression", - "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}}, "operator": "-", "prefix": true, "argument": { "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": 1, "raw": "1" diff --git a/packages/babel-parser/test/fixtures/typescript/types/literal-number/output.json b/packages/babel-parser/test/fixtures/typescript/types/literal-number/output.json index ee12b09143..0794c7490c 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/literal-number/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/literal-number/output.json @@ -1,121 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "id": { "type": "Identifier", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "x" - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "typeAnnotation": { "type": "TSLiteralType", - "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}}, "literal": { "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": 0, "raw": "0" diff --git a/packages/babel-parser/test/fixtures/typescript/types/literal-string-1/output.json b/packages/babel-parser/test/fixtures/typescript/types/literal-string-1/output.json index a153fb364a..66628e7136 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/literal-string-1/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/literal-string-1/output.json @@ -1,137 +1,37 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":4,"end":12,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "typeAnnotation": { "type": "TSLiteralType", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "literal": { "type": "TemplateLiteral", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "expressions": [], "quasis": [ { "type": "TemplateElement", - "start": 8, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 11 - } - }, + "start":8,"end":11,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":11}}, "value": { "raw": "foo", "cooked": "foo" diff --git a/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/output.json b/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/output.json index ee3c9e5da0..1b6b7291f9 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/literal-string-2/output.json @@ -1,158 +1,46 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: Template literal types cannot have any substitution (1:14)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19}}, "id": { "type": "Identifier", - "start": 4, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 19 - }, - "identifierName": "x" - }, + "start":4,"end":19,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":19},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":5,"end":19,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":19}}, "typeAnnotation": { "type": "TSLiteralType", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "literal": { "type": "TemplateLiteral", - "start": 7, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 19 - } - }, + "start":7,"end":19,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":19}}, "expressions": [ { "type": "Identifier", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "bar" - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17},"identifierName":"bar"}, "name": "bar" } ], "quasis": [ { "type": "TemplateElement", - "start": 8, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":8,"end":12,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":12}}, "value": { "raw": "foo-", "cooked": "foo-" @@ -161,18 +49,7 @@ }, { "type": "TemplateElement", - "start": 18, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":18,"end":18,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":18}}, "value": { "raw": "", "cooked": "" diff --git a/packages/babel-parser/test/fixtures/typescript/types/literal-string/output.json b/packages/babel-parser/test/fixtures/typescript/types/literal-string/output.json index c9cbc53ac2..7a2d467c2d 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/literal-string/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/literal-string/output.json @@ -1,121 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":4,"end":12,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":5,"end":12,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":12}}, "typeAnnotation": { "type": "TSLiteralType", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "literal": { "type": "StringLiteral", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, "extra": { "rawValue": "foo", "raw": "\"foo\"" diff --git a/packages/babel-parser/test/fixtures/typescript/types/mapped/output.json b/packages/babel-parser/test/fixtures/typescript/types/mapped/output.json index 5cde8240b2..7b27bddbec 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/mapped/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/mapped/output.json @@ -1,152 +1,41 @@ { "type": "File", - "start": 0, - "end": 184, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 48 - } - }, + "start":0,"end":184,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":48}}, "program": { "type": "Program", - "start": 0, - "end": 184, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 48 - } - }, + "start":0,"end":184,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":48}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "map1" - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36},"identifierName":"map1"}, "name": "map1", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 8, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":8,"end":36,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":36}}, "typeAnnotation": { "type": "TSMappedType", - "start": 10, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":10,"end":36,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":36}}, "typeParameter": { "type": "TSTypeParameter", - "start": 13, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":13,"end":24,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":24}}, "name": "P", "constraint": { "type": "TSStringKeyword", - "start": 18, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":18,"end":24,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":24}} } }, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 27, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 33 - } - } + "start":27,"end":33,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":33}} } } } @@ -158,124 +47,35 @@ }, { "type": "VariableDeclaration", - "start": 38, - "end": 85, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 47 - } - }, + "start":38,"end":85,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":47}}, "declarations": [ { "type": "VariableDeclarator", - "start": 42, - "end": 84, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 46 - } - }, + "start":42,"end":84,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":46}}, "id": { "type": "Identifier", - "start": 42, - "end": 84, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 46 - }, - "identifierName": "map2" - }, + "start":42,"end":84,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":46},"identifierName":"map2"}, "name": "map2", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 46, - "end": 84, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 46 - } - }, + "start":46,"end":84,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":46}}, "typeAnnotation": { "type": "TSMappedType", - "start": 48, - "end": 84, - "loc": { - "start": { - "line": 2, - "column": 10 - }, - "end": { - "line": 2, - "column": 46 - } - }, + "start":48,"end":84,"loc":{"start":{"line":2,"column":10},"end":{"line":2,"column":46}}, "readonly": true, "typeParameter": { "type": "TSTypeParameter", - "start": 60, - "end": 71, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":60,"end":71,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":33}}, "name": "P", "constraint": { "type": "TSStringKeyword", - "start": 65, - "end": 71, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 33 - } - } + "start":65,"end":71,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":33}} } }, "optional": true, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 75, - "end": 81, - "loc": { - "start": { - "line": 2, - "column": 37 - }, - "end": { - "line": 2, - "column": 43 - } - } + "start":75,"end":81,"loc":{"start":{"line":2,"column":37},"end":{"line":2,"column":43}} } } } @@ -287,124 +87,35 @@ }, { "type": "VariableDeclaration", - "start": 86, - "end": 135, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 49 - } - }, + "start":86,"end":135,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":49}}, "declarations": [ { "type": "VariableDeclarator", - "start": 90, - "end": 134, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 48 - } - }, + "start":90,"end":134,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":48}}, "id": { "type": "Identifier", - "start": 90, - "end": 134, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 48 - }, - "identifierName": "map3" - }, + "start":90,"end":134,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":48},"identifierName":"map3"}, "name": "map3", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 94, - "end": 134, - "loc": { - "start": { - "line": 3, - "column": 8 - }, - "end": { - "line": 3, - "column": 48 - } - }, + "start":94,"end":134,"loc":{"start":{"line":3,"column":8},"end":{"line":3,"column":48}}, "typeAnnotation": { "type": "TSMappedType", - "start": 96, - "end": 134, - "loc": { - "start": { - "line": 3, - "column": 10 - }, - "end": { - "line": 3, - "column": 48 - } - }, + "start":96,"end":134,"loc":{"start":{"line":3,"column":10},"end":{"line":3,"column":48}}, "readonly": "+", "typeParameter": { "type": "TSTypeParameter", - "start": 109, - "end": 120, - "loc": { - "start": { - "line": 3, - "column": 23 - }, - "end": { - "line": 3, - "column": 34 - } - }, + "start":109,"end":120,"loc":{"start":{"line":3,"column":23},"end":{"line":3,"column":34}}, "name": "P", "constraint": { "type": "TSStringKeyword", - "start": 114, - "end": 120, - "loc": { - "start": { - "line": 3, - "column": 28 - }, - "end": { - "line": 3, - "column": 34 - } - } + "start":114,"end":120,"loc":{"start":{"line":3,"column":28},"end":{"line":3,"column":34}} } }, "optional": "+", "typeAnnotation": { "type": "TSNumberKeyword", - "start": 125, - "end": 131, - "loc": { - "start": { - "line": 3, - "column": 39 - }, - "end": { - "line": 3, - "column": 45 - } - } + "start":125,"end":131,"loc":{"start":{"line":3,"column":39},"end":{"line":3,"column":45}} } } } @@ -416,124 +127,35 @@ }, { "type": "VariableDeclaration", - "start": 136, - "end": 184, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 48 - } - }, + "start":136,"end":184,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":48}}, "declarations": [ { "type": "VariableDeclarator", - "start": 140, - "end": 183, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 47 - } - }, + "start":140,"end":183,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":47}}, "id": { "type": "Identifier", - "start": 140, - "end": 183, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 47 - }, - "identifierName": "map4" - }, + "start":140,"end":183,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":47},"identifierName":"map4"}, "name": "map4", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 144, - "end": 183, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 47 - } - }, + "start":144,"end":183,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":47}}, "typeAnnotation": { "type": "TSMappedType", - "start": 146, - "end": 183, - "loc": { - "start": { - "line": 4, - "column": 10 - }, - "end": { - "line": 4, - "column": 47 - } - }, + "start":146,"end":183,"loc":{"start":{"line":4,"column":10},"end":{"line":4,"column":47}}, "readonly": "-", "typeParameter": { "type": "TSTypeParameter", - "start": 159, - "end": 170, - "loc": { - "start": { - "line": 4, - "column": 23 - }, - "end": { - "line": 4, - "column": 34 - } - }, + "start":159,"end":170,"loc":{"start":{"line":4,"column":23},"end":{"line":4,"column":34}}, "name": "P", "constraint": { "type": "TSStringKeyword", - "start": 164, - "end": 170, - "loc": { - "start": { - "line": 4, - "column": 28 - }, - "end": { - "line": 4, - "column": 34 - } - } + "start":164,"end":170,"loc":{"start":{"line":4,"column":28},"end":{"line":4,"column":34}} } }, "optional": "-", "typeAnnotation": { "type": "TSNumberKeyword", - "start": 175, - "end": 181, - "loc": { - "start": { - "line": 4, - "column": 39 - }, - "end": { - "line": 4, - "column": 45 - } - } + "start":175,"end":181,"loc":{"start":{"line":4,"column":39},"end":{"line":4,"column":45}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/types/new-line/output.json b/packages/babel-parser/test/fixtures/typescript/types/new-line/output.json index 7acae4a0d3..5f00b53a21 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/new-line/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/new-line/output.json @@ -1,127 +1,36 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":13}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - } - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4}}, "expression": { "type": "Identifier", - "start": 0, - "end": 4, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 4 - }, - "identifierName": "type" - }, + "start":0,"end":4,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":4},"identifierName":"type"}, "name": "type" } }, { "type": "ExpressionStatement", - "start": 5, - "end": 18, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 13 - } - }, + "start":5,"end":18,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":13}}, "expression": { "type": "AssignmentExpression", - "start": 5, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 12 - } - }, + "start":5,"end":17,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":12}}, "operator": "=", "left": { "type": "Identifier", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 3 - }, - "identifierName": "Foo" - }, + "start":5,"end":8,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":3},"identifierName":"Foo"}, "name": "Foo" }, "right": { "type": "Identifier", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 12 - }, - "identifierName": "string" - }, + "start":11,"end":17,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":12},"identifierName":"string"}, "name": "string" } } 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 875a3e53d0..5b8fb1442f 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 @@ -1,233 +1,65 @@ { "type": "File", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "program": { "type": "Program", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 87, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 5, - "column": 2 - } - }, + "start":0,"end":87,"loc":{"start":{"line":1,"column":0},"end":{"line":5,"column":2}}, "declarations": [ { "type": "VariableDeclarator", - "start": 6, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":6,"end":86,"loc":{"start":{"line":1,"column":6},"end":{"line":5,"column":1}}, "id": { "type": "Identifier", - "start": 6, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "table" - }, + "start":6,"end":11,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":11},"identifierName":"table"}, "name": "table" }, "init": { "type": "ObjectExpression", - "start": 14, - "end": 86, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 5, - "column": 1 - } - }, + "start":14,"end":86,"loc":{"start":{"line":1,"column":14},"end":{"line":5,"column":1}}, "properties": [ { "type": "ObjectMethod", - "start": 18, - "end": 84, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "start":18,"end":84,"loc":{"start":{"line":2,"column":2},"end":{"line":4,"column":3}}, "method": true, "key": { "type": "Identifier", - "start": 18, - "end": 21, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 5 - }, - "identifierName": "put" - }, + "start":18,"end":21,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":5},"identifierName":"put"}, "name": "put" }, "computed": false, "typeParameters": { "type": "TSTypeParameterDeclaration", - "start": 21, - "end": 47, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 31 - } - }, + "start":21,"end":47,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":31}}, "params": [ { "type": "TSTypeParameter", - "start": 22, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 6 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":22,"end":46,"loc":{"start":{"line":2,"column":6},"end":{"line":2,"column":30}}, "name": "T", "constraint": { "type": "TSTypeLiteral", - "start": 32, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 30 - } - }, + "start":32,"end":46,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":30}}, "members": [ { "type": "TSPropertySignature", - "start": 34, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":34,"end":44,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":28}}, "key": { "type": "Identifier", - "start": 34, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "id" - }, + "start":34,"end":36,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":20},"identifierName":"id"}, "name": "id" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 36, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 20 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":36,"end":44,"loc":{"start":{"line":2,"column":20},"end":{"line":2,"column":28}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 38, - "end": 44, - "loc": { - "start": { - "line": 2, - "column": 22 - }, - "end": { - "line": 2, - "column": 28 - } - } + "start":38,"end":44,"loc":{"start":{"line":2,"column":22},"end":{"line":2,"column":28}} } } } @@ -243,63 +75,17 @@ "params": [ { "type": "Identifier", - "start": 48, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 32 - }, - "end": { - "line": 2, - "column": 40 - }, - "identifierName": "value" - }, + "start":48,"end":56,"loc":{"start":{"line":2,"column":32},"end":{"line":2,"column":40},"identifierName":"value"}, "name": "value", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 53, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 37 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":53,"end":56,"loc":{"start":{"line":2,"column":37},"end":{"line":2,"column":40}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 39 - }, - "end": { - "line": 2, - "column": 40 - } - }, + "start":55,"end":56,"loc":{"start":{"line":2,"column":39},"end":{"line":2,"column":40}}, "typeName": { "type": "Identifier", - "start": 55, - "end": 56, - "loc": { - "start": { - "line": 2, - "column": 39 - }, - "end": { - "line": 2, - "column": 40 - }, - "identifierName": "T" - }, + "start":55,"end":56,"loc":{"start":{"line":2,"column":39},"end":{"line":2,"column":40},"identifierName":"T"}, "name": "T" } } @@ -308,36 +94,14 @@ ], "body": { "type": "BlockStatement", - "start": 58, - "end": 84, - "loc": { - "start": { - "line": 2, - "column": 42 - }, - "end": { - "line": 4, - "column": 3 - } - }, + "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 - } - } + "start":64,"end":80,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":20}} } ] } @@ -355,18 +119,7 @@ { "type": "CommentLine", "value": " actually put.", - "start": 64, - "end": 80, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 20 - } - } + "start":64,"end":80,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":20}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/parenthesized/output.json b/packages/babel-parser/test/fixtures/typescript/types/parenthesized/output.json index 29c9133d8a..70391b5255 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/parenthesized/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/parenthesized/output.json @@ -1,93 +1,26 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 6, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 6 - }, - "identifierName": "T" - }, + "start":5,"end":6,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":6},"identifierName":"T"}, "name": "T" }, "typeAnnotation": { "type": "TSParenthesizedType", - "start": 9, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 13 - } - }, + "start":9,"end":13,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":13}}, "typeAnnotation": { "type": "TSTypeLiteral", - "start": 10, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 12 - } - }, + "start":10,"end":12,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":12}}, "members": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-1/output.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-1/output.json index ced722e79d..05caa4bb0b 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/read-only-1/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/read-only-1/output.json @@ -1,115 +1,37 @@ { "type": "File", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "errors": [ "SyntaxError: 'readonly' type modifier is only permitted on array and tuple literal types. (1:11)" ], "program": { "type": "Program", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "start": 0, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":0,"end":27,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "T30" - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"T30"}, "name": "T30" }, "typeAnnotation": { "type": "TSTypeOperator", - "start": 11, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":11,"end":26,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":26}}, "operator": "readonly", "typeAnnotation": { "type": "TSStringKeyword", - "start": 20, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 26 - } - } + "start":20,"end":26,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":26}} } }, "trailingComments": [ { "type": "CommentLine", "value": " Error", - "start": 29, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":29,"end":37,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":37}} } ] } @@ -120,18 +42,7 @@ { "type": "CommentLine", "value": " Error", - "start": 29, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":29,"end":37,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":37}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-2/output.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-2/output.json index 73c4d7d4cd..95f72e236e 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/read-only-2/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/read-only-2/output.json @@ -1,112 +1,33 @@ { "type": "File", - "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}}, "errors": [ "SyntaxError: 'readonly' type modifier is only permitted on array and tuple literal types. (1:11)" ], "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "T31" - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"T31"}, "name": "T31" }, "typeAnnotation": { "type": "TSTypeOperator", - "start": 11, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":11,"end":21,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":21}}, "operator": "readonly", "typeAnnotation": { "type": "TSTypeReference", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - } - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21}}, "typeName": { "type": "Identifier", - "start": 20, - "end": 21, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 21 - }, - "identifierName": "T" - }, + "start":20,"end":21,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":21},"identifierName":"T"}, "name": "T" } } @@ -115,18 +36,7 @@ { "type": "CommentLine", "value": " Error", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 32 - } - } + "start":24,"end":32,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":32}} } ] } @@ -137,18 +47,7 @@ { "type": "CommentLine", "value": " Error", - "start": 24, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 32 - } - } + "start":24,"end":32,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":32}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-3/output.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-3/output.json index 8a977f1e39..852a87e4d3 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/read-only-3/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/read-only-3/output.json @@ -1,126 +1,37 @@ { "type": "File", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "errors": [ "SyntaxError: 'readonly' type modifier is only permitted on array and tuple literal types. (1:11)" ], "program": { "type": "Program", - "start": 0, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 48 - } - }, + "start":0,"end":48,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":48}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "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}}, "id": { "type": "Identifier", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "T32" - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"T32"}, "name": "T32" }, "typeAnnotation": { "type": "TSTypeOperator", - "start": 11, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":11,"end":37,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":37}}, "operator": "readonly", "typeAnnotation": { "type": "TSTypeOperator", - "start": 20, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":20,"end":37,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":37}}, "operator": "readonly", "typeAnnotation": { "type": "TSArrayType", - "start": 29, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":29,"end":37,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":37}}, "elementType": { "type": "TSStringKeyword", - "start": 29, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 29 - }, - "end": { - "line": 1, - "column": 35 - } - } + "start":29,"end":35,"loc":{"start":{"line":1,"column":29},"end":{"line":1,"column":35}} } } } @@ -129,18 +40,7 @@ { "type": "CommentLine", "value": " Error", - "start": 40, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 48 - } - } + "start":40,"end":48,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":48}} } ] } @@ -151,18 +51,7 @@ { "type": "CommentLine", "value": " Error", - "start": 40, - "end": 48, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 48 - } - } + "start":40,"end":48,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":48}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/read-only-4/output.json b/packages/babel-parser/test/fixtures/typescript/types/read-only-4/output.json index 0e0dd2eb9f..b787889c9d 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/read-only-4/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/read-only-4/output.json @@ -1,143 +1,42 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "errors": [ "SyntaxError: 'readonly' type modifier is only permitted on array and tuple literal types. (1:11)" ], "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "TSTypeAliasDeclaration", - "start": 0, - "end": 34, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 34 - } - }, + "start":0,"end":34,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":34}}, "id": { "type": "Identifier", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "T33" - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8},"identifierName":"T33"}, "name": "T33" }, "typeAnnotation": { "type": "TSTypeOperator", - "start": 11, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":11,"end":33,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":33}}, "operator": "readonly", "typeAnnotation": { "type": "TSTypeReference", - "start": 20, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":20,"end":33,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":33}}, "typeName": { "type": "Identifier", - "start": 20, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 25 - }, - "identifierName": "Array" - }, + "start":20,"end":25,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":25},"identifierName":"Array"}, "name": "Array" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 25, - "end": 33, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 33 - } - }, + "start":25,"end":33,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":33}}, "params": [ { "type": "TSStringKeyword", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - } + "start":26,"end":32,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":32}} } ] } @@ -147,18 +46,7 @@ { "type": "CommentLine", "value": " Error", - "start": 36, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 44 - } - } + "start":36,"end":44,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":44}} } ] } @@ -169,18 +57,7 @@ { "type": "CommentLine", "value": " Error", - "start": 36, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 44 - } - } + "start":36,"end":44,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":44}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/reference-generic-nested/output.json b/packages/babel-parser/test/fixtures/typescript/types/reference-generic-nested/output.json index d233c0685d..15946fb368 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/reference-generic-nested/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/reference-generic-nested/output.json @@ -1,199 +1,53 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27}}, "id": { "type": "Identifier", - "start": 4, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 27 - }, - "identifierName": "x" - }, + "start":4,"end":27,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":27},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":5,"end":27,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 7, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":7,"end":27,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":27}}, "typeName": { "type": "Identifier", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "Array" - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12},"identifierName":"Array"}, "name": "Array" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 12, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":12,"end":27,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":27}}, "params": [ { "type": "TSTypeReference", - "start": 13, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":13,"end":26,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":26}}, "typeName": { "type": "Identifier", - "start": 13, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 18 - }, - "identifierName": "Array" - }, + "start":13,"end":18,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":18},"identifierName":"Array"}, "name": "Array" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 18, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 18 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":18,"end":26,"loc":{"start":{"line":1,"column":18},"end":{"line":1,"column":26}}, "params": [ { "type": "TSNumberKeyword", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}} } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/types/reference-generic/output.json b/packages/babel-parser/test/fixtures/typescript/types/reference-generic/output.json index 56873561f5..644490d177 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/reference-generic/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/reference-generic/output.json @@ -1,153 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20}}, "id": { "type": "Identifier", - "start": 4, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "x" - }, + "start":4,"end":20,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":20},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":5,"end":20,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":20}}, "typeAnnotation": { "type": "TSTypeReference", - "start": 7, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":7,"end":20,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":20}}, "typeName": { "type": "Identifier", - "start": 7, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "Array" - }, + "start":7,"end":12,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":12},"identifierName":"Array"}, "name": "Array" }, "typeParameters": { "type": "TSTypeParameterInstantiation", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "params": [ { "type": "TSNumberKeyword", - "start": 13, - "end": 19, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 19 - } - } + "start":13,"end":19,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":19}} } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/types/reference/output.json b/packages/babel-parser/test/fixtures/typescript/types/reference/output.json index 2608329122..74f7532232 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/reference/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/reference/output.json @@ -1,122 +1,32 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8}}, "id": { "type": "Identifier", - "start": 4, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "x" - }, + "start":4,"end":8,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":8},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 8 - } - }, + "start":5,"end":8,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":8}}, "typeAnnotation": { "type": "TSTypeReference", - "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}}, "typeName": { "type": "Identifier", - "start": 7, - "end": 8, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 8 - }, - "identifierName": "T" - }, + "start":7,"end":8,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":8},"identifierName":"T"}, "name": "T" } } diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-empty/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-empty/output.json index 667ffcb301..6137ce4073 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/tuple-empty/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-empty/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 9 - }, - "identifierName": "x" - }, + "start":4,"end":9,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":9},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 9, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 9 - } - }, + "start":5,"end":9,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":9}}, "typeAnnotation": { "type": "TSTupleType", - "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}}, "elementTypes": [] } } diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/output.json index b66ac1ec73..f15efb254a 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-optional-invalid/output.json @@ -1,155 +1,44 @@ { "type": "File", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "errors": [ "SyntaxError: A required element cannot follow an optional element. (1:17)" ], "program": { "type": "Program", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":0,"end":24,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":24}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24}}, "id": { "type": "Identifier", - "start": 4, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 24 - }, - "identifierName": "x" - }, + "start":4,"end":24,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":24},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":5,"end":24,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":24}}, "typeAnnotation": { "type": "TSTupleType", - "start": 7, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 24 - } - }, + "start":7,"end":24,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":24}}, "elementTypes": [ { "type": "TSOptionalType", - "start": 8, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 15 - } - }, + "start":8,"end":15,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":15}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}} } }, { "type": "TSNumberKeyword", - "start": 17, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 17 - }, - "end": { - "line": 1, - "column": 23 - } - } + "start":17,"end":23,"loc":{"start":{"line":1,"column":17},"end":{"line":1,"column":23}} } ] } 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 90aaa9bc8a..224e952da4 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 @@ -1,225 +1,59 @@ { "type": "File", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "program": { "type": "Program", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":0,"end":44,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":44}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":4,"end":44,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":44}}, "id": { "type": "Identifier", - "start": 4, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 44 - }, - "identifierName": "x" - }, + "start":4,"end":44,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":44},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":5,"end":44,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":44}}, "typeAnnotation": { "type": "TSTupleType", - "start": 7, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":7,"end":44,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":44}}, "elementTypes": [ { "type": "TSStringKeyword", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}} }, { "type": "TSOptionalType", - "start": 16, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":16,"end":23,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":23}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} } }, { "type": "TSOptionalType", - "start": 25, - "end": 43, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 43 - } - }, + "start":25,"end":43,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":43}}, "typeAnnotation": { "type": "TSParenthesizedType", - "start": 25, - "end": 42, - "loc": { - "start": { - "line": 1, - "column": 25 - }, - "end": { - "line": 1, - "column": 42 - } - }, + "start":25,"end":42,"loc":{"start":{"line":1,"column":25},"end":{"line":1,"column":42}}, "typeAnnotation": { "type": "TSUnionType", - "start": 26, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 41 - } - }, + "start":26,"end":41,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":41}}, "types": [ { "type": "TSStringKeyword", - "start": 26, - "end": 32, - "loc": { - "start": { - "line": 1, - "column": 26 - }, - "end": { - "line": 1, - "column": 32 - } - } + "start":26,"end":32,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":32}} }, { "type": "TSNumberKeyword", - "start": 35, - "end": 41, - "loc": { - "start": { - "line": 1, - "column": 35 - }, - "end": { - "line": 1, - "column": 41 - } - } + "start":35,"end":41,"loc":{"start":{"line":1,"column":35},"end":{"line":1,"column":41}} } ] } @@ -237,4 +71,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-rest-after-optional/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-rest-after-optional/output.json index 1d71afdaae..c3bd73a9c0 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/tuple-rest-after-optional/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-rest-after-optional/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "program": { "type": "Program", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":0,"end":56,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":56}}, "id": { "type": "Identifier", - "start": 9, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "foo" - }, + "start":9,"end":12,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":12},"identifierName":"foo"}, "name": "foo" }, "generator": false, @@ -65,151 +20,40 @@ "params": [ { "type": "RestElement", - "start": 13, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":13,"end":52,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":52}}, "argument": { "type": "Identifier", - "start": 16, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 20 - }, - "identifierName": "args" - }, + "start":16,"end":20,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":20},"identifierName":"args"}, "name": "args" }, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 20, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":20,"end":52,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":52}}, "typeAnnotation": { "type": "TSTupleType", - "start": 22, - "end": 52, - "loc": { - "start": { - "line": 1, - "column": 22 - }, - "end": { - "line": 1, - "column": 52 - } - }, + "start":22,"end":52,"loc":{"start":{"line":1,"column":22},"end":{"line":1,"column":52}}, "elementTypes": [ { "type": "TSNumberKeyword", - "start": 23, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 23 - }, - "end": { - "line": 1, - "column": 29 - } - } + "start":23,"end":29,"loc":{"start":{"line":1,"column":23},"end":{"line":1,"column":29}} }, { "type": "TSOptionalType", - "start": 31, - "end": 38, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 38 - } - }, + "start":31,"end":38,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":38}}, "typeAnnotation": { "type": "TSStringKeyword", - "start": 31, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 31 - }, - "end": { - "line": 1, - "column": 37 - } - } + "start":31,"end":37,"loc":{"start":{"line":1,"column":31},"end":{"line":1,"column":37}} } }, { "type": "TSRestType", - "start": 40, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 40 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":40,"end":51,"loc":{"start":{"line":1,"column":40},"end":{"line":1,"column":51}}, "typeAnnotation": { "type": "TSArrayType", - "start": 43, - "end": 51, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 51 - } - }, + "start":43,"end":51,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":51}}, "elementType": { "type": "TSNumberKeyword", - "start": 43, - "end": 49, - "loc": { - "start": { - "line": 1, - "column": 43 - }, - "end": { - "line": 1, - "column": 49 - } - } + "start":43,"end":49,"loc":{"start":{"line":1,"column":43},"end":{"line":1,"column":49}} } } } @@ -220,18 +64,7 @@ ], "body": { "type": "BlockStatement", - "start": 54, - "end": 56, - "loc": { - "start": { - "line": 1, - "column": 54 - }, - "end": { - "line": 1, - "column": 56 - } - }, + "start":54,"end":56,"loc":{"start":{"line":1,"column":54},"end":{"line":1,"column":56}}, "body": [], "directives": [] } diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-rest-trailing-comma/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-rest-trailing-comma/output.json index 28b281a6cc..fcc0224f81 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/tuple-rest-trailing-comma/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-rest-trailing-comma/output.json @@ -1,165 +1,43 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":4,"end":29,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":29}}, "id": { "type": "Identifier", - "start": 4, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 29 - }, - "identifierName": "x" - }, + "start":4,"end":29,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":29},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":5,"end":29,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":29}}, "typeAnnotation": { "type": "TSTupleType", - "start": 7, - "end": 29, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 29 - } - }, + "start":7,"end":29,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":29}}, "elementTypes": [ { "type": "TSStringKeyword", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}} }, { "type": "TSRestType", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":16,"end":27,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "TSArrayType", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "elementType": { "type": "TSStringKeyword", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}} } } } diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple-rest/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple-rest/output.json index fd5b5999c5..45db8aad93 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/tuple-rest/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple-rest/output.json @@ -1,165 +1,43 @@ { "type": "File", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "program": { "type": "Program", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":0,"end":28,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":28}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":4,"end":28,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":28}}, "id": { "type": "Identifier", - "start": 4, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 28 - }, - "identifierName": "x" - }, + "start":4,"end":28,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":28},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":5,"end":28,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":28}}, "typeAnnotation": { "type": "TSTupleType", - "start": 7, - "end": 28, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 28 - } - }, + "start":7,"end":28,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":28}}, "elementTypes": [ { "type": "TSStringKeyword", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}} }, { "type": "TSRestType", - "start": 16, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":16,"end":27,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":27}}, "typeAnnotation": { "type": "TSArrayType", - "start": 19, - "end": 27, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 27 - } - }, + "start":19,"end":27,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":27}}, "elementType": { "type": "TSNumberKeyword", - "start": 19, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 19 - }, - "end": { - "line": 1, - "column": 25 - } - } + "start":19,"end":25,"loc":{"start":{"line":1,"column":19},"end":{"line":1,"column":25}} } } } @@ -175,4 +53,4 @@ ], "directives": [] } -} +} \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/tuple/output.json b/packages/babel-parser/test/fixtures/typescript/types/tuple/output.json index 5b6c0e2cff..429c0b8d80 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/tuple/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/tuple/output.json @@ -1,152 +1,41 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":4,"end":31,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":31}}, "id": { "type": "Identifier", - "start": 4, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 31 - }, - "identifierName": "x" - }, + "start":4,"end":31,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":31},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":5,"end":31,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":31}}, "typeAnnotation": { "type": "TSTupleType", - "start": 7, - "end": 31, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 31 - } - }, + "start":7,"end":31,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":31}}, "elementTypes": [ { "type": "TSNumberKeyword", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}} }, { "type": "TSNumberKeyword", - "start": 16, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 22 - } - } + "start":16,"end":22,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":22}} }, { "type": "TSNumberKeyword", - "start": 24, - "end": 30, - "loc": { - "start": { - "line": 1, - "column": 24 - }, - "end": { - "line": 1, - "column": 30 - } - } + "start":24,"end":30,"loc":{"start":{"line":1,"column":24},"end":{"line":1,"column":30}} } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/types/type-literal/output.json b/packages/babel-parser/test/fixtures/typescript/types/type-literal/output.json index d3e4066546..4522046cb5 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/type-literal/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/type-literal/output.json @@ -1,168 +1,45 @@ { "type": "File", - "start": 0, - "end": 120, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 96 - } - }, + "start":0,"end":120,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":96}}, "program": { "type": "Program", - "start": 0, - "end": 120, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 2, - "column": 96 - } - }, + "start":0,"end":120,"loc":{"start":{"line":1,"column":0},"end":{"line":2,"column":96}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 23, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 23 - } - }, + "start":0,"end":23,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":23}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22}}, "id": { "type": "Identifier", - "start": 4, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 22 - }, - "identifierName": "obj" - }, + "start":4,"end":22,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":22},"identifierName":"obj"}, "name": "obj", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 7, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":7,"end":22,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":22}}, "typeAnnotation": { "type": "TSTypeLiteral", - "start": 9, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":9,"end":22,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":22}}, "members": [ { "type": "TSPropertySignature", - "start": 11, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":11,"end":20,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":20}}, "key": { "type": "Identifier", - "start": 11, - "end": 12, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 12 - }, - "identifierName": "x" - }, + "start":11,"end":12,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":12},"identifierName":"x"}, "name": "x" }, "computed": false, "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 12, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 20 - } - }, + "start":12,"end":20,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":20}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 14, - "end": 20, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 20 - } - } + "start":14,"end":20,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":20}} } } } @@ -178,18 +55,7 @@ { "type": "CommentLine", "value": " Type literals have the same body syntax as interfaces, so see `interface` directory for that.", - "start": 24, - "end": 120, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 96 - } - } + "start":24,"end":120,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":96}} } ] } @@ -200,18 +66,7 @@ { "type": "CommentLine", "value": " Type literals have the same body syntax as interfaces, so see `interface` directory for that.", - "start": 24, - "end": 120, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 96 - } - } + "start":24,"end":120,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":96}} } ] } \ No newline at end of file diff --git a/packages/babel-parser/test/fixtures/typescript/types/type-operator/output.json b/packages/babel-parser/test/fixtures/typescript/types/type-operator/output.json index 4f8b2fb758..166fbe6893 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/type-operator/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/type-operator/output.json @@ -1,137 +1,36 @@ { "type": "File", - "start": 0, - "end": 98, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 34 - } - }, + "start":0,"end":98,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":34}}, "program": { "type": "Program", - "start": 0, - "end": 98, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 34 - } - }, + "start":0,"end":98,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":34}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "x" - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":5,"end":14,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":14}}, "typeAnnotation": { "type": "TSTypeOperator", - "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}}, "operator": "keyof", "typeAnnotation": { "type": "TSTypeReference", - "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}}, "typeName": { "type": "Identifier", - "start": 13, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 13 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "T" - }, + "start":13,"end":14,"loc":{"start":{"line":1,"column":13},"end":{"line":1,"column":14},"identifierName":"T"}, "name": "T" } } @@ -145,92 +44,25 @@ }, { "type": "VariableDeclaration", - "start": 16, - "end": 37, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 21 - } - }, + "start":16,"end":37,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":21}}, "declarations": [ { "type": "VariableDeclarator", - "start": 20, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":20,"end":36,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":20}}, "id": { "type": "Identifier", - "start": 20, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 20 - }, - "identifierName": "y" - }, + "start":20,"end":36,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":20},"identifierName":"y"}, "name": "y", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 21, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 5 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":21,"end":36,"loc":{"start":{"line":2,"column":5},"end":{"line":2,"column":20}}, "typeAnnotation": { "type": "TSTypeOperator", - "start": 23, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 7 - }, - "end": { - "line": 2, - "column": 20 - } - }, + "start":23,"end":36,"loc":{"start":{"line":2,"column":7},"end":{"line":2,"column":20}}, "operator": "unique", "typeAnnotation": { "type": "TSSymbolKeyword", - "start": 30, - "end": 36, - "loc": { - "start": { - "line": 2, - "column": 14 - }, - "end": { - "line": 2, - "column": 20 - } - } + "start":30,"end":36,"loc":{"start":{"line":2,"column":14},"end":{"line":2,"column":20}} } } } @@ -242,106 +74,28 @@ }, { "type": "VariableDeclaration", - "start": 38, - "end": 63, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 25 - } - }, + "start":38,"end":63,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":25}}, "declarations": [ { "type": "VariableDeclarator", - "start": 42, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":42,"end":62,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":24}}, "id": { "type": "Identifier", - "start": 42, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 24 - }, - "identifierName": "z" - }, + "start":42,"end":62,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":24},"identifierName":"z"}, "name": "z", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 43, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 5 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":43,"end":62,"loc":{"start":{"line":3,"column":5},"end":{"line":3,"column":24}}, "typeAnnotation": { "type": "TSTypeOperator", - "start": 45, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 7 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":45,"end":62,"loc":{"start":{"line":3,"column":7},"end":{"line":3,"column":24}}, "operator": "readonly", "typeAnnotation": { "type": "TSArrayType", - "start": 54, - "end": 62, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 24 - } - }, + "start":54,"end":62,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":24}}, "elementType": { "type": "TSNumberKeyword", - "start": 54, - "end": 60, - "loc": { - "start": { - "line": 3, - "column": 16 - }, - "end": { - "line": 3, - "column": 22 - } - } + "start":54,"end":60,"loc":{"start":{"line":3,"column":16},"end":{"line":3,"column":22}} } } } @@ -354,122 +108,33 @@ }, { "type": "VariableDeclaration", - "start": 64, - "end": 98, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 34 - } - }, + "start":64,"end":98,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 68, - "end": 97, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 33 - } - }, + "start":68,"end":97,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":33}}, "id": { "type": "Identifier", - "start": 68, - "end": 97, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 33 - }, - "identifierName": "z1" - }, + "start":68,"end":97,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":33},"identifierName":"z1"}, "name": "z1", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 70, - "end": 97, - "loc": { - "start": { - "line": 4, - "column": 6 - }, - "end": { - "line": 4, - "column": 33 - } - }, + "start":70,"end":97,"loc":{"start":{"line":4,"column":6},"end":{"line":4,"column":33}}, "typeAnnotation": { "type": "TSTypeOperator", - "start": 72, - "end": 97, - "loc": { - "start": { - "line": 4, - "column": 8 - }, - "end": { - "line": 4, - "column": 33 - } - }, + "start":72,"end":97,"loc":{"start":{"line":4,"column":8},"end":{"line":4,"column":33}}, "operator": "readonly", "typeAnnotation": { "type": "TSTupleType", - "start": 81, - "end": 97, - "loc": { - "start": { - "line": 4, - "column": 17 - }, - "end": { - "line": 4, - "column": 33 - } - }, + "start":81,"end":97,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":33}}, "elementTypes": [ { "type": "TSNumberKeyword", - "start": 82, - "end": 88, - "loc": { - "start": { - "line": 4, - "column": 18 - }, - "end": { - "line": 4, - "column": 24 - } - } + "start":82,"end":88,"loc":{"start":{"line":4,"column":18},"end":{"line":4,"column":24}} }, { "type": "TSNumberKeyword", - "start": 90, - "end": 96, - "loc": { - "start": { - "line": 4, - "column": 26 - }, - "end": { - "line": 4, - "column": 32 - } - } + "start":90,"end":96,"loc":{"start":{"line":4,"column":26},"end":{"line":4,"column":32}} } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/types/typeof/output.json b/packages/babel-parser/test/fixtures/typescript/types/typeof/output.json index 20e7401b1f..4887ea6d5b 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/typeof/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/typeof/output.json @@ -1,153 +1,40 @@ { "type": "File", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "program": { "type": "Program", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 18, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 18 - } - }, + "start":0,"end":18,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":18}}, "declarations": [ { "type": "VariableDeclarator", - "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}}, "id": { "type": "Identifier", - "start": 4, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "x" - }, + "start":4,"end":17,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":17},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 5, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 5 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":5,"end":17,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":17}}, "typeAnnotation": { "type": "TSTypeQuery", - "start": 7, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 7 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":7,"end":17,"loc":{"start":{"line":1,"column":7},"end":{"line":1,"column":17}}, "exprName": { "type": "TSQualifiedName", - "start": 14, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 17 - } - }, + "start":14,"end":17,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":17}}, "left": { "type": "Identifier", - "start": 14, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "y" - }, + "start":14,"end":15,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":15},"identifierName":"y"}, "name": "y" }, "right": { "type": "Identifier", - "start": 16, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 1, - "column": 17 - }, - "identifierName": "z" - }, + "start":16,"end":17,"loc":{"start":{"line":1,"column":16},"end":{"line":1,"column":17},"identifierName":"z"}, "name": "z" } } diff --git a/packages/babel-parser/test/fixtures/typescript/types/union-intersection/output.json b/packages/babel-parser/test/fixtures/typescript/types/union-intersection/output.json index 4d1c861ed1..6d659d4ac7 100644 --- a/packages/babel-parser/test/fixtures/typescript/types/union-intersection/output.json +++ b/packages/babel-parser/test/fixtures/typescript/types/union-intersection/output.json @@ -1,152 +1,41 @@ { "type": "File", - "start": 0, - "end": 160, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 43 - } - }, + "start":0,"end":160,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":43}}, "program": { "type": "Program", - "start": 0, - "end": 160, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 4, - "column": 43 - } - }, + "start":0,"end":160,"loc":{"start":{"line":1,"column":0},"end":{"line":4,"column":43}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "start": 0, - "end": 37, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 37 - } - }, + "start":0,"end":37,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":37}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36}}, "id": { "type": "Identifier", - "start": 4, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 36 - }, - "identifierName": "union" - }, + "start":4,"end":36,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":36},"identifierName":"union"}, "name": "union", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 9, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 9 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":9,"end":36,"loc":{"start":{"line":1,"column":9},"end":{"line":1,"column":36}}, "typeAnnotation": { "type": "TSUnionType", - "start": 11, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 36 - } - }, + "start":11,"end":36,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":36}}, "types": [ { "type": "TSNumberKeyword", - "start": 11, - "end": 17, - "loc": { - "start": { - "line": 1, - "column": 11 - }, - "end": { - "line": 1, - "column": 17 - } - } + "start":11,"end":17,"loc":{"start":{"line":1,"column":11},"end":{"line":1,"column":17}} }, { "type": "TSNullKeyword", - "start": 20, - "end": 24, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 24 - } - } + "start":20,"end":24,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":24}} }, { "type": "TSUndefinedKeyword", - "start": 27, - "end": 36, - "loc": { - "start": { - "line": 1, - "column": 27 - }, - "end": { - "line": 1, - "column": 36 - } - } + "start":27,"end":36,"loc":{"start":{"line":1,"column":27},"end":{"line":1,"column":36}} } ] } @@ -159,107 +48,29 @@ }, { "type": "VariableDeclaration", - "start": 38, - "end": 72, - "loc": { - "start": { - "line": 2, - "column": 0 - }, - "end": { - "line": 2, - "column": 34 - } - }, + "start":38,"end":72,"loc":{"start":{"line":2,"column":0},"end":{"line":2,"column":34}}, "declarations": [ { "type": "VariableDeclarator", - "start": 42, - "end": 71, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":42,"end":71,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":33}}, "id": { "type": "Identifier", - "start": 42, - "end": 71, - "loc": { - "start": { - "line": 2, - "column": 4 - }, - "end": { - "line": 2, - "column": 33 - }, - "identifierName": "intersection" - }, + "start":42,"end":71,"loc":{"start":{"line":2,"column":4},"end":{"line":2,"column":33},"identifierName":"intersection"}, "name": "intersection", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 54, - "end": 71, - "loc": { - "start": { - "line": 2, - "column": 16 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":54,"end":71,"loc":{"start":{"line":2,"column":16},"end":{"line":2,"column":33}}, "typeAnnotation": { "type": "TSIntersectionType", - "start": 56, - "end": 71, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":56,"end":71,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":33}}, "types": [ { "type": "TSNumberKeyword", - "start": 56, - "end": 62, - "loc": { - "start": { - "line": 2, - "column": 18 - }, - "end": { - "line": 2, - "column": 24 - } - } + "start":56,"end":62,"loc":{"start":{"line":2,"column":18},"end":{"line":2,"column":24}} }, { "type": "TSStringKeyword", - "start": 65, - "end": 71, - "loc": { - "start": { - "line": 2, - "column": 27 - }, - "end": { - "line": 2, - "column": 33 - } - } + "start":65,"end":71,"loc":{"start":{"line":2,"column":27},"end":{"line":2,"column":33}} } ] } @@ -272,137 +83,37 @@ }, { "type": "VariableDeclaration", - "start": 73, - "end": 116, - "loc": { - "start": { - "line": 3, - "column": 0 - }, - "end": { - "line": 3, - "column": 43 - } - }, + "start":73,"end":116,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":43}}, "declarations": [ { "type": "VariableDeclarator", - "start": 77, - "end": 115, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 42 - } - }, + "start":77,"end":115,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":42}}, "id": { "type": "Identifier", - "start": 77, - "end": 115, - "loc": { - "start": { - "line": 3, - "column": 4 - }, - "end": { - "line": 3, - "column": 42 - }, - "identifierName": "precedence1" - }, + "start":77,"end":115,"loc":{"start":{"line":3,"column":4},"end":{"line":3,"column":42},"identifierName":"precedence1"}, "name": "precedence1", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 88, - "end": 115, - "loc": { - "start": { - "line": 3, - "column": 15 - }, - "end": { - "line": 3, - "column": 42 - } - }, + "start":88,"end":115,"loc":{"start":{"line":3,"column":15},"end":{"line":3,"column":42}}, "typeAnnotation": { "type": "TSUnionType", - "start": 90, - "end": 115, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 42 - } - }, + "start":90,"end":115,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":42}}, "types": [ { "type": "TSNumberKeyword", - "start": 90, - "end": 96, - "loc": { - "start": { - "line": 3, - "column": 17 - }, - "end": { - "line": 3, - "column": 23 - } - } + "start":90,"end":96,"loc":{"start":{"line":3,"column":17},"end":{"line":3,"column":23}} }, { "type": "TSIntersectionType", - "start": 99, - "end": 115, - "loc": { - "start": { - "line": 3, - "column": 26 - }, - "end": { - "line": 3, - "column": 42 - } - }, + "start":99,"end":115,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":42}}, "types": [ { "type": "TSStringKeyword", - "start": 99, - "end": 105, - "loc": { - "start": { - "line": 3, - "column": 26 - }, - "end": { - "line": 3, - "column": 32 - } - } + "start":99,"end":105,"loc":{"start":{"line":3,"column":26},"end":{"line":3,"column":32}} }, { "type": "TSBooleanKeyword", - "start": 108, - "end": 115, - "loc": { - "start": { - "line": 3, - "column": 35 - }, - "end": { - "line": 3, - "column": 42 - } - } + "start":108,"end":115,"loc":{"start":{"line":3,"column":35},"end":{"line":3,"column":42}} } ] } @@ -417,139 +128,39 @@ }, { "type": "VariableDeclaration", - "start": 117, - "end": 160, - "loc": { - "start": { - "line": 4, - "column": 0 - }, - "end": { - "line": 4, - "column": 43 - } - }, + "start":117,"end":160,"loc":{"start":{"line":4,"column":0},"end":{"line":4,"column":43}}, "declarations": [ { "type": "VariableDeclarator", - "start": 121, - "end": 159, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 42 - } - }, + "start":121,"end":159,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":42}}, "id": { "type": "Identifier", - "start": 121, - "end": 159, - "loc": { - "start": { - "line": 4, - "column": 4 - }, - "end": { - "line": 4, - "column": 42 - }, - "identifierName": "precedence2" - }, + "start":121,"end":159,"loc":{"start":{"line":4,"column":4},"end":{"line":4,"column":42},"identifierName":"precedence2"}, "name": "precedence2", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 132, - "end": 159, - "loc": { - "start": { - "line": 4, - "column": 15 - }, - "end": { - "line": 4, - "column": 42 - } - }, + "start":132,"end":159,"loc":{"start":{"line":4,"column":15},"end":{"line":4,"column":42}}, "typeAnnotation": { "type": "TSUnionType", - "start": 134, - "end": 159, - "loc": { - "start": { - "line": 4, - "column": 17 - }, - "end": { - "line": 4, - "column": 42 - } - }, + "start":134,"end":159,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":42}}, "types": [ { "type": "TSIntersectionType", - "start": 134, - "end": 149, - "loc": { - "start": { - "line": 4, - "column": 17 - }, - "end": { - "line": 4, - "column": 32 - } - }, + "start":134,"end":149,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":32}}, "types": [ { "type": "TSNumberKeyword", - "start": 134, - "end": 140, - "loc": { - "start": { - "line": 4, - "column": 17 - }, - "end": { - "line": 4, - "column": 23 - } - } + "start":134,"end":140,"loc":{"start":{"line":4,"column":17},"end":{"line":4,"column":23}} }, { "type": "TSStringKeyword", - "start": 143, - "end": 149, - "loc": { - "start": { - "line": 4, - "column": 26 - }, - "end": { - "line": 4, - "column": 32 - } - } + "start":143,"end":149,"loc":{"start":{"line":4,"column":26},"end":{"line":4,"column":32}} } ] }, { "type": "TSBooleanKeyword", - "start": 152, - "end": 159, - "loc": { - "start": { - "line": 4, - "column": 35 - }, - "end": { - "line": 4, - "column": 42 - } - } + "start":152,"end":159,"loc":{"start":{"line":4,"column":35},"end":{"line":4,"column":42}} } ] } diff --git a/packages/babel-parser/test/fixtures/typescript/variable-declarator/definite-assignment/output.json b/packages/babel-parser/test/fixtures/typescript/variable-declarator/definite-assignment/output.json index abd65b02a2..79a5f5d4fc 100644 --- a/packages/babel-parser/test/fixtures/typescript/variable-declarator/definite-assignment/output.json +++ b/packages/babel-parser/test/fixtures/typescript/variable-declarator/definite-assignment/output.json @@ -1,107 +1,29 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "module", "interpreter": null, "body": [ { "type": "VariableDeclaration", - "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}}, "declarations": [ { "type": "VariableDeclarator", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14}}, "id": { "type": "Identifier", - "start": 4, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 14 - }, - "identifierName": "x" - }, + "start":4,"end":14,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":14},"identifierName":"x"}, "name": "x", "typeAnnotation": { "type": "TSTypeAnnotation", - "start": 6, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 6 - }, - "end": { - "line": 1, - "column": 14 - } - }, + "start":6,"end":14,"loc":{"start":{"line":1,"column":6},"end":{"line":1,"column":14}}, "typeAnnotation": { "type": "TSNumberKeyword", - "start": 8, - "end": 14, - "loc": { - "start": { - "line": 1, - "column": 8 - }, - "end": { - "line": 1, - "column": 14 - } - } + "start":8,"end":14,"loc":{"start":{"line":1,"column":8},"end":{"line":1,"column":14}} } } }, diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/expression/await-expression/output.json b/packages/babel-parser/test/fixtures/v8intrinsic/expression/await-expression/output.json index 417906511c..b1bec4d3ef 100644 --- a/packages/babel-parser/test/fixtures/v8intrinsic/expression/await-expression/output.json +++ b/packages/babel-parser/test/fixtures/v8intrinsic/expression/await-expression/output.json @@ -1,155 +1,44 @@ { "type": "File", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "program": { "type": "Program", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "expression": { "type": "ArrowFunctionExpression", - "start": 0, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":0,"end":47,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":47}}, "id": null, "generator": false, "async": true, "params": [], "body": { "type": "BlockStatement", - "start": 12, - "end": 47, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 47 - } - }, + "start":12,"end":47,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":47}}, "body": [ { "type": "ExpressionStatement", - "start": 14, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":14,"end":45,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":45}}, "expression": { "type": "AwaitExpression", - "start": 14, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 14 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":14,"end":45,"loc":{"start":{"line":1,"column":14},"end":{"line":1,"column":45}}, "argument": { "type": "CallExpression", - "start": 20, - "end": 45, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 45 - } - }, + "start":20,"end":45,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":45}}, "callee": { "type": "V8IntrinsicIdentifier", - "start": 20, - "end": 35, - "loc": { - "start": { - "line": 1, - "column": 20 - }, - "end": { - "line": 1, - "column": 35 - }, - "identifierName": "StringParseInt" - }, + "start":20,"end":35,"loc":{"start":{"line":1,"column":20},"end":{"line":1,"column":35},"identifierName":"StringParseInt"}, "name": "StringParseInt" }, "arguments": [ { "type": "StringLiteral", - "start": 36, - "end": 40, - "loc": { - "start": { - "line": 1, - "column": 36 - }, - "end": { - "line": 1, - "column": 40 - } - }, + "start":36,"end":40,"loc":{"start":{"line":1,"column":36},"end":{"line":1,"column":40}}, "extra": { "rawValue": "42", "raw": "\"42\"" @@ -158,18 +47,7 @@ }, { "type": "NumericLiteral", - "start": 42, - "end": 44, - "loc": { - "start": { - "line": 1, - "column": 42 - }, - "end": { - "line": 1, - "column": 44 - } - }, + "start":42,"end":44,"loc":{"start":{"line":1,"column":42},"end":{"line":1,"column":44}}, "extra": { "rawValue": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/expression/call-expression/output.json b/packages/babel-parser/test/fixtures/v8intrinsic/expression/call-expression/output.json index e44d316e19..bb04898cf9 100644 --- a/packages/babel-parser/test/fixtures/v8intrinsic/expression/call-expression/output.json +++ b/packages/babel-parser/test/fixtures/v8intrinsic/expression/call-expression/output.json @@ -1,95 +1,27 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": "V8IntrinsicIdentifier", - "start": 0, - "end": 11, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 11 - }, - "identifierName": "DebugPrint" - }, + "start":0,"end":11,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":11},"identifierName":"DebugPrint"}, "name": "DebugPrint" }, "arguments": [ { "type": "Identifier", - "start": 12, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 12 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "foo" - }, + "start":12,"end":15,"loc":{"start":{"line":1,"column":12},"end":{"line":1,"column":15},"identifierName":"foo"}, "name": "foo" } ] diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/expression/in-new-expression/output.json b/packages/babel-parser/test/fixtures/v8intrinsic/expression/in-new-expression/output.json index c02efb12ae..b1955a2da7 100644 --- a/packages/babel-parser/test/fixtures/v8intrinsic/expression/in-new-expression/output.json +++ b/packages/babel-parser/test/fixtures/v8intrinsic/expression/in-new-expression/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "program": { "type": "Program", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 22, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 22 - } - }, + "start":0,"end":22,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":22}}, "expression": { "type": "NewExpression", - "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}}, "callee": { "type": "V8IntrinsicIdentifier", - "start": 4, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 4 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "DebugPrint" - }, + "start":4,"end":15,"loc":{"start":{"line":1,"column":4},"end":{"line":1,"column":15},"identifierName":"DebugPrint"}, "name": "DebugPrint" }, "arguments": [ { "type": "NullLiteral", - "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}} } ] } diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/expression/multiple-arguments/output.json b/packages/babel-parser/test/fixtures/v8intrinsic/expression/multiple-arguments/output.json index 3843e6652f..108b36d8c0 100644 --- a/packages/babel-parser/test/fixtures/v8intrinsic/expression/multiple-arguments/output.json +++ b/packages/babel-parser/test/fixtures/v8intrinsic/expression/multiple-arguments/output.json @@ -1,94 +1,27 @@ { "type": "File", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "program": { "type": "Program", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "start": 0, - "end": 26, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 26 - } - }, + "start":0,"end":26,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":26}}, "expression": { "type": "CallExpression", - "start": 0, - "end": 25, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 25 - } - }, + "start":0,"end":25,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":25}}, "callee": { "type": "V8IntrinsicIdentifier", - "start": 0, - "end": 15, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 1, - "column": 15 - }, - "identifierName": "StringParseInt" - }, + "start":0,"end":15,"loc":{"start":{"line":1,"column":0},"end":{"line":1,"column":15},"identifierName":"StringParseInt"}, "name": "StringParseInt" }, "arguments": [ { "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": "42", "raw": "\"42\"" @@ -97,18 +30,7 @@ }, { "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": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/expression/yield-expression/output.json b/packages/babel-parser/test/fixtures/v8intrinsic/expression/yield-expression/output.json index 50294da42d..4a3d356e56 100644 --- a/packages/babel-parser/test/fixtures/v8intrinsic/expression/yield-expression/output.json +++ b/packages/babel-parser/test/fixtures/v8intrinsic/expression/yield-expression/output.json @@ -1,63 +1,18 @@ { "type": "File", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "program": { "type": "Program", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "FunctionDeclaration", - "start": 0, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 0 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":0,"end":53,"loc":{"start":{"line":1,"column":0},"end":{"line":3,"column":1}}, "id": { "type": "Identifier", - "start": 10, - "end": 13, - "loc": { - "start": { - "line": 1, - "column": 10 - }, - "end": { - "line": 1, - "column": 13 - }, - "identifierName": "foo" - }, + "start":10,"end":13,"loc":{"start":{"line":1,"column":10},"end":{"line":1,"column":13},"identifierName":"foo"}, "name": "foo" }, "generator": true, @@ -65,94 +20,27 @@ "params": [], "body": { "type": "BlockStatement", - "start": 16, - "end": 53, - "loc": { - "start": { - "line": 1, - "column": 16 - }, - "end": { - "line": 3, - "column": 1 - } - }, + "start":16,"end":53,"loc":{"start":{"line":1,"column":16},"end":{"line":3,"column":1}}, "body": [ { "type": "ExpressionStatement", - "start": 20, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":20,"end":51,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":33}}, "expression": { "type": "YieldExpression", - "start": 20, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 2 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":20,"end":51,"loc":{"start":{"line":2,"column":2},"end":{"line":2,"column":33}}, "delegate": false, "argument": { "type": "CallExpression", - "start": 26, - "end": 51, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 33 - } - }, + "start":26,"end":51,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":33}}, "callee": { "type": "V8IntrinsicIdentifier", - "start": 26, - "end": 41, - "loc": { - "start": { - "line": 2, - "column": 8 - }, - "end": { - "line": 2, - "column": 23 - }, - "identifierName": "StringParseInt" - }, + "start":26,"end":41,"loc":{"start":{"line":2,"column":8},"end":{"line":2,"column":23},"identifierName":"StringParseInt"}, "name": "StringParseInt" }, "arguments": [ { "type": "StringLiteral", - "start": 42, - "end": 46, - "loc": { - "start": { - "line": 2, - "column": 24 - }, - "end": { - "line": 2, - "column": 28 - } - }, + "start":42,"end":46,"loc":{"start":{"line":2,"column":24},"end":{"line":2,"column":28}}, "extra": { "rawValue": "42", "raw": "\"42\"" @@ -161,18 +49,7 @@ }, { "type": "NumericLiteral", - "start": 48, - "end": 50, - "loc": { - "start": { - "line": 2, - "column": 30 - }, - "end": { - "line": 2, - "column": 32 - } - }, + "start":48,"end":50,"loc":{"start":{"line":2,"column":30},"end":{"line":2,"column":32}}, "extra": { "rawValue": 10, "raw": "10" diff --git a/packages/babel-parser/test/fixtures/v8intrinsic/modulo/01/output.json b/packages/babel-parser/test/fixtures/v8intrinsic/modulo/01/output.json index 6233a3f2dd..0bbbdb1dc3 100644 --- a/packages/babel-parser/test/fixtures/v8intrinsic/modulo/01/output.json +++ b/packages/babel-parser/test/fixtures/v8intrinsic/modulo/01/output.json @@ -1,109 +1,30 @@ { "type": "File", - "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}}, "program": { "type": "Program", - "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}}, "sourceType": "script", "interpreter": null, "body": [ { "type": "ExpressionStatement", - "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}}, "expression": { "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": 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" }, "operator": "%", "right": { "type": "CallExpression", - "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}}, "callee": { "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" }, "arguments": [] diff --git a/packages/babel-parser/test/helpers/runFixtureTests.js b/packages/babel-parser/test/helpers/runFixtureTests.js index b84cba4a59..9c21aa351e 100644 --- a/packages/babel-parser/test/helpers/runFixtureTests.js +++ b/packages/babel-parser/test/helpers/runFixtureTests.js @@ -108,10 +108,23 @@ export function runThrowTestsWithEstree(fixturesPath, parseFunction) { }); } +// compact loc properties into a single line +function compactFixture(jsonString) { + return jsonString.replace( + /"start": (\d+),\s+"end": (\d+),\s+"loc": \{\s+"start":\s\{\s+"line": (\d+),\s+"column": (\d+)\s+\},\s+"end":\s\{\s+"line": (\d+),\s+"column": (\d+)\s+\s+\}(?:,\s+"identifierName": "(\S+)")?\s+\}/gm, + (_, p1, p2, p3, p4, p5, p6, p7) => { + return ( + `"start":${p1},"end":${p2},"loc":{"start":{"line":${p3},"column":${p4}},"end":{"line":${p5},"column":${p6}}` + + (p7 ? `,"identifierName":"${p7}"}` : "}") + ); + }, + ); +} + function save(test, ast) { fs.writeFileSync( test.expect.loc, - JSON.stringify(ast, (k, v) => serialize(v), 2), + compactFixture(JSON.stringify(ast, (k, v) => serialize(v), 2)), ); }